public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/11269] New: [tree-ssa] wrong-code
@ 2003-06-20 18:35 reichelt at gcc dot gnu dot org
  2003-06-21  1:31 ` [Bug optimization/11269] " bangerth at dealii dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2003-06-20 18:35 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [tree-ssa] wrong-code
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P1
         Component: optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: reichelt@gcc.gnu.org
                CC: dnovillo@gcc.gnu.org,gcc-bugs@gcc.gnu.org
  GCC host triplet: i686-pc-linux-gnu

The following code snippet (inspired by PR6189) should return "1",
but does not, if optimization on the tree-ssa-branch is turned on.

---------------------------------------------------------------
struct A
{
    int  x[2];
    int& GetFirst() { return x[0]; }
};


A foo ()
{
    A a;
    a.GetFirst()=1;
    return a;
}


int main()
{
    A b=foo();
    return b.GetFirst();
}
---------------------------------------------------------------

Without optimization I get the return value "1", with "-O" or "-O2"
I get "192" and with "-O3" I get "0".

This is a regression w.r.t. mainline.


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

end of thread, other threads:[~2003-11-17  0:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-20 18:35 [Bug optimization/11269] New: [tree-ssa] wrong-code reichelt at gcc dot gnu dot org
2003-06-21  1:31 ` [Bug optimization/11269] " bangerth at dealii dot org
2003-06-21  2:23 ` dhazeghi at yahoo dot com
2003-07-06 22:17 ` steven at gcc dot gnu dot org
2003-07-07 11:13 ` reichelt at gcc dot gnu dot org
2003-08-08  9:37 ` reichelt at gcc dot gnu dot org
2003-08-15  3:10 ` pinskia at gcc dot gnu dot org
2003-08-20  3:32 ` pinskia at gcc dot gnu dot org
2003-09-07 13:10 ` steven at gcc dot gnu dot org
2003-09-14 16:40 ` dnovillo at gcc dot gnu dot org
2003-09-14 20:26 ` steven at gcc dot gnu dot org
2003-10-22  2:41 ` jason at gcc dot gnu dot org
2003-11-17  0:31 ` cvs-commit at gcc dot gnu dot org
2003-11-17  0:34 ` jason 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).