utils2.c (gnat_stabilize_reference): Propagate TREE_THIS_NOTRAP flag.
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 6 Jun 2011 10:37:13 +0000 (10:37 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 6 Jun 2011 10:37:13 +0000 (10:37 +0000)
* gcc-interface/utils2.c (gnat_stabilize_reference): Propagate
TREE_THIS_NOTRAP flag.

From-SVN: r174693

gcc/ada/ChangeLog
gcc/ada/gcc-interface/utils2.c

index ac770864de11359d6a3bc3a9c7630e23a2cb8deb..a54c336971946ffe405d246832ce121730e78572 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-06  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/utils2.c (gnat_stabilize_reference): Propagate
+       TREE_THIS_NOTRAP flag.
+
 2011-06-06  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/utils2.c (gnat_stabilize_reference) <COMPOUND_EXPR>:
index 2a455d1047eb43b6ab382778bf61cd1b9f93e7ea..44eb5cbfbca28d582ac71be5dcc3806ddcaa16b2 100644 (file)
@@ -2570,5 +2570,8 @@ gnat_stabilize_reference (tree ref, bool force, bool *success)
   TREE_SIDE_EFFECTS (result) |= TREE_SIDE_EFFECTS (ref);
   TREE_THIS_VOLATILE (result) = TREE_THIS_VOLATILE (ref);
 
+  if (code == INDIRECT_REF || code == ARRAY_REF || code == ARRAY_RANGE_REF)
+    TREE_THIS_NOTRAP (result) = TREE_THIS_NOTRAP (ref);
+
   return result;
 }