* [patch] Fix for failing gdb.base/mips_pro.exp under gcc-4.3.1
@ 2008-08-22 0:27 Paul Pluzhnikov
2008-08-22 0:47 ` Michael Snyder
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Paul Pluzhnikov @ 2008-08-22 0:27 UTC (permalink / raw)
To: gdb-patches
Greetings,
Gcc-4.3.1 optimizes the whole thing away:
(gdb) disas main
Dump of assembler code for function main:
0x0000000000400340 <main+0>: mov $0x16,%eax
0x0000000000400345 <main+5>: retq
End of assembler dump.
Attached patch disables inlining.
The -O2 flag was added here:
Sun Mar 17 13:35:31 1996 Fred Fish <fnf@cygnus.com>
* 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 :(
--
Paul Pluzhnikov
2008-02-12 Paul Pluzhnikov <ppluzhnikov@google.com>
*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
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] Fix for failing gdb.base/mips_pro.exp under gcc-4.3.1
2008-08-22 0:27 [patch] Fix for failing gdb.base/mips_pro.exp under gcc-4.3.1 Paul Pluzhnikov
@ 2008-08-22 0:47 ` Michael Snyder
2008-08-29 23:34 ` Paul Pluzhnikov
2008-09-04 23:59 ` Joel Brobecker
2 siblings, 0 replies; 6+ messages in thread
From: Michael Snyder @ 2008-08-22 0:47 UTC (permalink / raw)
To: Paul Pluzhnikov; +Cc: gdb-patches
Paul Pluzhnikov wrote:
> Greetings,
>
> Gcc-4.3.1 optimizes the whole thing away:
>
> (gdb) disas main
> Dump of assembler code for function main:
> 0x0000000000400340 <main+0>: mov $0x16,%eax
> 0x0000000000400345 <main+5>: retq
> End of assembler dump.
>
> Attached patch disables inlining.
>
> The -O2 flag was added here:
>
> Sun Mar 17 13:35:31 1996 Fred Fish <fnf@cygnus.com>
>
> * 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 <ppluzhnikov@google.com>
>
> *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
> }
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] Fix for failing gdb.base/mips_pro.exp under gcc-4.3.1
2008-08-22 0:27 [patch] Fix for failing gdb.base/mips_pro.exp under gcc-4.3.1 Paul Pluzhnikov
2008-08-22 0:47 ` Michael Snyder
@ 2008-08-29 23:34 ` Paul Pluzhnikov
2008-09-04 23:59 ` Joel Brobecker
2 siblings, 0 replies; 6+ messages in thread
From: Paul Pluzhnikov @ 2008-08-29 23:34 UTC (permalink / raw)
To: gdb-patches
Ping,
http://sourceware.org/ml/gdb-patches/2008-08/msg00576.html
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] Fix for failing gdb.base/mips_pro.exp under gcc-4.3.1
2008-08-22 0:27 [patch] Fix for failing gdb.base/mips_pro.exp under gcc-4.3.1 Paul Pluzhnikov
2008-08-22 0:47 ` Michael Snyder
2008-08-29 23:34 ` Paul Pluzhnikov
@ 2008-09-04 23:59 ` Joel Brobecker
2008-09-05 5:16 ` Paul Pluzhnikov
2 siblings, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2008-09-04 23:59 UTC (permalink / raw)
To: Paul Pluzhnikov; +Cc: gdb-patches
(sorry about the delay - it looks like everyone was very very busy
this summer)
> I could not find *why* optimization is necessary for that test case,
> so don't know if disabling inlining is the correct fix :(
Like Michael said, we have to assume the obvious, which is that they
wanted to test unwinding of optimized code.
> 2008-02-12 Paul Pluzhnikov <ppluzhnikov@google.com>
>
> *gdb.base/mips_pro.exp: compile with gcc -fno-inline,
> lest gcc-4.3.1 optimizes the whole thing away.
With that in mind, your patch makes sense. We want optimized code, but
not that much optimization :).
--
Joel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] Fix for failing gdb.base/mips_pro.exp under gcc-4.3.1
2008-09-04 23:59 ` Joel Brobecker
@ 2008-09-05 5:16 ` Paul Pluzhnikov
2008-09-05 13:59 ` Joel Brobecker
0 siblings, 1 reply; 6+ messages in thread
From: Paul Pluzhnikov @ 2008-09-05 5:16 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On Thu, Sep 4, 2008 at 4:58 PM, Joel Brobecker <brobecker@adacore.com> wrote:
> (sorry about the delay - it looks like everyone was very very busy
> this summer)
>
>> I could not find *why* optimization is necessary for that test case,
>> so don't know if disabling inlining is the correct fix :(
>
> Like Michael said, we have to assume the obvious, which is that they
> wanted to test unwinding of optimized code.
>
>> 2008-02-12 Paul Pluzhnikov <ppluzhnikov@google.com>
Hmm, that should have been 2008-08-22 ...
>>
>> *gdb.base/mips_pro.exp: compile with gcc -fno-inline,
>> lest gcc-4.3.1 optimizes the whole thing away.
>
> With that in mind, your patch makes sense. We want optimized code, but
> not that much optimization :).
So ok to commit?
Thanks,
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] Fix for failing gdb.base/mips_pro.exp under gcc-4.3.1
2008-09-05 5:16 ` Paul Pluzhnikov
@ 2008-09-05 13:59 ` Joel Brobecker
0 siblings, 0 replies; 6+ messages in thread
From: Joel Brobecker @ 2008-09-05 13:59 UTC (permalink / raw)
To: Paul Pluzhnikov; +Cc: gdb-patches
> >> *gdb.base/mips_pro.exp: compile with gcc -fno-inline,
> >> lest gcc-4.3.1 optimizes the whole thing away.
> >
> > With that in mind, your patch makes sense. We want optimized code, but
> > not that much optimization :).
>
> So ok to commit?
Yes :).
--
Joel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-09-05 13:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-22 0:27 [patch] Fix for failing gdb.base/mips_pro.exp under gcc-4.3.1 Paul Pluzhnikov
2008-08-22 0:47 ` Michael Snyder
2008-08-29 23:34 ` Paul Pluzhnikov
2008-09-04 23:59 ` Joel Brobecker
2008-09-05 5:16 ` Paul Pluzhnikov
2008-09-05 13:59 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox