public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/43629] [4.3/4.4 Regression] Struct to register optimization fails
Date: Fri, 02 Apr 2010 11:32:00 -0000	[thread overview]
Message-ID: <20100402113154.32703.qmail@sourceware.org> (raw)
In-Reply-To: <bug-43629-18994@http.gcc.gnu.org/bugzilla/>



------- Comment #1 from rguenth at gcc dot gnu dot org  2010-04-02 11:31 -------
Confirmed.  Yet another SRA to bitfield magic issue.

Workaround: -fno-tree-sra.

struct A {
   short A1 ;
   short A2 ;
   int   A3 ;
};

static struct A __attribute__((noinline))
foo(int b)
{
   struct A result;
   result.A1 = (short)0;
   result.A2 = (short)0;
   /* result.A3 is intentionally not initialized */
   if (b) {
      result.A1 = (short)1;
      result.A2 = (short)2;
      result.A3 = 3;
      return result;
   }
   return result;
}

extern void abort (void);

int main()
{
  struct A myA = foo(0);
  if (myA.A1 != 0)
    abort ();
  return 0;
}


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|c                           |tree-optimization
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
      Known to fail|                            |4.3.0 4.3.4 4.4.0 4.4.3
      Known to work|                            |4.2.4 4.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2010-04-02 11:31:52
               date|                            |
            Summary|Struct to register          |[4.3/4.4 Regression] Struct
                   |optimization fails          |to register optimization
                   |                            |fails
   Target Milestone|---                         |4.3.5


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


  reply	other threads:[~2010-04-02 11:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-02  9:46 [Bug c/43629] New: " julien dot etienne at gmail dot com
2010-04-02 11:32 ` rguenth at gcc dot gnu dot org [this message]
2010-04-02 11:47 ` [Bug tree-optimization/43629] [4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
2010-04-02 12:51 ` [Bug tree-optimization/43629] [4.3/4.4/4.5 " rguenth at gcc dot gnu dot org
2010-04-02 15:03 ` julien dot etienne at gmail dot com
2010-04-02 15:05 ` rguenther at suse dot de
2010-04-02 16:50 ` rguenth at gcc dot gnu dot org
2010-04-02 16:51 ` [Bug tree-optimization/43629] [4.3/4.4 " rguenth at gcc dot gnu dot org
2010-04-02 20:12 ` julien dot etienne at gmail dot com
2010-04-03 19:38 ` mikpe at it dot uu dot se
2010-04-03 19:53 ` rguenth at gcc dot gnu dot org
2010-04-07 15:41 ` rguenth at gcc dot gnu dot org
2010-04-07 15:44 ` [Bug tree-optimization/43629] [4.3 " rguenth at gcc dot gnu dot org
2010-04-12  8:51 ` julien dot etienne at gmail dot com
2010-04-12  9:01 ` rguenther at suse dot de
2010-04-20 13:08 ` rguenth at gcc dot gnu dot org
2010-04-20 13:09 ` rguenth at gcc dot gnu dot org
2010-04-23 21:12 ` julien dot etienne at gmail dot com

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=20100402113154.32703.qmail@sourceware.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).