[Ada] Crash on right shift operator for signed integers

Pierre-Marie de Rodat derodat@adacore.com
Wed Nov 25 13:27:24 GMT 2020


This patch fixes an error in the compiler whereby right shift operators
on signed integers cause a compile-time crash when said shift operators
are provided via pragma Provide_Shift_Operators.

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

gcc/ada/

	* doc/gnat_rm/intrinsic_subprograms.rst (Shifts and Rotates):
	Document behavior on negative numbers
	* gnat_rm.texi: Regenerate.
	* sem_eval.adb (Fold_Shift): Set modulus to be based on the RM
	size for non-modular integer types.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 2639 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201125/14a3d8bd/attachment-0001.bin>


More information about the Gcc-patches mailing list