public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/28812]  New: RTL aliasing vs may_alias and structs
@ 2006-08-22 21:35 pinskia at gcc dot gnu dot org
  2006-08-22 21:53 ` [Bug rtl-optimization/28812] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-22 21:35 UTC (permalink / raw)
  To: gcc-bugs

The following testcase should work with -fstrict-aliasing -O2 but does not:

struct S { short x; };
typedef struct S __attribute__((__may_alias__)) test;

test *p;

int g(int *a)
{
 p = (test*)a;
}

int f()
{
  int a;
  g(&a);
  a = 10;
  test s={1};
  *p=s;
  return a;
}

int main() {
  if (f() == 10)
    __builtin_abort();
  return 0;
}


-- 
           Summary: RTL aliasing vs may_alias and structs
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


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

end of thread, other threads:[~2007-04-23 18:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-22 21:35 [Bug rtl-optimization/28812] New: RTL aliasing vs may_alias and structs pinskia at gcc dot gnu dot org
2006-08-22 21:53 ` [Bug rtl-optimization/28812] " pinskia at gcc dot gnu dot org
2006-08-27  4:56 ` pinskia at gcc dot gnu dot org
2006-11-10  1:09 ` pinskia at gcc dot gnu dot org
2006-11-12  1:11 ` pinskia at gcc dot gnu dot org
2006-11-12  1:12 ` pinskia at gcc dot gnu dot org
2006-12-01  1:07 ` chaoyingfu at gcc dot gnu dot org
2007-04-23 18:38 ` amylaar 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).