Commit 6bfd4302 by Richard Biener

re PR tree-optimization/44674 (ICE: in refs_may_alias_p_1, at…

re PR tree-optimization/44674 (ICE: in refs_may_alias_p_1, at tree-ssa-alias.c:953 with -fprofile-generate)

2010-06-26  Richard Guenther  <rguenther@suse.de>

	PR middle-end/44674
	* tree-ssa-alias.c (refs_may_alias_p_1): Allow all kind of
	decls.  Handle LABEL_DECLs like FUNCTION_DECLs.

	* gcc.dg/pr44674.c: New testcase.

From-SVN: r161431
parent 922e1882
2010-06-26 Richard Guenther <rguenther@suse.de>
PR middle-end/44674
* tree-ssa-alias.c (refs_may_alias_p_1): Allow all kind of
decls. Handle LABEL_DECLs like FUNCTION_DECLs.
2010-06-26 Joseph Myers <joseph@codesourcery.com> 2010-06-26 Joseph Myers <joseph@codesourcery.com>
* gcc.c (n_switches_alloc, n_infiles_alloc, alloc_infile, * gcc.c (n_switches_alloc, n_infiles_alloc, alloc_infile,
...@@ -10,8 +16,8 @@ ...@@ -10,8 +16,8 @@
2010-06-26 Jan Hubicka <jh@suse.cz> 2010-06-26 Jan Hubicka <jh@suse.cz>
PR middle-end/44671 PR middle-end/44671
* cgraphunit.c (cgraph_function_versioning): Remove wrong cgraph_make_decl_local * cgraphunit.c (cgraph_function_versioning): Remove wrong
call; fix typo copying RTL data. cgraph_make_decl_local call; fix typo copying RTL data.
2010-06-25 DJ Delorie <dj@redhat.com> 2010-06-25 DJ Delorie <dj@redhat.com>
......
2010-06-26 Richard Guenther <rguenther@suse.de>
PR middle-end/44674
* gcc.dg/pr44674.c: New testcase.
2010-06-26 Joseph Myers <joseph@codesourcery.com> 2010-06-26 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/opts-3.c: New test. * gcc.dg/opts-3.c: New test.
......
/* { dg-do compile } */
/* { dg-options "-O -fprofile-generate" } */
void
jumpfunc (void *p)
{
void *l = &&jumplabel;
jumplabel:
__builtin_memcpy (p, l, 1);
}
...@@ -800,18 +800,16 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p) ...@@ -800,18 +800,16 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
bool var1_p, var2_p, ind1_p, ind2_p; bool var1_p, var2_p, ind1_p, ind2_p;
alias_set_type set; alias_set_type set;
gcc_assert ((!ref1->ref gcc_checking_assert ((!ref1->ref
|| SSA_VAR_P (ref1->ref) || DECL_P (ref1->ref)
|| handled_component_p (ref1->ref) || handled_component_p (ref1->ref)
|| INDIRECT_REF_P (ref1->ref) || INDIRECT_REF_P (ref1->ref)
|| TREE_CODE (ref1->ref) == TARGET_MEM_REF || TREE_CODE (ref1->ref) == TARGET_MEM_REF)
|| TREE_CODE (ref1->ref) == CONST_DECL) && (!ref2->ref
&& (!ref2->ref || DECL_P (ref2->ref)
|| SSA_VAR_P (ref2->ref) || handled_component_p (ref2->ref)
|| handled_component_p (ref2->ref) || INDIRECT_REF_P (ref2->ref)
|| INDIRECT_REF_P (ref2->ref) || TREE_CODE (ref2->ref) == TARGET_MEM_REF));
|| TREE_CODE (ref2->ref) == TARGET_MEM_REF
|| TREE_CODE (ref2->ref) == CONST_DECL));
/* Decompose the references into their base objects and the access. */ /* Decompose the references into their base objects and the access. */
base1 = ao_ref_base (ref1); base1 = ao_ref_base (ref1);
...@@ -832,10 +830,13 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p) ...@@ -832,10 +830,13 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
|| is_gimple_min_invariant (base2)) || is_gimple_min_invariant (base2))
return false; return false;
/* We can end up refering to code via function decls. As we likely /* We can end up refering to code via function and label decls.
do not properly track code aliases conservatively bail out. */ As we likely do not properly track code aliases conservatively
bail out. */
if (TREE_CODE (base1) == FUNCTION_DECL if (TREE_CODE (base1) == FUNCTION_DECL
|| TREE_CODE (base2) == FUNCTION_DECL) || TREE_CODE (base2) == FUNCTION_DECL
|| TREE_CODE (base1) == LABEL_DECL
|| TREE_CODE (base2) == LABEL_DECL)
return true; return true;
/* Defer to simple offset based disambiguation if we have /* Defer to simple offset based disambiguation if we have
......
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