dwarf2out.c (DWARF_LARGEST_DATA_FORM_BITS): Define.
authorJakub Jelinek <jakub@redhat.com>
Mon, 31 Oct 2016 17:22:30 +0000 (18:22 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 31 Oct 2016 17:22:30 +0000 (18:22 +0100)
* dwarf2out.c (DWARF_LARGEST_DATA_FORM_BITS): Define.
(size_of_die, value_format, output_die): Use
DW_FORM_data16 for 128-bit dw_val_class_const_double or
dw_val_class_wide_int.

From-SVN: r241714

gcc/ChangeLog
gcc/dwarf2out.c

index b6c04b1419a1b7b2335fa7d5582bf2e403841b2a..6ac3d5b8d7505d86cb55d58fdbb2c28b26c02c2b 100644 (file)
@@ -1,5 +1,10 @@
 2016-10-31  Jakub Jelinek  <jakub@redhat.com>
 
+       * dwarf2out.c (DWARF_LARGEST_DATA_FORM_BITS): Define.
+       (size_of_die, value_format, output_die): Use
+       DW_FORM_data16 for 128-bit dw_val_class_const_double or
+       dw_val_class_wide_int.
+
        * dwarf2out.c (dwarf_op): Renamed to ...
        (dwarf_OP): ... this.
        (convert_descriptor_to_mode, scompare_loc_descriptor,
index 8c646a0c2db9eee09f701bb14ab48a57ecfdd00c..533a6575d3519f811e03c413d4827c2c1b70fa8b 100644 (file)
@@ -1517,6 +1517,12 @@ loc_list_plus_const (dw_loc_list_ref list_head, HOST_WIDE_INT offset)
 #define DWARF_REF_SIZE \
   (dwarf_version == 2 ? DWARF2_ADDR_SIZE : DWARF_OFFSET_SIZE)
 
+/* The number of bits that can be encoded by largest DW_FORM_dataN.
+   In DWARF4 and earlier it is DW_FORM_data8 with 64 bits, in DWARF5
+   DW_FORM_data16 with 128 bits.  */
+#define DWARF_LARGEST_DATA_FORM_BITS \
+  (dwarf_version >= 5 ? 128 : 64)
+
 /* Utility inline function for construction of ops that were GNU extension
    before DWARF 5.  */
 static inline enum dwarf_location_atom
@@ -8755,14 +8761,14 @@ size_of_die (dw_die_ref die)
          break;
        case dw_val_class_const_double:
          size += HOST_BITS_PER_DOUBLE_INT / HOST_BITS_PER_CHAR;
-         if (HOST_BITS_PER_WIDE_INT >= 64)
+         if (HOST_BITS_PER_WIDE_INT >= DWARF_LARGEST_DATA_FORM_BITS)
            size++; /* block */
          break;
        case dw_val_class_wide_int:
          size += (get_full_len (*a->dw_attr_val.v.val_wide)
                   * HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR);
-         if (get_full_len (*a->dw_attr_val.v.val_wide) * HOST_BITS_PER_WIDE_INT
-             > 64)
+         if (get_full_len (*a->dw_attr_val.v.val_wide)
+             * HOST_BITS_PER_WIDE_INT > DWARF_LARGEST_DATA_FORM_BITS)
            size++; /* block */
          break;
        case dw_val_class_vec:
@@ -9147,6 +9153,9 @@ value_format (dw_attr_node *a)
        case 32:
          return DW_FORM_data8;
        case 64:
+         if (dwarf_version >= 5)
+           return DW_FORM_data16;
+         /* FALLTHRU */
        default:
          return DW_FORM_block1;
        }
@@ -9161,6 +9170,10 @@ value_format (dw_attr_node *a)
          return DW_FORM_data4;
        case 64:
          return DW_FORM_data8;
+       case 128:
+         if (dwarf_version >= 5)
+           return DW_FORM_data16;
+         /* FALLTHRU */
        default:
          return DW_FORM_block1;
        }
@@ -9634,7 +9647,7 @@ output_die (dw_die_ref die)
          {
            unsigned HOST_WIDE_INT first, second;
 
-           if (HOST_BITS_PER_WIDE_INT >= 64)
+           if (HOST_BITS_PER_WIDE_INT >= DWARF_LARGEST_DATA_FORM_BITS)
              dw2_asm_output_data (1,
                                   HOST_BITS_PER_DOUBLE_INT
                                   / HOST_BITS_PER_CHAR,
@@ -9663,9 +9676,9 @@ output_die (dw_die_ref die)
            int i;
            int len = get_full_len (*a->dw_attr_val.v.val_wide);
            int l = HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR;
-           if (len * HOST_BITS_PER_WIDE_INT > 64)
-             dw2_asm_output_data (1, get_full_len (*a->dw_attr_val.v.val_wide) * l,
-                                  NULL);
+           if (len * HOST_BITS_PER_WIDE_INT > DWARF_LARGEST_DATA_FORM_BITS)
+             dw2_asm_output_data (1, get_full_len (*a->dw_attr_val.v.val_wide)
+                                     * l, NULL);
 
            if (WORDS_BIG_ENDIAN)
              for (i = len - 1; i >= 0; --i)