[PATCH] Fix PR45379

Richard Guenther rguenther@suse.de
Wed Aug 25 10:55:00 GMT 2010


This fixes PR45379 - I missed to set alignment from TARGET_MEM_REF
in set_mem_attributes_minus_bitpos.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2010-08-25  Richard Guenther  <rguenther@suse.de>

	PR middle-end/45379
	* emit-rtl.c (set_mem_attributes_minus_bitpos): Handle
	TARGET_MEM_REF in alignment computation.

Index: gcc/emit-rtl.c
===================================================================
--- gcc/emit-rtl.c	(revision 163519)
+++ gcc/emit-rtl.c	(working copy)
@@ -1615,6 +1615,11 @@ set_mem_attributes_minus_bitpos (rtx ref
 	align = MAX (align, TYPE_ALIGN (type));
     }
 
+  else if (TREE_CODE (t) == TARGET_MEM_REF)
+    /* ??? This isn't fully correct, we can't set the alignment from the
+       type in all cases.  */
+    align = MAX (align, TYPE_ALIGN (type));
+
   else if (TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
     {
       if (integer_zerop (TREE_OPERAND (t, 1)))



More information about the Gcc-patches mailing list