Fix internal error with Shift_Right operator on signed type
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 11 Nov 2020 12:53:01 +0000 (13:53 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 11 Nov 2020 12:55:09 +0000 (13:55 +0100)
commit1f8fc1f458c4a66618c35d8e292fff6e9dce9f12
tree540980b5d5baef54b3848408f3ba3ac8b6ede40f
parent4ac93608d7e33a3e10bbd8d50259bc00a7d01237
Fix internal error with Shift_Right operator on signed type

This is a regression present on the mainline and 10 branch in the form
of an ICE with a shift operator applied to a variable of a signed type,
and which is caused by a type mismatch.

gcc/ada/ChangeLog:
* gcc-interface/trans.c (gnat_to_gnu) <N_Op_Shift>: Also convert
GNU_MAX_SHIFT if the type of the operation has been changed.
* gcc-interface/utils.c (can_materialize_object_renaming_p): Add
pair of missing parentheses.

gcc/testsuite/ChangeLog:
* gnat.dg/shift1.adb: New test.
gcc/ada/gcc-interface/trans.c
gcc/ada/gcc-interface/utils.c
gcc/testsuite/gnat.dg/shift1.adb [new file with mode: 0644]