diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2017-02-24 10:07:45 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-02-24 10:07:45 +0000 |
commit | 8ff873dcdc0b87cbb30a1a951384293cc2d15a41 (patch) | |
tree | 9e32a0eaa2a85bed5e902e2a6054c0013ea30aee /gcc | |
parent | bf6b72928e7a8d1734e14ef075dc9c985a4902fe (diff) | |
download | gcc-8ff873dcdc0b87cbb30a1a951384293cc2d15a41.zip gcc-8ff873dcdc0b87cbb30a1a951384293cc2d15a41.tar.gz gcc-8ff873dcdc0b87cbb30a1a951384293cc2d15a41.tar.bz2 |
trans.c (Handled_Sequence_Of_Statements_to_gnu): If there is no end label...
* gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If
there is no end label, put the location of the At_End procedure on
the call to the procedure.
From-SVN: r245699
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 18 |
2 files changed, 24 insertions, 7 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a7edb41..4b60b3e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,18 @@ 2017-02-24 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If + there is no end label, put the location of the At_End procedure on + the call to the procedure. + +2017-02-24 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/misc.c (gnat_type_max_size): Try to return a meaningful + value for array types with TYPE_INDEX_TYPE set on their domain type. + * gcc-interface/utils.c (max_size): For operations and expressions, do + not build a new node if the operands have not changed or are missing. + +2017-02-24 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/utils.c (max_size) <tcc_expression>: Flip the second argument when recursing on TRUTH_NOT_EXPR. diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index e5047f0..7cde230 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2016, Free Software Foundation, Inc. * + * Copyright (C) 1992-2017, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -4965,10 +4965,6 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) tree gnu_result; tree gnu_expr; Node_Id gnat_temp; - /* Node providing the sloc for the cleanup actions. */ - Node_Id gnat_cleanup_loc_node = (Present (End_Label (gnat_node)) ? - End_Label (gnat_node) : - gnat_node); /* The GCC exception handling mechanism can handle both ZCX and SJLJ schemes and we have our own SJLJ mechanism. To call the GCC mechanism, we call @@ -5018,7 +5014,8 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) /* When we exit this block, restore the saved value. */ add_cleanup (build_call_n_expr (set_jmpbuf_decl, 1, gnu_jmpsave_decl), - gnat_cleanup_loc_node); + Present (End_Label (gnat_node)) + ? End_Label (gnat_node) : gnat_node); } /* If we are to call a function when exiting this block, add a cleanup @@ -5027,11 +5024,18 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) if (at_end) { tree proc_decl = gnat_to_gnu (At_End_Proc (gnat_node)); + /* When not optimizing, disable inlining of finalizers as this can create a more complex CFG in the parent function. */ if (!optimize) DECL_DECLARED_INLINE_P (proc_decl) = 0; - add_cleanup (build_call_n_expr (proc_decl, 0), gnat_cleanup_loc_node); + + /* If there is no end label attached, we use the location of the At_End + procedure because Expand_Cleanup_Actions might reset the location of + the enclosing construct to that of an inner statement. */ + add_cleanup (build_call_n_expr (proc_decl, 0), + Present (End_Label (gnat_node)) + ? End_Label (gnat_node) : At_End_Proc (gnat_node)); } /* Now build the tree for the declarations and statements inside this block. |