]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/ada/checks.adb
[Ada] Missing front-end code for constraint checks on fixed point exprs
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Sep 2018 09:19:38 +0000 (09:19 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Sep 2018 09:19:38 +0000 (09:19 +0000)
commit7d97dbc989d1644163bb94dc222012d53d47d6fa
tree67c44fcb4fcad12ad1611fa9be88c2c11ba6ab44
parent382c4351acdca731a506d00357a2957c46e34235
[Ada] Missing front-end code for constraint checks on fixed point exprs

This patch ensures that the front-end generates constraint checks for
some operations that previously depended on gigi for the corresponding
check. The patch also resets the Do_Range_Check flag so that it never
appears in the tree presented to gigi.

2018-09-26  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* checks.adb (Apply_Type_Conversion_Checks): Do not generate a
range check on the expression of the conversion if it involves a
fixed-point type, as such conversions are handled specially
during expansion.
* exp_ch4.adb (Expand_N_Type_Conversion): In a conversion from
Fixed to Integer, use the base type of the expression to ensure
that the caller will generate the proper constraint check when
needed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264632 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/checks.adb
gcc/ada/exp_ch4.adb