[Ada] Add support for compile time evaluation of Shift_Right_Arithmetic

Pierre-Marie de Rodat derodat@adacore.com
Thu Oct 15 09:40:01 GMT 2020


After recent changes to evaluate logical Shift operations at compile
time, do the same for the more complicated case of
Shift_Right_Arithmetic as well as for Shift_Right/Shift_Left for signed
integers.

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

gcc/ada/

	* sem_eval.adb (Eval_Intrinsic_Call, Fold_Shift): Add support
	for Shift_Right_Arithmetic and for signed integers.
	* exp_ch4.adb (Expand_N_Op_Rotate_Left,
	Expand_N_Op_Rotate_Right, Expand_N_Op_Shift_Left,
	Expand_N_Op_Shift_Right_Arithmetic): Minor reformatting and code
	cleanup to ensure a consistent handling. Update comments and add
	assertion.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 10696 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201015/5cdebb81/attachment-0001.bin>


More information about the Gcc-patches mailing list