+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
* *
* 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- *
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
/* 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
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.