[Ada] Avoid spurious warning on assertions with Loop_Entry
authorYannick Moy <moy@adacore.com>
Thu, 11 Jul 2019 08:03:14 +0000 (08:03 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 11 Jul 2019 08:03:14 +0000 (08:03 +0000)
commit708fb956d9b625c150aadf9fb6394651ef054b5a
treeb6dff91a901a8ed27e14ee5fd4e472d06cb8de97
parenta8fa1b3d08ea4cc31f858d2add1b22e62b8db5e1
[Ada] Avoid spurious warning on assertions with Loop_Entry

When the Loop_Entry attribute is used inside a loop invariant or another
assertion where it is allowed, it may lead to spurious warnings on
conditions that are detected to be always valid. Now fixed.

2019-07-11  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_eval.adb (Is_Same_Value): Add special case for rewritten
Loop_Entry attribute.

gcc/testsuite/

* gnat.dg/loop_entry1.adb: New testcase.

From-SVN: r273403
gcc/ada/ChangeLog
gcc/ada/sem_eval.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/loop_entry1.adb [new file with mode: 0644]