Commit 78185974 by Bob Duff Committed by Arnaud Charlet

(Attribute_to_gnu): Check for violations of the No_Implicit_Dynamic_Code restriction.

	(Attribute_to_gnu): Check for violations of the No_Implicit_Dynamic_Code
 	restriction. This checking used to be done in the front end, but is
	moved here so we can make it more accurate.

From-SVN: r130892
parent e9b54d64
2007-12-13 Bob Duff <duff@adacore.com>
* trans.c (Attribute_to_gnu): Check for violations of the
No_Implicit_Dynamic_Code restriction. This checking used to be done in
the front end, but is moved here so we can make it more accurate.
2007-12-13 Pascal Obry <obry@adacore.com>
* adaint.c (__gnat_pthread_setaffinity_np): New routine. A dummy
......@@ -878,6 +878,29 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
if (TREE_CODE (gnu_expr) == ADDR_EXPR)
TREE_STATIC (gnu_expr) = TREE_CONSTANT (gnu_expr) = 1;
}
/* For other address attributes applied to a nested function,
find an inner ADDR_EXPR and annotate it so that we can issue
a useful warning with -Wtrampolines. */
else if (TREE_CODE (TREE_TYPE (gnu_prefix)) == FUNCTION_TYPE)
{
for (gnu_expr = gnu_result;
TREE_CODE (gnu_expr) == NOP_EXPR
|| TREE_CODE (gnu_expr) == CONVERT_EXPR;
gnu_expr = TREE_OPERAND (gnu_expr, 0))
;
if (TREE_CODE (gnu_expr) == ADDR_EXPR
&& decl_function_context (TREE_OPERAND (gnu_expr, 0)))
{
set_expr_location_from_node (gnu_expr, gnat_node);
/* Check that we're not violating the No_Implicit_Dynamic_Code
restriction. Be conservative if we don't know anything
about the trampoline strategy for the target. */
Check_Implicit_Dynamic_Code_Allowed (gnat_node);
}
}
break;
case Attr_Pool_Address:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment