+2011-07-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/49871
+ * dwarf2out.c (size_of_die, value_format, output_die): Use
+ DW_FORM_udata instead of DW_FORM_data[48] for
+ dw_val_class_unsigned_const DW_AT_data_member_location for DWARF 3.
+
2011-07-28 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.md (*tls_global_dynamic_64): Update
size += size_of_sleb128 (AT_int (a));
break;
case dw_val_class_unsigned_const:
- size += constant_size (AT_unsigned (a));
+ {
+ int csize = constant_size (AT_unsigned (a));
+ if (dwarf_version == 3
+ && a->dw_attr == DW_AT_data_member_location
+ && csize >= 4)
+ size += size_of_uleb128 (AT_unsigned (a));
+ else
+ size += csize;
+ }
break;
case dw_val_class_const_double:
size += 2 * HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR;
case 2:
return DW_FORM_data2;
case 4:
+ /* In DWARF3 DW_AT_data_member_location with
+ DW_FORM_data4 or DW_FORM_data8 is a loclistptr, not
+ constant, so we need to use DW_FORM_udata if we need
+ a large constant. */
+ if (dwarf_version == 3 && a->dw_attr == DW_AT_data_member_location)
+ return DW_FORM_udata;
return DW_FORM_data4;
case 8:
+ if (dwarf_version == 3 && a->dw_attr == DW_AT_data_member_location)
+ return DW_FORM_udata;
return DW_FORM_data8;
default:
gcc_unreachable ();
break;
case dw_val_class_unsigned_const:
- dw2_asm_output_data (constant_size (AT_unsigned (a)),
- AT_unsigned (a), "%s", name);
+ {
+ int csize = constant_size (AT_unsigned (a));
+ if (dwarf_version == 3
+ && a->dw_attr == DW_AT_data_member_location
+ && csize >= 4)
+ dw2_asm_output_data_uleb128 (AT_unsigned (a), "%s", name);
+ else
+ dw2_asm_output_data (csize, AT_unsigned (a), "%s", name);
+ }
break;
case dw_val_class_const_double: