This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR61320


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]