stor-layout.c (place_union_field): Do not put location information on offset expressions.
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 13 Nov 2010 22:38:04 +0000 (22:38 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 13 Nov 2010 22:38:04 +0000 (22:38 +0000)
* stor-layout.c (place_union_field): Do not put location information
on offset expressions.
(place_field): Likewise.
(finalize_record_size): Likewise on size expressions.
(finalize_type_size): Likewise.
(layout_type): Likewise.

From-SVN: r166721

gcc/ChangeLog
gcc/stor-layout.c

index d09a9856b3b4bb2b9c51c0cf04f36d05c0dd2766..f84d1e13119f9c129ef5d55867e6b9b1c57a8e0a 100644 (file)
@@ -1,3 +1,12 @@
+2010-11-13  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * stor-layout.c (place_union_field): Do not put location information
+       on offset expressions.
+       (place_field): Likewise.
+       (finalize_record_size): Likewise on size expressions.
+       (finalize_type_size): Likewise.
+       (layout_type): Likewise.
+
 2010-11-13  Alexandre Oliva  <aoliva@redhat.com>
 
        PR debug/42889
index 9d2b73e13f55ba96514c4a8701d6a0243904d0c9..a1587a925f326bfa4b15599989fdad74362a28b0 100644 (file)
@@ -1067,8 +1067,7 @@ place_union_field (record_layout_info rli, tree field)
   if (TREE_CODE (rli->t) == UNION_TYPE)
     rli->offset = size_binop (MAX_EXPR, rli->offset, DECL_SIZE_UNIT (field));
   else if (TREE_CODE (rli->t) == QUAL_UNION_TYPE)
-    rli->offset = fold_build3_loc (input_location, COND_EXPR, sizetype,
-                              DECL_QUALIFIER (field),
+    rli->offset = fold_build3 (COND_EXPR, sizetype, DECL_QUALIFIER (field),
                               DECL_SIZE_UNIT (field), rli->offset);
 }
 
@@ -1255,7 +1254,7 @@ place_field (record_layout_info rli, tree field)
                   field);
            }
          else
-           rli->bitpos = round_up_loc (input_location, rli->bitpos, type_align);
+           rli->bitpos = round_up (rli->bitpos, type_align);
        }
 
       if (! DECL_PACKED (field))
@@ -1436,7 +1435,7 @@ place_field (record_layout_info rli, tree field)
          if (maximum_field_alignment != 0)
            type_align = MIN (type_align, maximum_field_alignment);
 
-         rli->bitpos = round_up_loc (input_location, rli->bitpos, type_align);
+         rli->bitpos = round_up (rli->bitpos, type_align);
 
           /* If we really aligned, don't allow subsequent bitfields
             to undo that.  */
@@ -1550,10 +1549,9 @@ finalize_record_size (record_layout_info rli)
       = size_binop (PLUS_EXPR, unpadded_size_unit, size_one_node);
 
   /* Round the size up to be a multiple of the required alignment.  */
-  TYPE_SIZE (rli->t) = round_up_loc (input_location, unpadded_size,
-                                TYPE_ALIGN (rli->t));
+  TYPE_SIZE (rli->t) = round_up (unpadded_size, TYPE_ALIGN (rli->t));
   TYPE_SIZE_UNIT (rli->t)
-    = round_up_loc (input_location, unpadded_size_unit, TYPE_ALIGN_UNIT (rli->t));
+    = round_up (unpadded_size_unit, TYPE_ALIGN_UNIT (rli->t));
 
   if (TREE_CONSTANT (unpadded_size)
       && simple_cst_equal (unpadded_size, TYPE_SIZE (rli->t)) == 0
@@ -1573,7 +1571,7 @@ finalize_record_size (record_layout_info rli)
       rli->unpacked_align = MAX (TYPE_ALIGN (rli->t), rli->unpacked_align);
 #endif
 
-      unpacked_size = round_up_loc (input_location, TYPE_SIZE (rli->t), rli->unpacked_align);
+      unpacked_size = round_up (TYPE_SIZE (rli->t), rli->unpacked_align);
       if (simple_cst_equal (unpacked_size, TYPE_SIZE (rli->t)))
        {
          if (TYPE_NAME (rli->t))
@@ -1725,10 +1723,9 @@ finalize_type_size (tree type)
 
   if (TYPE_SIZE (type) != 0)
     {
-      TYPE_SIZE (type) = round_up_loc (input_location,
-                                  TYPE_SIZE (type), TYPE_ALIGN (type));
-      TYPE_SIZE_UNIT (type) = round_up_loc (input_location, TYPE_SIZE_UNIT (type),
-                                       TYPE_ALIGN_UNIT (type));
+      TYPE_SIZE (type) = round_up (TYPE_SIZE (type), TYPE_ALIGN (type));
+      TYPE_SIZE_UNIT (type)
+       = round_up (TYPE_SIZE_UNIT (type), TYPE_ALIGN_UNIT (type));
     }
 
   /* Evaluate nonconstant sizes only once, either now or as soon as safe.  */
@@ -2008,10 +2005,9 @@ layout_type (tree type)
              length
                = size_binop (PLUS_EXPR, size_one_node,
                              fold_convert (sizetype,
-                                           fold_build2_loc (input_location,
-                                                            MINUS_EXPR,
-                                                            TREE_TYPE (lb),
-                                                            ub, lb)));
+                                           fold_build2 (MINUS_EXPR,
+                                                        TREE_TYPE (lb),
+                                                        ub, lb)));
 
            TYPE_SIZE (type) = size_binop (MULT_EXPR, element_size,
                                           fold_convert (bitsizetype,