+2010-04-30 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/43879
+ * tree-ssa-structalias.c (get_constraint_for_1): Properly
+ handle non-zero initializers.
+
2010-04-30 Richard Guenther <rguenther@suse.de>
* builtins.c (fold_builtin_1): Delete free (0).
+2010-04-30 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/43879
+ * gcc.dg/torture/pr43879_1.c: New testcase.
+
2010-04-30 Richard Guenther <rguenther@suse.de>
* gcc.dg/tree-ssa/builtin-free.c: New testcase.
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-fipa-pta" } */
+/* { dg-additional-sources "pr43879_2.c" } */
+
+void bar(int c)
+{
+ static int x = 1;
+ if (c != x) __builtin_abort();
+ x--;
+}
+
+void baz(int *i)
+{
+ (*i)--;
+}
+
+struct TBL {
+ int (*p)(int *i);
+};
+extern struct TBL tbl;
+
+int main()
+{
+ int c = 1;
+ return tbl.p(&c);
+}
+
--- /dev/null
+struct TBL {
+ int (*p)(int *i);
+};
+
+extern void bar(int i);
+extern void baz(int *i);
+
+static int foo(int *i)
+{
+ bar(*i);
+ baz(i);
+ bar(*i);
+ return *i;
+}
+
+struct TBL tbl = { foo };
+
&& ((TREE_CODE (t) == INTEGER_CST
&& integer_zerop (t))
/* The only valid CONSTRUCTORs in gimple with pointer typed
- elements are zero-initializer. */
- || TREE_CODE (t) == CONSTRUCTOR))
+ elements are zero-initializer. But in IPA mode we also
+ process global initializers, so verify at least. */
+ || (TREE_CODE (t) == CONSTRUCTOR
+ && CONSTRUCTOR_NELTS (t) == 0)))
{
temp.var = nothing_id;
temp.type = ADDRESSOF;