Commit 85998a93 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/52395 (Too conservative alignment info from SRA)

2012-02-28  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/52395
	* tree-sra.c (build_ref_for_offset): Also look at the base
	TYPE_ALIGN when figuring out the alignment of the replacement.

From-SVN: r184620
parent 3a5a825a
2012-02-28 Richard Guenther <rguenther@suse.de> 2012-02-28 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52395
* tree-sra.c (build_ref_for_offset): Also look at the base
TYPE_ALIGN when figuring out the alignment of the replacement.
2012-02-28 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52402 PR tree-optimization/52402
* ipa-prop.c (ipa_modify_call_arguments): Properly use * ipa-prop.c (ipa_modify_call_arguments): Properly use
mis-aligned types when creating the accesses at the call site. mis-aligned types when creating the accesses at the call site.
......
...@@ -1526,10 +1526,12 @@ build_ref_for_offset (location_t loc, tree base, HOST_WIDE_INT offset, ...@@ -1526,10 +1526,12 @@ build_ref_for_offset (location_t loc, tree base, HOST_WIDE_INT offset,
we can extract more optimistic alignment information we can extract more optimistic alignment information
by looking at the access mode. That would constrain the by looking at the access mode. That would constrain the
alignment of base + base_offset which we would need to alignment of base + base_offset which we would need to
adjust according to offset. adjust according to offset. */
??? But it is not at all clear that prev_base is an access
that was in the IL that way, so be conservative for now. */
align = get_pointer_alignment_1 (base, &misalign); align = get_pointer_alignment_1 (base, &misalign);
if (misalign == 0
&& (TREE_CODE (prev_base) == MEM_REF
|| TREE_CODE (prev_base) == TARGET_MEM_REF))
align = MAX (align, TYPE_ALIGN (TREE_TYPE (prev_base)));
misalign += (double_int_sext (tree_to_double_int (off), misalign += (double_int_sext (tree_to_double_int (off),
TYPE_PRECISION (TREE_TYPE (off))).low TYPE_PRECISION (TREE_TYPE (off))).low
* BITS_PER_UNIT); * BITS_PER_UNIT);
......
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