Commit 89ebafc6 by Paolo Bonzini Committed by Paolo Bonzini

re PR tree-optimization/38984 (NULL pointers always considered distinct by PTA,…

re PR tree-optimization/38984 (NULL pointers always considered distinct by PTA, even with -fno-delete-null-pointer-checks)

gcc:
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.

gcc/testsuite:
2009-01-28  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/38984
	* gcc.dg/pr38984.c: New XFAILed testcase.

From-SVN: r143721
parent bef3c57b
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> 2009-01-28 Uros Bizjak <ubizjak@gmail.com>
PR target/38988 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> 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/37554 PR c++/37554
......
/* { 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" } } */
...@@ -3044,8 +3044,14 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p) ...@@ -3044,8 +3044,14 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p)
happens below, since it will fall into the default case. The only happens below, since it will fall into the default case. The only
case we know something about an integer treated like a pointer is 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 when it is the NULL pointer, and then we just say it points to
NULL. */ NULL.
if (TREE_CODE (t) == INTEGER_CST
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)) && integer_zerop (t))
{ {
temp.var = nothing_id; temp.var = nothing_id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment