diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2021-05-28 19:31:18 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2021-06-03 12:41:20 +0200 |
commit | df741be17ee09974ad46750ebbbacf55f8e108a8 (patch) | |
tree | 518f4b3aa4f5e605a38770cb75ad70f0b7cae70b /gcc/ada/gcc-interface/decl.c | |
parent | e26b748a62e5bc59f6671faab75f737503c87319 (diff) | |
download | gcc-df741be17ee09974ad46750ebbbacf55f8e108a8.zip gcc-df741be17ee09974ad46750ebbbacf55f8e108a8.tar.gz gcc-df741be17ee09974ad46750ebbbacf55f8e108a8.tar.bz2 |
Fix signedness issue in DWARF functions (2)
The compiler can synthesize DWARF functions to describe the location and
size of components in discriminated record types with variant part in Ada,
but in peculiar cases the compiler drops expressions on the floor, for
example in the divide case:
case ROUND_DIV_EXPR:
case TRUNC_DIV_EXPR:
case EXACT_DIV_EXPR:
if (TYPE_UNSIGNED (TREE_TYPE (loc)))
return 0;
op = DW_OP_div;
goto do_binop;
Now sizetype and bitsizetype are unsigned types, which means that any divide
expression in them is dropped.
gcc/
* dwarf2out.c (mem_loc_descriptor) <UDIV>: Fix typo.
(typed_binop_from_tree): New function.
(loc_list_from_tree_1) <EXACT_DIV_EXPR>: For an unsigned type,
turn a divide by a power of 2 into a shift.
<CEIL_DIV_EXPR>: For an unsigned type, use a signed divide if the
size of the mode is lower than DWARF2_ADDR_SIZE; otherwise, do a
typed divide by calling typed_binop_from_tree.
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
0 files changed, 0 insertions, 0 deletions