2011-07-14 Richard Guenther <rguenther@suse.de>
PR tree-optimization/49651
* tree-ssa-structalias.c (get_constraint_for_1): Properly
handle dereferences with subvariables.
* gcc.dg/torture/pr49651.c: New testcase.
From-SVN: r176274
+2011-07-14 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/49651
+ * tree-ssa-structalias.c (get_constraint_for_1): Properly
+ handle dereferences with subvariables.
+
2011-07-14 Richard Guenther <rguenther@suse.de>
* gimple-fold.c (fold_gimple_assign): Remove operand swapping.
+2011-07-14 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/49651
+ * gcc.dg/torture/pr49651.c: New testcase.
+
2011-07-14 Georg-Johann Lay <avr@gjlay.de>
PR target/43746
--- /dev/null
+/* { dg-do run } */
+
+extern void abort (void);
+
+struct X {
+ int *p;
+ int *q;
+};
+
+void __attribute__((noinline, noclone))
+foo (struct X x) { *x.q = 0; }
+
+volatile int what;
+struct X y;
+
+int main()
+{
+ int i, j;
+ struct X x, *p;
+ x.p = &i;
+ x.q = &j;
+ if (what)
+ p = &y;
+ else
+ p = &x;
+ j = 1;
+ foo (*p);
+ if (j != 0)
+ abort ();
+ return 0;
+}
/* If we are not taking the address then make sure to process
all subvariables we might access. */
+ if (address_p)
+ return;
+
cs = *VEC_last (ce_s, *results);
- if (address_p
- || cs.type != SCALAR)
+ if (cs.type == DEREF)
+ {
+ /* For dereferences this means we have to defer it
+ to solving time. */
+ VEC_last (ce_s, *results)->offset = UNKNOWN_OFFSET;
+ return;
+ }
+ if (cs.type != SCALAR)
return;
vi = get_varinfo (cs.var);