public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug optimization/11269] New: [tree-ssa] wrong-code
Date: Fri, 20 Jun 2003 18:35:00 -0000	[thread overview]
Message-ID: <20030620183319.11269.reichelt@gcc.gnu.org> (raw)

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.


             reply	other threads:[~2003-06-20 18:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-20 18:35 reichelt at gcc dot gnu dot org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030620183319.11269.reichelt@gcc.gnu.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).