tree-sra.c (create_access_replacement): Drop under-/over-alignment of types.
authorRichard Biener <rguenther@suse.de>
Tue, 31 Mar 2015 13:32:59 +0000 (13:32 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 31 Mar 2015 13:32:59 +0000 (13:32 +0000)
2015-03-31  Richard Biener  <rguenther@suse.de>

* tree-sra.c (create_access_replacement): Drop under-/over-alignment
of types.

From-SVN: r221795

gcc/ChangeLog
gcc/tree-sra.c

index 72389ee4e7a82f9ec5b6dfe5f21cb9c3632fb8fb..e37abf98162c6a606aeab1adcd320f2170f43e1d 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-31  Richard Biener  <rguenther@suse.de>
+
+       * tree-sra.c (create_access_replacement): Drop under-/over-alignment
+       of types.
+
 2015-03-31  Dominik Vogt  <vogt@linux.vnet.ibm.com>
 
        * config/s390/s390.c (s390_function_num_hotpatch_hw): Allow hotpatching
index 91b72fbdc890b4d346fb084557386e5abd3f0e81..6adee70bce5c04b95f839b4aaea8ecdc32052b94 100644 (file)
@@ -2012,7 +2012,11 @@ create_access_replacement (struct access *access)
       DECL_CONTEXT (repl) = current_function_decl;
     }
   else
-    repl = create_tmp_var (access->type, "SR");
+    /* Drop any special alignment on the type if it's not on the main
+       variant.  This avoids issues with weirdo ABIs like AAPCS.  */
+    repl = create_tmp_var (build_qualified_type
+                            (TYPE_MAIN_VARIANT (access->type),
+                             TYPE_QUALS (access->type)), "SR");
   if (TREE_CODE (access->type) == COMPLEX_TYPE
       || TREE_CODE (access->type) == VECTOR_TYPE)
     {