Commit 58f3f2c3 by Eric Botcazou Committed by Eric Botcazou

tree-nested.c (build_simple_mem_ref_notrap): New function.

	* tree-nested.c (build_simple_mem_ref_notrap): New function.
	(get_static_chain): Call it instead of build_simple_mem_ref.
	(get_frame_field): Likewise.
	(get_nonlocal_debug_decl): Likewise.
	(convert_nonlocal_reference_op): Likewise.

From-SVN: r273763
parent ce9dbf20
2019-07-24 Eric Botcazou <ebotcazou@adacore.com>
* tree-nested.c (build_simple_mem_ref_notrap): New function.
(get_static_chain): Call it instead of build_simple_mem_ref.
(get_frame_field): Likewise.
(get_nonlocal_debug_decl): Likewise.
(convert_nonlocal_reference_op): Likewise.
2019-07-24 Claudiu Zissulescu <claziss@synopsys.com> 2019-07-24 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc-protos.h (arc_output_function_epilogue): Delete * config/arc/arc-protos.h (arc_output_function_epilogue): Delete
......
...@@ -169,6 +169,16 @@ create_tmp_var_for (struct nesting_info *info, tree type, const char *prefix) ...@@ -169,6 +169,16 @@ create_tmp_var_for (struct nesting_info *info, tree type, const char *prefix)
return tmp_var; return tmp_var;
} }
/* Like build_simple_mem_ref, but set TREE_THIS_NOTRAP on the result. */
static tree
build_simple_mem_ref_notrap (tree ptr)
{
tree t = build_simple_mem_ref (ptr);
TREE_THIS_NOTRAP (t) = 1;
return t;
}
/* Take the address of EXP to be used within function CONTEXT. /* Take the address of EXP to be used within function CONTEXT.
Mark it for addressability as necessary. */ Mark it for addressability as necessary. */
...@@ -877,7 +887,7 @@ get_static_chain (struct nesting_info *info, tree target_context, ...@@ -877,7 +887,7 @@ get_static_chain (struct nesting_info *info, tree target_context,
{ {
tree field = get_chain_field (i); tree field = get_chain_field (i);
x = build_simple_mem_ref (x); x = build_simple_mem_ref_notrap (x);
x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE); x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
x = init_tmp_var (info, x, gsi); x = init_tmp_var (info, x, gsi);
} }
...@@ -914,12 +924,12 @@ get_frame_field (struct nesting_info *info, tree target_context, ...@@ -914,12 +924,12 @@ get_frame_field (struct nesting_info *info, tree target_context,
{ {
tree field = get_chain_field (i); tree field = get_chain_field (i);
x = build_simple_mem_ref (x); x = build_simple_mem_ref_notrap (x);
x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE); x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
x = init_tmp_var (info, x, gsi); x = init_tmp_var (info, x, gsi);
} }
x = build_simple_mem_ref (x); x = build_simple_mem_ref_notrap (x);
} }
x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE); x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
...@@ -963,16 +973,16 @@ get_nonlocal_debug_decl (struct nesting_info *info, tree decl) ...@@ -963,16 +973,16 @@ get_nonlocal_debug_decl (struct nesting_info *info, tree decl)
for (i = info->outer; i->context != target_context; i = i->outer) for (i = info->outer; i->context != target_context; i = i->outer)
{ {
field = get_chain_field (i); field = get_chain_field (i);
x = build_simple_mem_ref (x); x = build_simple_mem_ref_notrap (x);
x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE); x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
} }
x = build_simple_mem_ref (x); x = build_simple_mem_ref_notrap (x);
} }
field = lookup_field_for_decl (i, decl, INSERT); field = lookup_field_for_decl (i, decl, INSERT);
x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE); x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
if (use_pointer_in_frame (decl)) if (use_pointer_in_frame (decl))
x = build_simple_mem_ref (x); x = build_simple_mem_ref_notrap (x);
/* ??? We should be remapping types as well, surely. */ /* ??? We should be remapping types as well, surely. */
new_decl = build_decl (DECL_SOURCE_LOCATION (decl), new_decl = build_decl (DECL_SOURCE_LOCATION (decl),
...@@ -1060,7 +1070,7 @@ convert_nonlocal_reference_op (tree *tp, int *walk_subtrees, void *data) ...@@ -1060,7 +1070,7 @@ convert_nonlocal_reference_op (tree *tp, int *walk_subtrees, void *data)
if (use_pointer_in_frame (t)) if (use_pointer_in_frame (t))
{ {
x = init_tmp_var (info, x, &wi->gsi); x = init_tmp_var (info, x, &wi->gsi);
x = build_simple_mem_ref (x); x = build_simple_mem_ref_notrap (x);
} }
} }
......
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