]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Exception-raising loop incorrectly eliminated
authorSteve Baird <baird@adacore.com>
Thu, 30 Jan 2025 21:28:50 +0000 (13:28 -0800)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 5 Jun 2025 08:18:37 +0000 (10:18 +0200)
commit429628e9d38663b15b919d65ef5db8a6e85db89f
treef2796b31bb4d38fb682d5c9f612ed04eccca0540
parent9fc6eedace2607c5e322f4b874f290975f0d2b0e
ada: Exception-raising loop incorrectly eliminated

If the body of a loop includes a raise statement then the loop should not be
considered to be free of side-effects and therefore eligible for elimination
by the compiler.

gcc/ada/ChangeLog:

* sem_util.adb
(Side_Effect_Free_Statements): Return False if the statement list
includes an explicit (i.e. Comes_From_Source) raise statement.
gcc/ada/sem_util.adb