Commit d366a1a7 by Richard Biener Committed by Richard Biener

re PR ipa/65270 (issues with merging memory accesses from different code paths)

2015-03-02  Richard Biener  <rguenther@suse.de>

	PR ipa/65270
	* ipa-icf-gimple.c: Include builtins.h.
	(func_checker::compare_memory_operand): Compare base alignment.

From-SVN: r221117
parent cd1a470a
2015-03-02 Richard Biener <rguenther@suse.de>
PR ipa/65270
* ipa-icf-gimple.c: Include builtins.h.
(func_checker::compare_memory_operand): Compare base alignment.
2015-03-02 Ilya Enkovich <ilya.enkovich@intel.com> 2015-03-02 Ilya Enkovich <ilya.enkovich@intel.com>
PR target/65184 PR target/65184
......
...@@ -77,6 +77,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -77,6 +77,7 @@ along with GCC; see the file COPYING3. If not see
#include <list> #include <list>
#include "tree-ssanames.h" #include "tree-ssanames.h"
#include "tree-eh.h" #include "tree-eh.h"
#include "builtins.h"
#include "ipa-icf-gimple.h" #include "ipa-icf-gimple.h"
#include "ipa-icf.h" #include "ipa-icf.h"
...@@ -286,6 +287,24 @@ func_checker::compare_memory_operand (tree t1, tree t2) ...@@ -286,6 +287,24 @@ func_checker::compare_memory_operand (tree t1, tree t2)
if (ao_ref_alias_set (&r1) != ao_ref_alias_set (&r2) if (ao_ref_alias_set (&r1) != ao_ref_alias_set (&r2)
|| ao_ref_base_alias_set (&r1) != ao_ref_base_alias_set (&r2)) || ao_ref_base_alias_set (&r1) != ao_ref_base_alias_set (&r2))
return return_false_with_msg ("ao alias sets are different"); return return_false_with_msg ("ao alias sets are different");
/* We can't simply use get_object_alignment_1 on the full
reference as for accesses with variable indexes this reports
too conservative alignment. We also can't use the ao_ref_base
base objects as ao_ref_base happily strips MEM_REFs around
decls even though that may carry alignment info. */
b1 = t1;
while (handled_component_p (b1))
b1 = TREE_OPERAND (b1, 0);
b2 = t2;
while (handled_component_p (b2))
b2 = TREE_OPERAND (b2, 0);
unsigned int align1, align2;
unsigned HOST_WIDE_INT tem;
get_object_alignment_1 (b1, &align1, &tem);
get_object_alignment_1 (b2, &align2, &tem);
if (align1 != align2)
return return_false_with_msg ("different access alignment");
} }
return compare_operand (t1, t2); return compare_operand (t1, t2);
......
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