[Ada] Wrong compile time evaluation of Shift_Right

Pierre-Marie de Rodat derodat@adacore.com
Fri Nov 27 09:18:01 GMT 2020


When using the Shift_Right operator on negative values (e.g. -1 on a
signed type), the wrong value is incorrectly folded after recent changes
in sem_eval.adb to add compile time evaluation of the shift operators.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sem_eval.adb (Fold_Shift): Fix evaluation of Shift_Right on
	negative values.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1930 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201127/20b2bd43/attachment.bin>


More information about the Gcc-patches mailing list