[Ada] Remove degenerate Treat_Fixed_As_Integer mechanism

Pierre-Marie de Rodat derodat@adacore.com
Tue Jun 2 08:59:39 GMT 2020


The Treat_Fixed_As_Integer mechanism has been degenerate for quite
some time and the flag is only set on divide nodes at this point.

We can use the same trick as in the multiply case to get rid of it
altogether, with the positive by-product that the compiler will stop
doing divisions of small fixed-point types in Universal_Integer type.

No functional changes.

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

2020-06-02  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_ch4.adb (Expand_N_Op_Divide): Remove code dealing with
	the Treat_Fixed_As_Integer flag.
	(Expand_N_Op_Multiply): Likewise.
	* exp_fixd.adb (Build_Divide): Do the division in an integer
	type long enough to hold both operands and convert the result
	to the type of the LHS.  Do not set Treat_Fixed_As_Integer.
	(Build_Multiply): Do not set Treat_Fixed_As_Integer.
	(Build_Rem): Likewise.
	* sem_ch4.adb (Analyze_Arithmetic_Op): Remove code dealing with
	the Treat_Fixed_As_Integer flag.
	(Check_Arithmetic_Pair): Likewise.
	* sinfo.ads (Treat_Fixed_As_Integer): Delete.
	(N_Has_Treat_Fixed_As_Integer): Likewise.
	(Set_Treat_Fixed_As_Integer): Likewise.
	* sinfo.adb (Treat_Fixed_As_Integer): Likewise.
	(Set_Treat_Fixed_As_Integer): Likewise.
	* sprint.ads (Syntax Extensions): Remove '#' special character.
	* sprint.adb (Process_TFAI_RR_Flags): Delete.
	(Sprint_Node_Actual) <N_Op_Divide>: Print '@' manually.
	<N_Op_Multiply>: Likewise.
	<N_Op_Mod>: Do not print '#'.
	<N_Op_Rem>: Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 27270 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200602/500bd02a/attachment-0001.bin>


More information about the Gcc-patches mailing list