[Ada] Problem with boundary case of XOR operation and unnesting
authorEd Schonberg <schonberg@adacore.com>
Wed, 14 Nov 2018 11:42:49 +0000 (11:42 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 14 Nov 2018 11:42:49 +0000 (11:42 +0000)
commit076bbec1c8e8be10079027f6519702275ce5f445
tree746d012c47f50c8b65bb1c673a53d322cf363b29
parent9989a43983116c05aca5c3b5fc30191524b73b94
[Ada] Problem with boundary case of XOR operation and unnesting

The XOR operation applied to a boolean array whose component type has
the range True .. True raises constraint error. Previous to this patch,
the expansion of the operation could lead to uplevel references that
were not handled properly when unnesting is in effect.

2018-11-14  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_util.ads, exp_util.adb: Change the profile of
Silly_Boolean_Array_Xor_Test, adding a formal that can be a copy
of the right opersnd. This prevents unnesting anomalies when
that operand contains uplevel references.
* exp_ch4.adb (Expand_Boolean_Operation): Use this new profile.
* exp_pakd.adb (Expand_Packed_Boolean_Operator): Ditto.

From-SVN: r266137
gcc/ada/ChangeLog
gcc/ada/exp_ch4.adb
gcc/ada/exp_pakd.adb
gcc/ada/exp_util.adb
gcc/ada/exp_util.ads