This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR61320
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 6 Aug 2014 13:36:47 +0200 (CEST)
- Subject: [PATCH] Fix PR61320
- Authentication-results: sourceware.org; auth=none
The following fixes PR61320 - we were not properly treating
explicitely misaligned loads as misaligned.
Tested by various people on their STRICT_ALIGN targets, applied
to trunk and branch.
Richard.
2014-08-06 Richard Biener <rguenther@suse.de>
PR tree-optimization/61320
* tree-ssa-loop-ivopts.c (may_be_unaligned_p): Properly
handle misaligned loads.
Index: gcc/tree-ssa-loop-ivopts.c
===================================================================
--- gcc/tree-ssa-loop-ivopts.c (revision 213658)
+++ gcc/tree-ssa-loop-ivopts.c (working copy)
@@ -1703,6 +1703,8 @@ may_be_unaligned_p (tree ref, tree step)
return false;
unsigned int align = TYPE_ALIGN (TREE_TYPE (ref));
+ if (GET_MODE_ALIGNMENT (TYPE_MODE (TREE_TYPE (ref))) > align)
+ align = GET_MODE_ALIGNMENT (TYPE_MODE (TREE_TYPE (ref)));
unsigned HOST_WIDE_INT bitpos;
unsigned int ref_align;