aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2010-10-14 13:39:18 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-10-14 13:39:18 +0000
commita61c3633ecd0b8392496674a28e8efcd0cec8ab9 (patch)
tree73e843d67156115387cd0f5f57159c563c46f468 /gcc/ada/gcc-interface/trans.c
parent8de2e8c95714a780903496db710adb4f2d6df310 (diff)
downloadgcc-a61c3633ecd0b8392496674a28e8efcd0cec8ab9.zip
gcc-a61c3633ecd0b8392496674a28e8efcd0cec8ab9.tar.gz
gcc-a61c3633ecd0b8392496674a28e8efcd0cec8ab9.tar.bz2
sched-deps.c (sched_insn_is_legitimate_for_speculation): Invoke may_trap_or_fault_p instead of may_trap_p predicate.
* sched-deps.c (sched_insn_is_legitimate_for_speculation): Invoke may_trap_or_fault_p instead of may_trap_p predicate. * tree.c (substitute_in_expr): Propagate the TREE_THIS_NOTRAP flag. (substitute_placeholder_in_expr): Likewise. * tree-inline.c (remap_gimple_op_r): Propagate the TREE_THIS_NOTRAP flag on MEM_REF nodes. (copy_tree_body_r): Propagate the TREE_READONLY and TREE_THIS_NOTRAP flags on INDIRECT_REF nodes. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Set TREE_THIS_NOTRAP on the INDIRECT_REF node built for the template. * gcc-interface/trans.c (Identifier_to_gnu): Set TREE_THIS_NOTRAP on the INDIRECT_REF node built for objects used by reference. * gcc-interface/utils2.c (build_binary_op): Add short-circuit for constant result. Set TREE_THIS_NOTRAP on ARRAY_REF and ARRAY_RANGE_REF. (gnat_stabilize_reference_1): Propagate the TREE_THIS_NOTRAP flag. From-SVN: r165468
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r--gcc/ada/gcc-interface/trans.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 9d021b8..c2068c0 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -978,14 +978,22 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
if (TREE_CODE (gnu_result) == PARM_DECL
&& DECL_BY_DOUBLE_REF_P (gnu_result))
- gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_result);
+ {
+ gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_result);
+ if (TREE_CODE (gnu_result) == INDIRECT_REF)
+ TREE_THIS_NOTRAP (gnu_result) = 1;
+ }
if (TREE_CODE (gnu_result) == PARM_DECL
&& DECL_BY_COMPONENT_PTR_P (gnu_result))
- gnu_result
- = build_unary_op (INDIRECT_REF, NULL_TREE,
- convert (build_pointer_type (gnu_result_type),
- gnu_result));
+ {
+ gnu_result
+ = build_unary_op (INDIRECT_REF, NULL_TREE,
+ convert (build_pointer_type (gnu_result_type),
+ gnu_result));
+ if (TREE_CODE (gnu_result) == INDIRECT_REF)
+ TREE_THIS_NOTRAP (gnu_result) = 1;
+ }
/* If it's a renaming pointer and we are at the right binding level,
we can reference the renamed object directly, since the renamed
@@ -1003,7 +1011,11 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
DECL_INITIAL (gnu_result));
else
- gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_result);
+ {
+ gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_result);
+ if (TREE_CODE (gnu_result) == INDIRECT_REF)
+ TREE_THIS_NOTRAP (gnu_result) = 1;
+ }
if (read_only)
TREE_READONLY (gnu_result) = 1;