From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20150 invoked by alias); 22 Aug 2008 00:47:21 -0000 Received: (qmail 20142 invoked by uid 22791); 22 Aug 2008 00:47:20 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 22 Aug 2008 00:46:37 +0000 Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.64.160]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id B029E1602D; Thu, 21 Aug 2008 17:46:35 -0700 (PDT) Received: from [10.20.92.47] (promb-2s-dhcp47.eng.vmware.com [10.20.92.47]) by mailhost2.vmware.com (Postfix) with ESMTP id B104D3C037; Thu, 21 Aug 2008 17:46:35 -0700 (PDT) Message-ID: <48AE0BFD.6060803@vmware.com> Date: Fri, 22 Aug 2008 00:47:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Paul Pluzhnikov CC: "gdb-patches@sourceware.org" Subject: Re: [patch] Fix for failing gdb.base/mips_pro.exp under gcc-4.3.1 References: <20080822002653.A73DF3A67DF@localhost> In-Reply-To: <20080822002653.A73DF3A67DF@localhost> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00577.txt.bz2 Paul Pluzhnikov wrote: > Greetings, > > Gcc-4.3.1 optimizes the whole thing away: > > (gdb) disas main > Dump of assembler code for function main: > 0x0000000000400340 : mov $0x16,%eax > 0x0000000000400345 : retq > End of assembler dump. > > Attached patch disables inlining. > > The -O2 flag was added here: > > Sun Mar 17 13:35:31 1996 Fred Fish > > * gdb.base/mips_pro.exp: Create mips_pro.ci to get gcc_compiled > defined, and use it to compile the test case with -O2. The > native compilation still uses no optimization. > > I could not find *why* optimization is necessary for that test case, > so don't know if disabling inlining is the correct fix :( Well, I think it's supposed to be specifically a test for debugging optimized, no-symbols code. But inlining would probably be a problem, yes... > > -- > Paul Pluzhnikov > > 2008-02-12 Paul Pluzhnikov > > *gdb.base/mips_pro.exp: compile with gcc -fno-inline, > lest gcc-4.3.1 optimizes the whole thing away. > > > Index: gdb.base/mips_pro.exp > =================================================================== > RCS file: /cvs/src/src/gdb/testsuite/gdb.base/mips_pro.exp,v > retrieving revision 1.10 > diff -u -p -u -r1.10 mips_pro.exp > --- gdb.base/mips_pro.exp 6 Aug 2008 12:52:07 -0000 1.10 > +++ gdb.base/mips_pro.exp 22 Aug 2008 00:20:15 -0000 > @@ -35,7 +35,8 @@ if [get_compiler_info ${binfile}] { > # This test must be compiled with -O2 if using gcc. > > if { [test_compiler_info gcc-*-*] } then { > - if { [gdb_compile "${srcdir}/$subdir/${srcfile}" "${binfile}" executable {debug additional_flags=-O2}] != "" } { > + if { [gdb_compile "${srcdir}/$subdir/${srcfile}" "${binfile}" \ > + executable {debug additional_flags=-O2 additional_flags=-fno-inline}] != "" } { > untested mips_pro.exp > return -1 > }