public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/30567]  New: -fPIC -O3 optimizer bug (32-bit target only)
@ 2007-01-24  0:08 rwgk at yahoo dot com
  2007-01-24  0:10 ` [Bug c++/30567] " rwgk at yahoo dot com
                   ` (38 more replies)
  0 siblings, 39 replies; 40+ messages in thread
From: rwgk at yahoo dot com @ 2007-01-24  0:08 UTC (permalink / raw)
  To: gcc-bugs

Platform:
  Fedora Core release 4 (Stentz)
  Linux sharptail.lbl.gov 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2 23:08:39 EDT
2005 i686 i686 i386 GNU/Linux

% g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /net/rosie/scratch2/rwgk/gcc-4_2-branch/configure
--prefix=/net/cci-filer1/vol1/tmp/rwgk/gcc_4_2-branch_2007_01_22_0959_fc4_i686
--enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.2.0 20070122 (prerelease)

I'll upload a standalone reproducer. Sorry it is not minimal, but it is already
heavily reduced from the original code and has only standard header
dependencies.

To reproduce the problem:

g++ -fPIC -O0 ~/dbg.cpp ; ./a.out
1
g++ -fPIC -O3 ~/dbg.cpp ; ./a.out
0
g++ -fPIC -O3 ~/dbg.cpp -DSCITBX_MAT3_TRACE_SIMPLE ; ./a.out
1
g++ -O3 ~/dbg.cpp ; ./a.out
1

The output should be "1" in all cases.

The error occurs in the rot_mx::type() function near the end of the reproducer.
Inserting std::cout statements in this function makes the error go away.
Therefore I don't know what exactly is going wrong.

By chance I noticed that the SCITBX_MAT3_TRACE_SIMPLE change (see code) also
works around the problem. However, the trace() function always works if called
directly.

I noticed the error the first time on Dec 29, 2006 under 32-bit Fedora 6.
Therefore I believe it is not Fedora 4 or 6 specific, but a general 32-bit
optimizer problem.

The gcc svn versions from Dec 29 and Jan 22 both work flawlessly on a 64-bit
platfrom (Fedora 5).

I hope you can take it from here. Let me know if you need any other
information.


-- 
           Summary: -fPIC -O3 optimizer bug (32-bit target only)
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rwgk at yahoo dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2007-04-26 15:50 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-24  0:08 [Bug c++/30567] New: -fPIC -O3 optimizer bug (32-bit target only) rwgk at yahoo dot com
2007-01-24  0:10 ` [Bug c++/30567] " rwgk at yahoo dot com
2007-01-24  6:57 ` pinskia at gcc dot gnu dot org
2007-01-28 20:03 ` rwgk at yahoo dot com
2007-02-03 20:42 ` rwgk at yahoo dot com
2007-02-11  4:08 ` bangerth at dealii dot org
2007-02-11  5:30 ` rwgk at yahoo dot com
2007-02-12  0:02 ` bangerth at dealii dot org
2007-02-12  5:23 ` rwgk at yahoo dot com
2007-02-12 15:48 ` rwgk at yahoo dot com
2007-02-12 16:03 ` bangerth at dealii dot org
2007-02-12 16:37 ` dberlin at gcc dot gnu dot org
2007-02-26  2:26 ` rwgk at yahoo dot com
2007-02-26  2:42 ` dberlin at dberlin dot org
2007-02-26  3:37 ` rwgk at yahoo dot com
2007-02-26  4:38 ` dberlin at gcc dot gnu dot org
2007-02-26  7:55 ` rwgk at yahoo dot com
2007-02-26 18:41 ` bangerth at dealii dot org
2007-04-18 19:00 ` hjl at lucon dot org
2007-04-18 19:02 ` hjl at lucon dot org
2007-04-18 20:47 ` hjl at lucon dot org
2007-04-18 21:11 ` [Bug c++/30567] -fPIC -O3 optimizer bug hjl at lucon dot org
2007-04-18 21:47 ` [Bug c++/30567] " rguenth at gcc dot gnu dot org
2007-04-18 21:56 ` [Bug tree-optimization/30567] " rguenth at gcc dot gnu dot org
2007-04-21 17:08 ` [Bug tree-optimization/30567] [4.2 Regression] " rguenth at gcc dot gnu dot org
2007-04-21 17:38 ` rguenth at gcc dot gnu dot org
2007-04-24 20:37 ` mmitchel at gcc dot gnu dot org
2007-04-25  2:14 ` dberlin at gcc dot gnu dot org
2007-04-25 13:22 ` rguenth at gcc dot gnu dot org
2007-04-25 13:43 ` rguenth at gcc dot gnu dot org
2007-04-25 14:04 ` rguenth at gcc dot gnu dot org
2007-04-25 15:32 ` rguenth at gcc dot gnu dot org
2007-04-25 15:42 ` rguenth at gcc dot gnu dot org
2007-04-25 16:01 ` dberlin at dberlin dot org
2007-04-25 16:13 ` rguenth at gcc dot gnu dot org
2007-04-25 18:45 ` dberlin at gcc dot gnu dot org
2007-04-26  9:02 ` rguenth at gcc dot gnu dot org
2007-04-26 11:16 ` rguenth at gcc dot gnu dot org
2007-04-26 11:16 ` rguenth at gcc dot gnu dot org
2007-04-26 15:50 ` rguenth 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).