]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Fix spurious alignment warning on simple address clause
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 18 Sep 2019 08:33:44 +0000 (08:33 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 18 Sep 2019 08:33:44 +0000 (08:33 +0000)
commitf6e980d29735cc31431ffcf13f1abe3507a1fcad
treedae5541eb31bca41017d94b7d91849322b24bb50
parentfb1194b3a2da2c4cc016a0d2ede95fcf0cdc7eea
[Ada] Fix spurious alignment warning on simple address clause

This eliminates a spurious alignment warning given by the compiler on an
address clause when the No_Exception_Propagation restriction is in
effect and the -gnatw.x switch is used. In this configuration the
address clauses whose expression is itself of the form X'Address would
not be sufficiently analyzed and, therefore, the compiler might give
false positive warnings.

2019-09-18  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* checks.ads (Alignment_Warnings_Record): Add P component.
* checks.adb (Apply_Address_Clause_Check): Be prepared to kill
the warning also if the clause is of the form X'Address.
(Validate_Alignment_Check_Warning): Kill the warning if the
clause is of the form X'Address and the alignment of X is
compatible.

gcc/testsuite/

* gnat.dg/warn31.adb, gnat.dg/warn31.ads: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@275865 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/checks.adb
gcc/ada/checks.ads
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/warn31.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/warn31.ads [new file with mode: 0644]