This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Fix location information of exception block
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 05 Nov 2014 19:51:07 +0100
- Subject: [Ada] Fix location information of exception block
- Authentication-results: sourceware.org; auth=none
This makes it so that an exception block doesn't inherit a bogus location
information in SJLJ mode.
Tested on x86_64-suse-linux, applied on the mainline.
2014-11-05 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): Set
the SLOC of the node on the call to set_jmpbuf_address_soft emitted
on block entry with SJLJ.
--
Eric Botcazou
Index: gcc-interface/trans.c
===================================================================
--- gcc-interface/trans.c (revision 217151)
+++ gcc-interface/trans.c (working copy)
@@ -4629,9 +4629,13 @@ Handled_Sequence_Of_Statements_to_gnu (N
start_stmt_group ();
if (setjmp_longjmp)
- add_stmt (build_call_n_expr (set_jmpbuf_decl, 1,
- build_unary_op (ADDR_EXPR, NULL_TREE,
- gnu_jmpbuf_decl)));
+ {
+ gnu_expr = build_call_n_expr (set_jmpbuf_decl, 1,
+ build_unary_op (ADDR_EXPR, NULL_TREE,
+ gnu_jmpbuf_decl));
+ set_expr_location_from_node (gnu_expr, gnat_node);
+ add_stmt (gnu_expr);
+ }
if (Present (First_Real_Statement (gnat_node)))
process_decls (Statements (gnat_node), Empty,