mirror of git://gcc.gnu.org/git/gcc.git
re PR tree-optimization/39746 (Fail pr34513.c and pr34513.C at -O1 and above)
2009-04-17 Richard Guenther <rguenther@suse.de> PR tree-optimization/39746 * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Remove special-casing for builtins and static variable use/def. (call_may_clobber_ref_p_1): Likewise. From-SVN: r146240
This commit is contained in:
parent
36c7355262
commit
e3ac77ff51
|
@ -1,3 +1,10 @@
|
||||||
|
2009-04-17 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR tree-optimization/39746
|
||||||
|
* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Remove
|
||||||
|
special-casing for builtins and static variable use/def.
|
||||||
|
(call_may_clobber_ref_p_1): Likewise.
|
||||||
|
|
||||||
2009-04-16 Ian Lance Taylor <iant@google.com>
|
2009-04-16 Ian Lance Taylor <iant@google.com>
|
||||||
|
|
||||||
* df.h: Include "timevar.h".
|
* df.h: Include "timevar.h".
|
||||||
|
|
|
@ -737,7 +737,7 @@ refs_may_alias_p (tree ref1, tree ref2)
|
||||||
static bool
|
static bool
|
||||||
ref_maybe_used_by_call_p_1 (gimple call, tree ref)
|
ref_maybe_used_by_call_p_1 (gimple call, tree ref)
|
||||||
{
|
{
|
||||||
tree base, fndecl;
|
tree base;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
int flags = gimple_call_flags (call);
|
int flags = gimple_call_flags (call);
|
||||||
|
|
||||||
|
@ -758,14 +758,8 @@ ref_maybe_used_by_call_p_1 (gimple call, tree ref)
|
||||||
cannot possibly use it. */
|
cannot possibly use it. */
|
||||||
if (DECL_P (base)
|
if (DECL_P (base)
|
||||||
&& !may_be_aliased (base)
|
&& !may_be_aliased (base)
|
||||||
/* But local statics can be used through recursion! */
|
/* But local statics can be used through recursion. */
|
||||||
&& (!is_global_var (base)
|
&& !is_global_var (base))
|
||||||
/* But not via builtins.
|
|
||||||
??? We just assume that this is true if we are not a
|
|
||||||
builtin function ourself. */
|
|
||||||
|| (!DECL_BUILT_IN (cfun->decl)
|
|
||||||
&& (fndecl = gimple_call_fndecl (call))
|
|
||||||
&& DECL_BUILT_IN (fndecl))))
|
|
||||||
goto process_args;
|
goto process_args;
|
||||||
|
|
||||||
/* Check if base is a global static variable that is not read
|
/* Check if base is a global static variable that is not read
|
||||||
|
@ -865,7 +859,7 @@ ref_maybe_used_by_stmt_p (gimple stmt, tree ref)
|
||||||
static bool
|
static bool
|
||||||
call_may_clobber_ref_p_1 (gimple call, tree ref)
|
call_may_clobber_ref_p_1 (gimple call, tree ref)
|
||||||
{
|
{
|
||||||
tree fndecl, base;
|
tree base;
|
||||||
|
|
||||||
/* If the call is pure or const it cannot clobber anything. */
|
/* If the call is pure or const it cannot clobber anything. */
|
||||||
if (gimple_call_flags (call)
|
if (gimple_call_flags (call)
|
||||||
|
@ -884,15 +878,11 @@ call_may_clobber_ref_p_1 (gimple call, tree ref)
|
||||||
cannot possibly clobber it. */
|
cannot possibly clobber it. */
|
||||||
if (DECL_P (base)
|
if (DECL_P (base)
|
||||||
&& !may_be_aliased (base)
|
&& !may_be_aliased (base)
|
||||||
/* But local non-readonly statics can be modified through recursion! */
|
/* But local non-readonly statics can be modified through recursion
|
||||||
|
or the call may implement a threading barrier which we must
|
||||||
|
treat as may-def. */
|
||||||
&& (TREE_READONLY (base)
|
&& (TREE_READONLY (base)
|
||||||
|| !is_global_var (base)
|
|| !is_global_var (base)))
|
||||||
/* But not via builtins.
|
|
||||||
??? We just assume that this is true if we are not a
|
|
||||||
builtin function ourself. */
|
|
||||||
|| (!DECL_BUILT_IN (cfun->decl)
|
|
||||||
&& (fndecl = gimple_call_fndecl (call))
|
|
||||||
&& DECL_BUILT_IN (fndecl))))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Check if base is a global static variable that is not written
|
/* Check if base is a global static variable that is not written
|
||||||
|
|
Loading…
Reference in New Issue