summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-04 09:50:33 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-04 09:50:33 +0000
commit5c7fc120e6d937a93014add02aef2e3c60be5fdc (patch)
tree8f2d336054a316aa0401e0ec52b1adf9c9982266
parent6d92deb8614d6ece2496d1d7d118eb7ea35fb936 (diff)
downloadppe42-gcc-5c7fc120e6d937a93014add02aef2e3c60be5fdc.tar.gz
ppe42-gcc-5c7fc120e6d937a93014add02aef2e3c60be5fdc.zip
* gcc-interface/trans.c (Case_Statement_to_gnu): Put the SLOC of the
end-of-case on the end label and its associated gotos, if any. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168458 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/trans.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f644a5569b0..68446aca747 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,10 @@
2011-01-04 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/trans.c (Case_Statement_to_gnu): Put the SLOC of the
+ end-of-case on the end label and its associated gotos, if any.
+
+2011-01-04 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/trans.c (Subprogram_Body_to_gnu): Evaluate the
expressions of the parameter cache within the statement group of
the CICO mechanism.
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index ecd948993fb..30dbf7a969a 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -1954,6 +1954,7 @@ Case_Statement_to_gnu (Node_Id gnat_node)
{
tree gnu_result, gnu_expr, gnu_label;
Node_Id gnat_when;
+ location_t end_locus;
bool may_fallthru = false;
gnu_expr = gnat_to_gnu (Expression (gnat_node));
@@ -1977,7 +1978,10 @@ Case_Statement_to_gnu (Node_Id gnat_node)
/* We build a SWITCH_EXPR that contains the code with interspersed
CASE_LABEL_EXPRs for each label. */
- gnu_label = create_artificial_label (input_location);
+ if (!Sloc_to_locus (Sloc (gnat_node) + UI_To_Int (End_Span (gnat_node)),
+ &end_locus))
+ end_locus = input_location;
+ gnu_label = create_artificial_label (end_locus);
start_stmt_group ();
for (gnat_when = First_Non_Pragma (Alternatives (gnat_node));
@@ -2062,7 +2066,9 @@ Case_Statement_to_gnu (Node_Id gnat_node)
add_stmt (group);
if (group_may_fallthru)
{
- add_stmt (build1 (GOTO_EXPR, void_type_node, gnu_label));
+ tree stmt = build1 (GOTO_EXPR, void_type_node, gnu_label);
+ SET_EXPR_LOCATION (stmt, end_locus);
+ add_stmt (stmt);
may_fallthru = true;
}
}
OpenPOWER on IntegriCloud