aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-09-26 08:26:37 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-09-26 08:26:37 +0000
commita1c7d7973c44afbee5e1251b200cc6e7a27409b1 (patch)
tree0bbfdf9e810f8a0d87f499a7747d27b4dadc2da4 /gcc/ada/gcc-interface/decl.c
parent20633efc34fadc76b339620c2d37f3c12231c40a (diff)
downloadgcc-a1c7d7973c44afbee5e1251b200cc6e7a27409b1.zip
gcc-a1c7d7973c44afbee5e1251b200cc6e7a27409b1.tar.gz
gcc-a1c7d7973c44afbee5e1251b200cc6e7a27409b1.tar.bz2
ada-tree.h (DECL_CAN_NEVER_BE_NULL_P): New macro.
* gcc-interface/ada-tree.h (DECL_CAN_NEVER_BE_NULL_P): New macro. * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Set the flag. (gnat_to_gnu_param): Likewise. * gcc-interface/utils.c (convert) <UNCONSTRAINED_ARRAY_REF>: Invoke maybe_unconstrained_array instead of doing the work manually. (maybe_unconstrained_array): Propagate the TREE_THIS_NOTRAP flag. * gcc-interface/utils2.c (build_unary_op) <INDIRECT_REF>: If operand is a DECL with the flag, set TREE_THIS_NOTRAP on the reference. (gnat_stabilize_reference_1): Propagate the TREE_THIS_NOTRAP flag. (gnat_stabilize_reference): Likewise. From-SVN: r179182
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index ea8eb91..98d68fe 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -1417,6 +1417,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnat_entity);
DECL_BY_REF_P (gnu_decl) = used_by_ref;
DECL_POINTS_TO_READONLY_P (gnu_decl) = used_by_ref && inner_const_flag;
+ DECL_CAN_NEVER_BE_NULL_P (gnu_decl) = Can_Never_Be_Null (gnat_entity);
/* If we are defining an Out parameter and optimization isn't enabled,
create a fake PARM_DECL for debugging purposes and make it point to
@@ -5568,6 +5569,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
mech == By_Short_Descriptor);
DECL_POINTS_TO_READONLY_P (gnu_param)
= (ro_param && (by_ref || by_component_ptr));
+ DECL_CAN_NEVER_BE_NULL_P (gnu_param) = Can_Never_Be_Null (gnat_param);
/* Save the alternate descriptor type, if any. */
if (gnu_param_type_alt)