diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2020-07-10 19:06:46 +0100 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-17 13:17:18 -0300 |
commit | fa996702bb7cc98f15034bf6b60919db944e96b1 (patch) | |
tree | e5ab11767cd98dd0d0332ecb3c3aa32aa0537292 /gcc/fortran/interface.c | |
parent | 2038366ff0fb28602660dad61701899268df70ed (diff) | |
download | gcc-fa996702bb7cc98f15034bf6b60919db944e96b1.zip gcc-fa996702bb7cc98f15034bf6b60919db944e96b1.tar.gz gcc-fa996702bb7cc98f15034bf6b60919db944e96b1.tar.bz2 |
expr: Move reduce_bit_field target mode check [PR96151]
In some cases, expand_expr_real_2 prefers to use the mode of the
caller-suggested target instead of the mode of the expression when
passing values to reduce_to_bit_field_precision. E.g.:
else if (target == 0)
op0 = convert_to_mode (mode, op0,
TYPE_UNSIGNED (TREE_TYPE
(treeop0)));
else
{
convert_move (target, op0,
TYPE_UNSIGNED (TREE_TYPE (treeop0)));
op0 = target;
}
where “op0” might not have “mode” for the “else” branch,
but does for all the others.
reduce_to_bit_field_precision discards the suggested target if it
has the wrong mode. This patch moves that to expand_expr_real_2
instead (conditional on reduce_bit_field).
gcc/
PR middle-end/96151
* expr.c (expand_expr_real_2): When reducing bit fields,
clear the target if it has a different mode from the expression.
(reduce_to_bit_field_precision): Don't do that here. Instead
assert that the target already has the correct mode.
Diffstat (limited to 'gcc/fortran/interface.c')
0 files changed, 0 insertions, 0 deletions