Commit 4c0ce3c9 by Eric Botcazou

dwarf2out.c (enum dw_val_class): Replace dw_val_class_long_long with dw_val_class_const_double.

	* dwarf2out.c (enum dw_val_class): Replace dw_val_class_long_long
	with dw_val_class_const_double.
	(struct dw_val_struct): Replace val_long_long with val_double and
	adjust for above change.
	(output_loc_operands): Likewise.
	(add_AT_long_long): Rename into...
	(add_AT_double): ...this.
	(print_die): Replace dw_val_class_long_long with
	dw_val_class_const_double and adjust.
	(attr_checksum): Likewise.
	(same_dw_val_p): Likewise.
	(size_of_die): Likewise.
	(value_format): Likewise.
	(output_die): Likewise.
	(loc_descriptor) <CONST_DOUBLE>: Likewise.
	(add_const_value_attribute) <CONST_DOUBLE>: Call add_AT_double
	instead of add_AT_long_long.
	(add_bound_info) <INTEGER_CST>: Generate the bound as an unsigned
	value with the precision of its type.

From-SVN: r152222
parent afbd0665
2009-09-26 Andreas Schwab <schwab@linux-m68k.org> 2009-09-27 Eric Botcazou <ebotcazou@adacore.com>
PR c/41476 * dwarf2out.c (enum dw_val_class): Replace dw_val_class_long_long
with dw_val_class_const_double.
(struct dw_val_struct): Replace val_long_long with val_double and
adjust for above change.
(output_loc_operands): Likewise.
(add_AT_long_long): Rename into...
(add_AT_double): ...this.
(print_die): Replace dw_val_class_long_long with
dw_val_class_const_double and adjust.
(attr_checksum): Likewise.
(same_dw_val_p): Likewise.
(size_of_die): Likewise.
(value_format): Likewise.
(output_die): Likewise.
(loc_descriptor) <CONST_DOUBLE>: Likewise.
(add_const_value_attribute) <CONST_DOUBLE>: Call add_AT_double
instead of add_AT_long_long.
(add_bound_info) <INTEGER_CST>: Generate the bound as an unsigned
value with the precision of its type.
2009-09-27 Andreas Schwab <schwab@linux-m68k.org>
PR c/41476
* c-typeck.c (build_conditional_expr): Use the readonly and * c-typeck.c (build_conditional_expr): Use the readonly and
volatile flags of the operand types, not of the operands itself. volatile flags of the operand types, not of the operands itself.
2009-09-25 Peter O'Gorman <pogma@thewrittenword.com> 2009-09-27 Peter O'Gorman <pogma@thewrittenword.com>
collect2.c (main): Look for -brtl before adding libraries. collect2.c (main): Look for -brtl before adding libraries.
2009-09-19 Jonathan Gray <jsg@openbsd.org> 2009-09-27 Jonathan Gray <jsg@openbsd.org>
* config.gcc: Update OpenBSD targets. * config.gcc: Update OpenBSD targets.
* config/openbsd-stdint.h: New file. * config/openbsd-stdint.h: New file.
......
...@@ -4158,7 +4158,7 @@ enum dw_val_class ...@@ -4158,7 +4158,7 @@ enum dw_val_class
dw_val_class_range_list, dw_val_class_range_list,
dw_val_class_const, dw_val_class_const,
dw_val_class_unsigned_const, dw_val_class_unsigned_const,
dw_val_class_long_long, dw_val_class_const_double,
dw_val_class_vec, dw_val_class_vec,
dw_val_class_flag, dw_val_class_flag,
dw_val_class_die_ref, dw_val_class_die_ref,
...@@ -4192,7 +4192,7 @@ typedef struct GTY(()) dw_val_struct { ...@@ -4192,7 +4192,7 @@ typedef struct GTY(()) dw_val_struct {
dw_loc_descr_ref GTY ((tag ("dw_val_class_loc"))) val_loc; dw_loc_descr_ref GTY ((tag ("dw_val_class_loc"))) val_loc;
HOST_WIDE_INT GTY ((default)) val_int; HOST_WIDE_INT GTY ((default)) val_int;
unsigned HOST_WIDE_INT GTY ((tag ("dw_val_class_unsigned_const"))) val_unsigned; unsigned HOST_WIDE_INT GTY ((tag ("dw_val_class_unsigned_const"))) val_unsigned;
rtx GTY ((tag ("dw_val_class_long_long"))) val_long_long; double_int GTY ((tag ("dw_val_class_const_double"))) val_double;
dw_vec_const GTY ((tag ("dw_val_class_vec"))) val_vec; dw_vec_const GTY ((tag ("dw_val_class_vec"))) val_vec;
struct dw_val_die_union struct dw_val_die_union
{ {
...@@ -4877,22 +4877,22 @@ output_loc_operands (dw_loc_descr_ref loc) ...@@ -4877,22 +4877,22 @@ output_loc_operands (dw_loc_descr_ref loc)
"fp or vector constant word %u", i); "fp or vector constant word %u", i);
} }
break; break;
case dw_val_class_long_long: case dw_val_class_const_double:
{ {
unsigned HOST_WIDE_INT first, second; unsigned HOST_WIDE_INT first, second;
if (WORDS_BIG_ENDIAN) if (WORDS_BIG_ENDIAN)
{ {
first = CONST_DOUBLE_HIGH (val2->v.val_long_long); first = val2->v.val_double.high;
second = CONST_DOUBLE_LOW (val2->v.val_long_long); second = val2->v.val_double.low;
} }
else else
{ {
first = CONST_DOUBLE_LOW (val2->v.val_long_long); first = val2->v.val_double.low;
second = CONST_DOUBLE_HIGH (val2->v.val_long_long); second = val2->v.val_double.high;
} }
dw2_asm_output_data (HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR, dw2_asm_output_data (HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR,
first, "long long constant"); first, NULL);
dw2_asm_output_data (HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR, dw2_asm_output_data (HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR,
second, NULL); second, NULL);
} }
...@@ -5818,7 +5818,8 @@ static void add_AT_int (dw_die_ref, enum dwarf_attribute, HOST_WIDE_INT); ...@@ -5818,7 +5818,8 @@ static void add_AT_int (dw_die_ref, enum dwarf_attribute, HOST_WIDE_INT);
static inline HOST_WIDE_INT AT_int (dw_attr_ref); static inline HOST_WIDE_INT AT_int (dw_attr_ref);
static void add_AT_unsigned (dw_die_ref, enum dwarf_attribute, unsigned HOST_WIDE_INT); static void add_AT_unsigned (dw_die_ref, enum dwarf_attribute, unsigned HOST_WIDE_INT);
static inline unsigned HOST_WIDE_INT AT_unsigned (dw_attr_ref); static inline unsigned HOST_WIDE_INT AT_unsigned (dw_attr_ref);
static void add_AT_long_long (dw_die_ref, enum dwarf_attribute, rtx); static void add_AT_double (dw_die_ref, enum dwarf_attribute,
HOST_WIDE_INT, unsigned HOST_WIDE_INT);
static inline void add_AT_vec (dw_die_ref, enum dwarf_attribute, unsigned int, static inline void add_AT_vec (dw_die_ref, enum dwarf_attribute, unsigned int,
unsigned int, unsigned char *); unsigned int, unsigned char *);
static hashval_t debug_str_do_hash (const void *); static hashval_t debug_str_do_hash (const void *);
...@@ -6754,14 +6755,15 @@ AT_unsigned (dw_attr_ref a) ...@@ -6754,14 +6755,15 @@ AT_unsigned (dw_attr_ref a)
/* Add an unsigned double integer attribute value to a DIE. */ /* Add an unsigned double integer attribute value to a DIE. */
static inline void static inline void
add_AT_long_long (dw_die_ref die, enum dwarf_attribute attr_kind, add_AT_double (dw_die_ref die, enum dwarf_attribute attr_kind,
rtx val_const_double) HOST_WIDE_INT high, unsigned HOST_WIDE_INT low)
{ {
dw_attr_node attr; dw_attr_node attr;
attr.dw_attr = attr_kind; attr.dw_attr = attr_kind;
attr.dw_attr_val.val_class = dw_val_class_long_long; attr.dw_attr_val.val_class = dw_val_class_const_double;
attr.dw_attr_val.v.val_long_long = val_const_double; attr.dw_attr_val.v.val_double.high = high;
attr.dw_attr_val.v.val_double.low = low;
add_dwarf_attr (die, &attr); add_dwarf_attr (die, &attr);
} }
...@@ -7622,11 +7624,11 @@ print_die (dw_die_ref die, FILE *outfile) ...@@ -7622,11 +7624,11 @@ print_die (dw_die_ref die, FILE *outfile)
case dw_val_class_unsigned_const: case dw_val_class_unsigned_const:
fprintf (outfile, HOST_WIDE_INT_PRINT_UNSIGNED, AT_unsigned (a)); fprintf (outfile, HOST_WIDE_INT_PRINT_UNSIGNED, AT_unsigned (a));
break; break;
case dw_val_class_long_long: case dw_val_class_const_double:
fprintf (outfile, "constant (" HOST_WIDE_INT_PRINT_UNSIGNED fprintf (outfile, "constant ("HOST_WIDE_INT_PRINT_DEC","\
"," HOST_WIDE_INT_PRINT_UNSIGNED ")", HOST_WIDE_INT_PRINT_UNSIGNED")",
CONST_DOUBLE_HIGH (a->dw_attr_val.v.val_long_long), a->dw_attr_val.v.val_double.high,
CONST_DOUBLE_LOW (a->dw_attr_val.v.val_long_long)); a->dw_attr_val.v.val_double.low);
break; break;
case dw_val_class_vec: case dw_val_class_vec:
fprintf (outfile, "floating-point or vector constant"); fprintf (outfile, "floating-point or vector constant");
...@@ -7782,9 +7784,8 @@ attr_checksum (dw_attr_ref at, struct md5_ctx *ctx, int *mark) ...@@ -7782,9 +7784,8 @@ attr_checksum (dw_attr_ref at, struct md5_ctx *ctx, int *mark)
case dw_val_class_unsigned_const: case dw_val_class_unsigned_const:
CHECKSUM (at->dw_attr_val.v.val_unsigned); CHECKSUM (at->dw_attr_val.v.val_unsigned);
break; break;
case dw_val_class_long_long: case dw_val_class_const_double:
CHECKSUM (CONST_DOUBLE_HIGH (at->dw_attr_val.v.val_long_long)); CHECKSUM (at->dw_attr_val.v.val_double);
CHECKSUM (CONST_DOUBLE_LOW (at->dw_attr_val.v.val_long_long));
break; break;
case dw_val_class_vec: case dw_val_class_vec:
CHECKSUM (at->dw_attr_val.v.val_vec); CHECKSUM (at->dw_attr_val.v.val_vec);
...@@ -7883,11 +7884,9 @@ same_dw_val_p (const dw_val_node *v1, const dw_val_node *v2, int *mark) ...@@ -7883,11 +7884,9 @@ same_dw_val_p (const dw_val_node *v1, const dw_val_node *v2, int *mark)
return v1->v.val_int == v2->v.val_int; return v1->v.val_int == v2->v.val_int;
case dw_val_class_unsigned_const: case dw_val_class_unsigned_const:
return v1->v.val_unsigned == v2->v.val_unsigned; return v1->v.val_unsigned == v2->v.val_unsigned;
case dw_val_class_long_long: case dw_val_class_const_double:
return CONST_DOUBLE_HIGH (v1->v.val_long_long) return v1->v.val_double.high == v2->v.val_double.high
== CONST_DOUBLE_HIGH (v2->v.val_long_long) && v1->v.val_double.low == v2->v.val_double.low;
&& CONST_DOUBLE_LOW (v1->v.val_long_long)
== CONST_DOUBLE_LOW (v2->v.val_long_long);
case dw_val_class_vec: case dw_val_class_vec:
if (v1->v.val_vec.length != v2->v.val_vec.length if (v1->v.val_vec.length != v2->v.val_vec.length
|| v1->v.val_vec.elt_size != v2->v.val_vec.elt_size) || v1->v.val_vec.elt_size != v2->v.val_vec.elt_size)
...@@ -8495,8 +8494,10 @@ size_of_die (dw_die_ref die) ...@@ -8495,8 +8494,10 @@ size_of_die (dw_die_ref die)
case dw_val_class_unsigned_const: case dw_val_class_unsigned_const:
size += constant_size (AT_unsigned (a)); size += constant_size (AT_unsigned (a));
break; break;
case dw_val_class_long_long: case dw_val_class_const_double:
size += 1 + 2*HOST_BITS_PER_WIDE_INT/HOST_BITS_PER_CHAR; /* block */ size += 2 * HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR;
if (HOST_BITS_PER_WIDE_INT >= 64)
size++; /* block */
break; break;
case dw_val_class_vec: case dw_val_class_vec:
size += constant_size (a->dw_attr_val.v.val_vec.length size += constant_size (a->dw_attr_val.v.val_vec.length
...@@ -8700,8 +8701,19 @@ value_format (dw_attr_ref a) ...@@ -8700,8 +8701,19 @@ value_format (dw_attr_ref a)
default: default:
gcc_unreachable (); gcc_unreachable ();
} }
case dw_val_class_long_long: case dw_val_class_const_double:
return DW_FORM_block1; switch (HOST_BITS_PER_WIDE_INT)
{
case 8:
return DW_FORM_data2;
case 16:
return DW_FORM_data4;
case 32:
return DW_FORM_data8;
case 64:
default:
return DW_FORM_block1;
}
case dw_val_class_vec: case dw_val_class_vec:
switch (constant_size (a->dw_attr_val.v.val_vec.length switch (constant_size (a->dw_attr_val.v.val_vec.length
* a->dw_attr_val.v.val_vec.elt_size)) * a->dw_attr_val.v.val_vec.elt_size))
...@@ -8973,28 +8985,29 @@ output_die (dw_die_ref die) ...@@ -8973,28 +8985,29 @@ output_die (dw_die_ref die)
AT_unsigned (a), "%s", name); AT_unsigned (a), "%s", name);
break; break;
case dw_val_class_long_long: case dw_val_class_const_double:
{ {
unsigned HOST_WIDE_INT first, second; unsigned HOST_WIDE_INT first, second;
dw2_asm_output_data (1, if (HOST_BITS_PER_WIDE_INT >= 64)
2 * HOST_BITS_PER_WIDE_INT dw2_asm_output_data (1,
/ HOST_BITS_PER_CHAR, 2 * HOST_BITS_PER_WIDE_INT
"%s", name); / HOST_BITS_PER_CHAR,
NULL);
if (WORDS_BIG_ENDIAN) if (WORDS_BIG_ENDIAN)
{ {
first = CONST_DOUBLE_HIGH (a->dw_attr_val.v.val_long_long); first = a->dw_attr_val.v.val_double.high;
second = CONST_DOUBLE_LOW (a->dw_attr_val.v.val_long_long); second = a->dw_attr_val.v.val_double.low;
} }
else else
{ {
first = CONST_DOUBLE_LOW (a->dw_attr_val.v.val_long_long); first = a->dw_attr_val.v.val_double.low;
second = CONST_DOUBLE_HIGH (a->dw_attr_val.v.val_long_long); second = a->dw_attr_val.v.val_double.high;
} }
dw2_asm_output_data (HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR, dw2_asm_output_data (HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR,
first, "long long constant"); first, name);
dw2_asm_output_data (HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR, dw2_asm_output_data (HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR,
second, NULL); second, NULL);
} }
...@@ -11880,8 +11893,11 @@ loc_descriptor (rtx rtl, enum machine_mode mode, ...@@ -11880,8 +11893,11 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
} }
else else
{ {
loc_result->dw_loc_oprnd2.val_class = dw_val_class_long_long; loc_result->dw_loc_oprnd2.val_class = dw_val_class_const_double;
loc_result->dw_loc_oprnd2.v.val_long_long = rtl; loc_result->dw_loc_oprnd2.v.val_double.high
= CONST_DOUBLE_HIGH (rtl);
loc_result->dw_loc_oprnd2.v.val_double.low
= CONST_DOUBLE_LOW (rtl);
} }
} }
break; break;
...@@ -13354,7 +13370,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl) ...@@ -13354,7 +13370,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl)
/* Note that a CONST_DOUBLE rtx could represent either an integer or a /* Note that a CONST_DOUBLE rtx could represent either an integer or a
floating-point constant. A CONST_DOUBLE is used whenever the floating-point constant. A CONST_DOUBLE is used whenever the
constant requires more than one word in order to be adequately constant requires more than one word in order to be adequately
represented. We output CONST_DOUBLEs as blocks. */ represented. */
{ {
enum machine_mode mode = GET_MODE (rtl); enum machine_mode mode = GET_MODE (rtl);
...@@ -13367,7 +13383,8 @@ add_const_value_attribute (dw_die_ref die, rtx rtl) ...@@ -13367,7 +13383,8 @@ add_const_value_attribute (dw_die_ref die, rtx rtl)
add_AT_vec (die, DW_AT_const_value, length / 4, 4, array); add_AT_vec (die, DW_AT_const_value, length / 4, 4, array);
} }
else else
add_AT_long_long (die, DW_AT_const_value, rtl); add_AT_double (die, DW_AT_const_value,
CONST_DOUBLE_HIGH (rtl), CONST_DOUBLE_LOW (rtl));
} }
return true; return true;
...@@ -14313,14 +14330,33 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b ...@@ -14313,14 +14330,33 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b
/* All fixed-bounds are represented by INTEGER_CST nodes. */ /* All fixed-bounds are represented by INTEGER_CST nodes. */
case INTEGER_CST: case INTEGER_CST:
if (! host_integerp (bound, 0) {
|| (bound_attr == DW_AT_lower_bound unsigned int prec = simple_type_size_in_bits (TREE_TYPE (bound));
&& (((is_c_family () || is_java ()) && integer_zerop (bound))
|| (is_fortran () && integer_onep (bound))))) /* Use the default if possible. */
/* Use the default. */ if (bound_attr == DW_AT_lower_bound
; && (((is_c_family () || is_java ()) && integer_zerop (bound))
else || (is_fortran () && integer_onep (bound))))
add_AT_unsigned (subrange_die, bound_attr, tree_low_cst (bound, 0)); ;
/* Otherwise represent the bound as an unsigned value with the
precision of its type. The precision and signedness of the
type will be necessary to re-interpret it unambiguously. */
else if (prec < HOST_BITS_PER_WIDE_INT)
{
unsigned HOST_WIDE_INT mask
= ((unsigned HOST_WIDE_INT) 1 << prec) - 1;
add_AT_unsigned (subrange_die, bound_attr,
TREE_INT_CST_LOW (bound) & mask);
}
else if (prec == HOST_BITS_PER_WIDE_INT
|| TREE_INT_CST_HIGH (bound) == 0)
add_AT_unsigned (subrange_die, bound_attr,
TREE_INT_CST_LOW (bound));
else
add_AT_double (subrange_die, bound_attr, TREE_INT_CST_HIGH (bound),
TREE_INT_CST_LOW (bound));
}
break; break;
CASE_CONVERT: CASE_CONVERT:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment