public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/36226] New: Optimization corrupts volatile function pointer return handling
@ 2008-05-12 22:46 mbenedict at aclaratech dot com
2008-05-12 22:48 ` [Bug tree-optimization/36226] " mbenedict at aclaratech dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: mbenedict at aclaratech dot com @ 2008-05-12 22:46 UTC (permalink / raw)
To: gcc-bugs
When using a volatile function pointer and compiling with -O2 optimization, the
resulting program will not correctly return from the function pointer but will
instead jump to another point of the program. I have been able to reproduce
this behavior with gcc 3.4.6, 4.0.2 and the x86 locally hosted 4.1.1 version of
gcc.
Originally the bug was discovered with:
$ powerpc-603-linux-gnu-gcc -v
Reading specs from
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-603-linux-gnu/lib/gcc/powerpc-603-linux-gnu/3.4.5/specs
Configured with:
/home/mbenedict/src/crosstool-0.43/build/powerpc-603-linux-gnu/gcc-3.4.5-glibc-2.3.6/gcc-3.4.5/configure
--target=powerpc-603-linux-gnu --host=i686-host_pc-linux-gnu
--prefix=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-603-linux-gnu
--with-cpu=603 --enable-cxx-flags=-mcpu=603
--with-headers=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-603-linux-gnu/powerpc-603-linux-gnu/include
--with-local-prefix=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-603-linux-gnu/powerpc-603-linux-gnu
--disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit
--enable-languages=c --enable-shared --enable-c99 --enable-long-long
Thread model: posix
gcc version 3.4.5
I will attach the .i file that reproduces this condition in the first comment
(I can't seem to attach from the new bug screen).
--
Summary: Optimization corrupts volatile function pointer return
handling
Product: gcc
Version: 3.4.5
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mbenedict at aclaratech dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: powerpc-603-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36226
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/36226] Optimization corrupts volatile function pointer return handling
2008-05-12 22:46 [Bug tree-optimization/36226] New: Optimization corrupts volatile function pointer return handling mbenedict at aclaratech dot com
@ 2008-05-12 22:48 ` mbenedict at aclaratech dot com
2008-05-12 22:50 ` pinskia at gcc dot gnu dot org
2008-12-29 2:33 ` [Bug middle-end/36226] " pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: mbenedict at aclaratech dot com @ 2008-05-12 22:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from mbenedict at aclaratech dot com 2008-05-12 22:48 -------
Created an attachment (id=15632)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15632&action=view)
File that reproduces the problem
Note also that when optimizing (-O2) the assembly comment" # XXX - This
assembly line is missing when optimized" goes away
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36226
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/36226] Optimization corrupts volatile function pointer return handling
2008-05-12 22:46 [Bug tree-optimization/36226] New: Optimization corrupts volatile function pointer return handling mbenedict at aclaratech dot com
2008-05-12 22:48 ` [Bug tree-optimization/36226] " mbenedict at aclaratech dot com
@ 2008-05-12 22:50 ` pinskia at gcc dot gnu dot org
2008-12-29 2:33 ` [Bug middle-end/36226] " pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-05-12 22:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2008-05-12 22:49 -------
volatile here means no return and no standard C meaning IIRC.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36226
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/36226] Optimization corrupts volatile function pointer return handling
2008-05-12 22:46 [Bug tree-optimization/36226] New: Optimization corrupts volatile function pointer return handling mbenedict at aclaratech dot com
2008-05-12 22:48 ` [Bug tree-optimization/36226] " mbenedict at aclaratech dot com
2008-05-12 22:50 ` pinskia at gcc dot gnu dot org
@ 2008-12-29 2:33 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-29 2:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2008-12-29 02:31 -------
volatile here means noreturn.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36226
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-12-29 2:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-12 22:46 [Bug tree-optimization/36226] New: Optimization corrupts volatile function pointer return handling mbenedict at aclaratech dot com
2008-05-12 22:48 ` [Bug tree-optimization/36226] " mbenedict at aclaratech dot com
2008-05-12 22:50 ` pinskia at gcc dot gnu dot org
2008-12-29 2:33 ` [Bug middle-end/36226] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).