public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31809]  New: [4.1/4.2/4.3 Regression] sometimes TREE_READONLY is still set for non read only variables causing wrong code
@ 2007-05-04  0:25 pinskia at gcc dot gnu dot org
  2007-05-04  0:26 ` [Bug c++/31809] " pinskia at gcc dot gnu dot org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-04  0:25 UTC (permalink / raw)
  To: gcc-bugs

Testcase which should not abort but does currently at -O1 and above because SRA
thinks the decl is constant so it using its DECL_INITIAL but that is NULL so we
get a zero instead of the corect value:
struct sc
{
 unsigned v;
 static inline sc f(unsigned a);
};
inline sc sc::f(unsigned a)
{
 static sc t = { a };
 return t;
}
const static sc RC = sc::f( 1 );
extern "C" void abort (void);
int main()
{
  sc RC1 = RC;
 if (! RC1.v ) abort ();
 return 0;
}


-- 
           Summary: [4.1/4.2/4.3 Regression] sometimes TREE_READONLY is
                    still set for non read only variables causing wrong code
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc-linux-gnu


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


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

end of thread, other threads:[~2007-06-20 16:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-04  0:25 [Bug c++/31809] New: [4.1/4.2/4.3 Regression] sometimes TREE_READONLY is still set for non read only variables causing wrong code pinskia at gcc dot gnu dot org
2007-05-04  0:26 ` [Bug c++/31809] " pinskia at gcc dot gnu dot org
2007-05-04  9:33 ` rguenth at gcc dot gnu dot org
2007-05-11 20:02 ` mmitchel at gcc dot gnu dot org
2007-05-25 11:39 ` jakub at gcc dot gnu dot org
2007-05-28  1:12 ` mmitchel at gcc dot gnu dot org
2007-05-30 17:58 ` jakub at gcc dot gnu dot org
2007-05-30 21:24 ` jakub at gcc dot gnu dot org
2007-05-30 22:46 ` mueller at gcc dot gnu dot org
2007-05-30 23:03 ` mark at codesourcery dot com
2007-05-31  9:06 ` mueller at gcc dot gnu dot org
2007-05-31 10:01 ` jakub at gcc dot gnu dot org
2007-05-31 16:33 ` mark at codesourcery dot com
2007-06-08 21:49 ` [Bug c++/31809] [4.1/4.2 " mueller at gcc dot gnu dot org
2007-06-20 16:27 ` [Bug c++/31809] [4.1 " mueller at gcc dot gnu dot org
2007-06-20 16:28 ` mueller 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).