2006-08-24 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/28807
* tree-ssa-operands.c (access_can_touch_variable): Don't say
the access through a base which has an alias set of 0 cannot
touch the variable.
2006-08-24 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/28807
* gcc.c-torture/execute/mayalias-2.c: New test.
* gcc.dg/tree-ssa/alias-13.c: New test.
From-SVN: r116393
-2006-08-24 Bill Wendling <wendling@apple.com>
+2006-08-24 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR tree-opt/28807
+ * tree-ssa-operands.c (access_can_touch_variable): Don't say
+ the access through a base which has an alias set of 0 cannot
+ touch the variable.
+
+2006-08-24 Bill Wendling <wendling@apple.com>
* doc/tm.texi (TARGET_DEFAULT_PACK_STRUCT): Fixed English.
+2006-08-24 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR tree-opt/28807
+ * gcc.c-torture/execute/mayalias-2.c: New test.
+ * gcc.dg/tree-ssa/alias-13.c: New test.
+
2006-08-24 Jan Hubicka <jh@suse.cz>
PR debug/26881
--- /dev/null
+struct S { short x; };
+typedef struct S __attribute__((__may_alias__)) test;
+
+int f() {
+ int a=10;
+ test *p=(test *)&a;
+ p->x = 1;
+ return a;
+}
+
+int main() {
+ if (f() == 10)
+ __builtin_abort();
+ return 0;
+}
+
+
--- /dev/null
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+
+struct a
+{
+ char a1;
+};
+
+int *aa;
+
+void g(int *a)
+{
+ aa = a;
+ *a = 2;
+}
+
+int t(int i, struct a *b)
+{
+ g(&i);
+ b->a1 = 1;
+ i = 2;
+ if (b->a1 != 1)
+ link_failure ();
+}
+int main(void)
+{
+ struct a b;
+ t(1, &b);
+ return 0;
+}
+
+
|| TREE_CODE (TREE_TYPE (base)) != UNION_TYPE)
&& !AGGREGATE_TYPE_P (TREE_TYPE (alias))
&& TREE_CODE (TREE_TYPE (alias)) != COMPLEX_TYPE
- && !POINTER_TYPE_P (TREE_TYPE (alias)))
+ && !POINTER_TYPE_P (TREE_TYPE (alias))
+ /* When the struct has may_alias attached to it, we need not to
+ return true. */
+ && get_alias_set (base))
{
#ifdef ACCESS_DEBUGGING
fprintf (stderr, "Access to ");