diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2008-03-08 10:57:28 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2008-03-08 10:57:28 +0000 |
commit | 563569be5ed93378df1e43fca7d7fd6ee0fc0c65 (patch) | |
tree | abd33221dbce3f7a60d776cd308ac4b7bbb35798 /gcc | |
parent | 2725b75c3397530b2fdb9fc9e8123eb95c5ae748 (diff) | |
download | gcc-563569be5ed93378df1e43fca7d7fd6ee0fc0c65.zip gcc-563569be5ed93378df1e43fca7d7fd6ee0fc0c65.tar.gz gcc-563569be5ed93378df1e43fca7d7fd6ee0fc0c65.tar.bz2 |
trans.c (Loop_Statement_to_gnu): Set the SLOC of the loop label from that of the front-end's end label.
* trans.c (Loop_Statement_to_gnu): Set the SLOC of the loop label
from that of the front-end's end label.
(gnat_gimplify_stmt) <LOOP_STMT>: Set the SLOC of the backward goto
from that of the loop label.
From-SVN: r133026
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ada/trans.c | 10 |
2 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5632ddf..4d6f170 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2008-03-08 Eric Botcazou <ebotcazou@adacore.com> + + * trans.c (Loop_Statement_to_gnu): Set the SLOC of the loop label + from that of the front-end's end label. + (gnat_gimplify_stmt) <LOOP_STMT>: Set the SLOC of the backward goto + from that of the loop label. + 2008-03-07 Eric Botcazou <ebotcazou@adacore.com> * decl.c (gnat_to_gnu_entity) <E_Modular_Integer_Subtype>: Add diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c index 6a9af59..5cb0297 100644 --- a/gcc/ada/trans.c +++ b/gcc/ada/trans.c @@ -1584,6 +1584,8 @@ Loop_Statement_to_gnu (Node_Id gnat_node) TREE_SIDE_EFFECTS (gnu_loop_stmt) = 1; LOOP_STMT_LABEL (gnu_loop_stmt) = create_artificial_label (); set_expr_location_from_node (gnu_loop_stmt, gnat_node); + Sloc_to_locus (Sloc (End_Label (gnat_node)), + &DECL_SOURCE_LOCATION (LOOP_STMT_LABEL (gnu_loop_stmt))); /* Save the end label of this LOOP_STMT in a stack so that the corresponding N_Exit_Statement can find it. */ @@ -5334,6 +5336,7 @@ gnat_gimplify_stmt (tree *stmt_p) { tree gnu_start_label = create_artificial_label (); tree gnu_end_label = LOOP_STMT_LABEL (stmt); + tree t; /* Set to emit the statements of the loop. */ *stmt_p = NULL_TREE; @@ -5370,9 +5373,10 @@ gnat_gimplify_stmt (tree *stmt_p) if (LOOP_STMT_UPDATE (stmt)) append_to_statement_list (LOOP_STMT_UPDATE (stmt), stmt_p); - append_to_statement_list (build1 (GOTO_EXPR, void_type_node, - gnu_start_label), - stmt_p); + t = build1 (GOTO_EXPR, void_type_node, gnu_start_label); + set_expr_location (t, DECL_SOURCE_LOCATION (gnu_end_label)); + append_to_statement_list (t, stmt_p); + append_to_statement_list (build1 (LABEL_EXPR, void_type_node, gnu_end_label), stmt_p); |