Daily bump.
[gcc.git] / gcc / stor-layout.c
index 8c9e034f6ec0513d72c174dbc217b7a4addcbd08..ee1cf55df90e2948df52f6d90b7e3d6741a4d399 100644 (file)
@@ -393,6 +393,9 @@ int_mode_for_mode (machine_mode mode)
     case MODE_VECTOR_UACCUM:
       return int_mode_for_size (GET_MODE_BITSIZE (mode), 0);
 
+    case MODE_OPAQUE:
+       return opt_scalar_int_mode ();
+
     case MODE_RANDOM:
       if (mode == BLKmode)
        return opt_scalar_int_mode ();
@@ -1341,7 +1344,8 @@ place_field (record_layout_info rli, tree field)
         Bump the cumulative size to multiple of field alignment.  */
 
       if (!targetm.ms_bitfield_layout_p (rli->t)
-          && DECL_SOURCE_LOCATION (field) != BUILTINS_LOCATION)
+         && DECL_SOURCE_LOCATION (field) != BUILTINS_LOCATION
+         && !TYPE_ARTIFICIAL (rli->t))
        warning (OPT_Wpadded, "padding struct to align %q+D", field);
 
       /* If the alignment is still within offset_align, just align
@@ -1775,7 +1779,8 @@ finalize_record_size (record_layout_info rli)
 
   if (TREE_CONSTANT (unpadded_size)
       && simple_cst_equal (unpadded_size, TYPE_SIZE (rli->t)) == 0
-      && input_location != BUILTINS_LOCATION)
+      && input_location != BUILTINS_LOCATION
+      && !TYPE_ARTIFICIAL (rli->t))
     warning (OPT_Wpadded, "padding struct size to alignment boundary");
 
   if (warn_packed && TREE_CODE (rli->t) == RECORD_TYPE
@@ -2577,10 +2582,19 @@ layout_type (tree type)
            /* If TYPE_SIZE_UNIT overflowed, then it is certainly larger than
               TYPE_ALIGN_UNIT.  */
            && !TREE_OVERFLOW (TYPE_SIZE_UNIT (element))
-           && !integer_zerop (TYPE_SIZE_UNIT (element))
-           && compare_tree_int (TYPE_SIZE_UNIT (element),
-                                TYPE_ALIGN_UNIT (element)) < 0)
-         error ("alignment of array elements is greater than element size");
+           && !integer_zerop (TYPE_SIZE_UNIT (element)))
+         {
+           if (compare_tree_int (TYPE_SIZE_UNIT (element),
+                                 TYPE_ALIGN_UNIT (element)) < 0)
+             error ("alignment of array elements is greater than "
+                    "element size");
+           else if (TYPE_ALIGN_UNIT (element) > 1
+                    && (wi::zext (wi::to_wide (TYPE_SIZE_UNIT (element)),
+                                 ffs_hwi (TYPE_ALIGN_UNIT (element)) - 1)
+                        != 0))
+             error ("size of array element is not a multiple of its "
+                    "alignment");
+         }
        break;
       }