public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/28807]  New: [4.2 Regression] wrong code with may_alias and structs
@ 2006-08-22 17:59 pinskia at gcc dot gnu dot org
  2006-08-22 17:59 ` [Bug tree-optimization/28807] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-22 17:59 UTC (permalink / raw)
  To: gcc-bugs

Testcase:
#include <stdio.h>

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

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

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

-------
Even though the struct is not the same size as int, this should still work as
the struct is marked as may_alias so we get an aliasing set of 0.


-- 
           Summary: [4.2 Regression] wrong code with may_alias and structs
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-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=28807


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

end of thread, other threads:[~2006-08-25  7:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-22 17:59 [Bug tree-optimization/28807] New: [4.2 Regression] wrong code with may_alias and structs pinskia at gcc dot gnu dot org
2006-08-22 17:59 ` [Bug tree-optimization/28807] " pinskia at gcc dot gnu dot org
2006-08-22 18:19 ` dberlin at gcc dot gnu dot org
2006-08-22 21:49 ` pinskia at gcc dot gnu dot org
2006-08-22 21:50 ` pinskia at gcc dot gnu dot org
2006-08-23  1:40 ` dberlin at dberlin dot org
2006-08-23  8:06 ` pinskia at gcc dot gnu dot org
2006-08-23  8:11 ` pinskia at gcc dot gnu dot org
2006-08-24 15:16 ` pinskia at gcc dot gnu dot org
2006-08-24 15:19 ` patchapp at dberlin dot org
2006-08-25  7:14 ` pinskia at gcc dot gnu dot org
2006-08-25  7:14 ` pinskia 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).