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

* [Bug optimization/13411] segmentation fault occurs in correct code - optimisation problem at O2
  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 ` micis at gmx dot de
  2003-12-16 16:11 ` micis at gmx dot de
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: micis at gmx dot de @ 2003-12-16 16:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From micis at gmx dot de  2003-12-16 16:05 -------
Created an attachment (id=5339)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5339&action=view)
not pre-processed source file


-- 


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


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

* [Bug optimization/13411] segmentation fault occurs in correct code - optimisation problem at O2
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: micis at gmx dot de @ 2003-12-16 16:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From micis at gmx dot de  2003-12-16 16:06 -------
Created an attachment (id=5340)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5340&action=view)
preprocessed source file


-- 


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


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

* [Bug optimization/13411] segmentation fault occurs in correct code - optimisation problem at O2
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-28 17:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-28 17:32 -------
Can you try a snapshot of 3.4, I cannot reproduce this with a target which adds -mabi=
altivec by default, can you also try that option?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
           Keywords|                            |wrong-code


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


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

* [Bug optimization/13411] segmentation fault occurs in correct code - optimisation problem at O2
  2003-12-16 16:07 [Bug optimization/13411] New: segmentation fault occurs in correct code - optimisation problem at O2 micis at gmx dot de
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-06  1:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-06 01:59 -------
You are violating aliasing rules:
  MTstS8  = (VS8  *) APool;
  MTstU8  = (VU8  *) APool;
  MTstS16 = (VS16 *) APool;
  MTstU16 = (VU16 *) APool;
  MTstS32 = (VS32 *) APool;
  MTstU32 = (VU32 *) APool;
  MTstU32 = (VU32 *) APool;
  MTstF   = (VecF *) APool;
  ETstU8  = (U8   *) APool;

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


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


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

* [Bug rtl-optimization/13411] segmentation fault occurs in correct code - optimisation problem at O2
  2003-12-16 16:07 [Bug optimization/13411] New: segmentation fault occurs in correct code - optimisation problem at O2 micis at gmx dot de
                   ` (3 preceding siblings ...)
  2004-02-06  1:59 ` pinskia at gcc dot gnu dot org
@ 2005-06-05  8:39 ` pinskia at gcc dot gnu dot org
  2005-06-05  8:40 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-05  8:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-05 08:39 -------
Reopening to ...

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


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


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

* [Bug rtl-optimization/13411] segmentation fault occurs in correct code - optimisation problem at O2
  2003-12-16 16:07 [Bug optimization/13411] New: segmentation fault occurs in correct code - optimisation problem at O2 micis at gmx dot de
                   ` (4 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-05  8:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-05 08:40 -------
Mark as a dup of bug 21920.

*** This bug has been marked as a duplicate of 21920 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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).