+2009-01-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR tree-optimization/38984
+ * tree-ssa-structalias.c (get_constraints_for_1): Do not use
+ the nothing_id variable if -fno-delete-null-pointer-checks.
+
2009-01-28 Uros Bizjak <ubizjak@gmail.com>
PR target/38988
+2009-01-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR tree-optimization/38984
+ * gcc.dg/pr38984.c: New XFAILed testcase.
+
2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/37554
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-delete-null-pointer-checks -fdump-tree-optimized" }
+ * */
+
+int f(int *p)
+{
+ int a = *p;
+ int *null = 0;
+ *null = 5;
+ return *p == a;
+}
+
+/* Currently fails because of PR38985. */
+
+/* { dg-final { scan-tree-dump-times " = \\\*p" 2 "optimized" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-not "return 1" "optimized" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
+
happens below, since it will fall into the default case. The only
case we know something about an integer treated like a pointer is
when it is the NULL pointer, and then we just say it points to
- NULL. */
- if (TREE_CODE (t) == INTEGER_CST
+ NULL.
+
+ Do not do that if -fno-delete-null-pointer-checks though, because
+ in that case *NULL does not fail, so it _should_ alias *anything.
+ It is not worth adding a new option or renaming the existing one,
+ since this case is relatively obscure. */
+ if (flag_delete_null_pointer_checks
+ && TREE_CODE (t) == INTEGER_CST
&& integer_zerop (t))
{
temp.var = nothing_id;