re PR middle-end/43513 (The stack pointer is adjusted twice)
authorTom de Vries <tom@codesourcery.com>
Sun, 31 Jul 2011 10:05:07 +0000 (10:05 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Sun, 31 Jul 2011 10:05:07 +0000 (10:05 +0000)
2011-07-31  Tom de Vries  <tom@codesourcery.com>

PR middle-end/43513
* tree-ssa-loop-ivopts.c (may_be_unaligned_p): Use max of
get_object_alignment and TYPE_ALIGN.

From-SVN: r176969

gcc/ChangeLog
gcc/tree-ssa-loop-ivopts.c

index 99968b32857dcc3d12ea6b824755e9a9ec83de53..5e64d3e21d5268a1ac652cabb9e067c913a36447 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-31  Tom de Vries  <tom@codesourcery.com>
+
+       PR middle-end/43513
+       * tree-ssa-loop-ivopts.c (may_be_unaligned_p): Use max of
+       get_object_alignment and TYPE_ALIGN.
+
 2011-07-30  Tom de Vries  <tom@codesourcery.com>
 
        PR middle-end/43513
index 4d4b67af3f943ee58ff4a269f6efe0ce9e70d660..cc9b2dd8945a8cf4a0a046698a8ee9c075ee0c29 100644 (file)
@@ -1635,7 +1635,8 @@ may_be_unaligned_p (tree ref, tree step)
   base = get_inner_reference (ref, &bitsize, &bitpos, &toffset, &mode,
                              &unsignedp, &volatilep, true);
   base_type = TREE_TYPE (base);
-  base_align = TYPE_ALIGN (base_type);
+  base_align = get_object_alignment (base, BIGGEST_ALIGNMENT);
+  base_align = MAX (base_align, TYPE_ALIGN (base_type));
 
   if (mode != BLKmode)
     {