aboutsummaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2017-04-25 10:39:02 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2017-04-25 12:39:02 +0200
commitca1f6b2991e1864c8db5c9f082c62804467b2a07 (patch)
tree92f49dea30cdd60ad3a79c1d0e99556ae64c1cb4 /gcc/alias.c
parent36357cf398c9837313d3d62dbdc1e7b883f47135 (diff)
downloadgcc-ca1f6b2991e1864c8db5c9f082c62804467b2a07.zip
gcc-ca1f6b2991e1864c8db5c9f082c62804467b2a07.tar.gz
gcc-ca1f6b2991e1864c8db5c9f082c62804467b2a07.tar.bz2
sem_prag.adb (No_Return): Give an error if the pragma applies to a body.
2017-04-25 Bob Duff <duff@adacore.com> * sem_prag.adb (No_Return): Give an error if the pragma applies to a body. Specialize the error for the specless body case, as is done for (e.g.) pragma Convention. * debug.adb: Add switch -gnatd.J to disable the above legality checks. This is mainly for use in our test suite, to avoid rewriting a lot of illegal (but working) code. It might also be useful to customers. Under this switch, if a pragma No_Return applies to a body, and the procedure raises an exception (as it should), the pragma has no effect. If the procedure does return, execution is erroneous. 2017-04-25 Bob Duff <duff@adacore.com> * exp_ch6.adb (Expand_Actuals): This is the root of the problem. It took N as an 'in out' parameter, and in some cases, rewrote N, but then set N to Original_Node(N). So the node returned in N had no Parent. The caller continued processing of this orphaned node. In some cases that caused a crash (e.g. Remove_Side_Effects climbs up Parents in a loop, and trips over the Empty Parent). The solution is to make N an 'in' parameter. Instead of rewriting it, return the list of post-call actions, so the caller can do the rewriting later, after N has been fully processed. (Expand_Call_Helper): Move most of Expand_Call here. It has too many premature 'return' statements, and we want to do the rewriting on return. (Insert_Post_Call_Actions): New procedure to insert the post-call actions in the appropriate place. In the problematic case, that involves rewriting N as an Expression_With_Actions. (Expand_Call): Call the new procedures Expand_Call_Helper and Insert_Post_Call_Actions. From-SVN: r247178
Diffstat (limited to 'gcc/alias.c')
0 files changed, 0 insertions, 0 deletions