public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/13411] New: segmentation fault occurs in correct code - optimisation problem at O2
@ 2003-12-16 16:07 micis at gmx dot de
  2003-12-16 16:09 ` [Bug optimization/13411] " micis at gmx dot de
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: micis at gmx dot de @ 2003-12-16 16:07 UTC (permalink / raw)
  To: gcc-bugs

A small function named SM33S destroys local variables which lead to an
segmentation fault when called twice.
This error occurs only when some printf statements are after the declaration
of variables and not at the beginning of the function.
Also the function works when the adresses of data accesses are checked.
It seems to be an optimisation problem since it occurs only at -O2 or higher.
At -O0 the compiler generates an internal compiler error, but I will submit
this in a different bug report.

This program is a test program for developing an altivec function. The 
same operation is implemented in different ways (with and without altivec
code) and the results are compared.
If the altivec implementation is removed or returns immediately, SM33S
alters one of the loacal variables in main() but no segmentation error
occurs.
I have tried to narrow this bug down, but if you change to much on that 
program, the error will not occur.


output from gcc -v:

Reading specs from /usr/lib/gcc-lib/powerpc-linux/3.3.2/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared 
--with-system-zlib --enable-nls --without-included-gettext 
--enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm 
--enable-java-awt=xlib --enable-objc-gc --disable-multilib powerpc-linux
Thread model: posix
gcc version 3.3.2 (Debian)


gcc command line:

gcc -g -o matbug matbug.cpp -mcpu=7450 -maltivec -O2 -lstdc++ -Wall  -pedantic -
lefence -save-temps -fverbose-asm

-- 
           Summary: segmentation fault occurs in correct code - optimisation
                    problem at O2
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: micis at gmx dot de
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: powerpc-linux
GCC target triplet: powerpc-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13411


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-06-05  8:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-16 16:07 [Bug optimization/13411] New: segmentation fault occurs in correct code - optimisation problem at O2 micis at gmx dot de
2003-12-16 16:09 ` [Bug optimization/13411] " micis at gmx dot de
2003-12-16 16:11 ` micis at gmx dot de
2004-01-28 17:33 ` pinskia at gcc dot gnu dot org
2004-02-06  1:59 ` pinskia at gcc dot gnu dot org
2005-06-05  8:39 ` [Bug rtl-optimization/13411] " pinskia at gcc dot gnu dot org
2005-06-05  8:40 ` 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).