diff mbox

Fix PR50494 in a different way

Message ID alpine.LNX.2.00.1303051652250.3543@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener March 5, 2013, 3:53 p.m. UTC
This fixes PR50494 by avoiding to increase alignment of decls
that are in the constant pool by the vectorizer.

Bootstrap & regtest pending on powerpc64-linux-gnu, with
the older fix reverted.

Richard.

2013-03-05  Richard Biener  <rguenther@suse.de>

	PR middle-end/50494
	* tree-vect-data-refs.c (vect_can_force_dr_alignment_p):
	Do not adjust alignment of DECL_IN_CONSTANT_POOL decls.
diff mbox

Patch

Index: gcc/tree-vect-data-refs.c
===================================================================
--- gcc/tree-vect-data-refs.c	(revision 196466)
+++ gcc/tree-vect-data-refs.c	(working copy)
@@ -4829,9 +4829,12 @@  vect_can_force_dr_alignment_p (const_tre
   /* We cannot change alignment of common or external symbols as another
      translation unit may contain a definition with lower alignment.  
      The rules of common symbol linking mean that the definition
-     will override the common symbol.  */
+     will override the common symbol.  The same is true for constant
+     pool entries which may be shared and are not properly merged
+     by LTO.  */
   if (DECL_EXTERNAL (decl)
-      || DECL_COMMON (decl))
+      || DECL_COMMON (decl)
+      || DECL_IN_CONSTANT_POOL (decl))
     return false;
 
   if (TREE_ASM_WRITTEN (decl))