[Ada] Add support for folding more and/or expressions

Pierre-Marie de Rodat derodat@adacore.com
Tue Jun 15 10:20:52 GMT 2021


In particular we now recognize expressions of the form

  xxx and False
  xxx or True

when xxx has no side effect.

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

gcc/ada/

	* sem_eval.adb (Eval_Logical_Op, Test_Expression_Is_Foldable):
	Add support for folding more "and"/"or" expressions.
	* exp_util.adb (Side_Effect_Free): Fix handling of membership
	tests.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 8620 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210615/eb047d22/attachment-0001.bin>


More information about the Gcc-patches mailing list