re PR middle-end/42397 (FAIL: gfortran.dg/lto/20091028-2 f_lto_20091028-2_0.o-f_lto_2...
authorRichard Guenther <rguenther@suse.de>
Thu, 17 Dec 2009 14:36:43 +0000 (14:36 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 17 Dec 2009 14:36:43 +0000 (14:36 +0000)
2009-12-17  Richard Guenther  <rguenther@suse.de>

PR middle-end/42397
* builtins.c (get_object_alignment): Properly deal with
a CONST_DECL base.
* expr.c (emit_block_move_hints): Assert the alignment makes
sense.

From-SVN: r155316

gcc/ChangeLog
gcc/builtins.c
gcc/expr.c

index 47731da822d44589b8a3e7bf9ae668586eff98fc..fe0de91dbcacc939d47d21704879f6b9d25cd5d1 100644 (file)
@@ -1,3 +1,11 @@
+2009-12-17  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/42397
+       * builtins.c (get_object_alignment): Properly deal with
+       a CONST_DECL base.
+       * expr.c (emit_block_move_hints): Assert the alignment makes
+       sense.
+
 2009-12-17  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/32280
index 75a7e10ea6daa535deac523213c496cd3431fa5a..53d74a25b17ede0bc0586644f1c872e78bb04fff 100644 (file)
@@ -323,6 +323,8 @@ get_object_alignment (tree exp, unsigned int align, unsigned int max_align)
          offset = next_offset;
        }
     }
+  if (TREE_CODE (exp) == CONST_DECL)
+    exp = DECL_INITIAL (exp);
   if (DECL_P (exp))
     align = MIN (inner, DECL_ALIGN (exp));
 #ifdef CONSTANT_ALIGNMENT
index 13ae5fffc9f05460547b1c360fa4c62dc57bd1f2..d1cd815dd9bec672b4aead13313866834015d647 100644 (file)
@@ -1194,6 +1194,7 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method,
     }
 
   align = MIN (MEM_ALIGN (x), MEM_ALIGN (y));
+  gcc_assert (align >= BITS_PER_UNIT);
 
   gcc_assert (MEM_P (x));
   gcc_assert (MEM_P (y));