Self-explanatory.  Tested on i586-suse-linux, applied on the mainline.

2011-06-06  Eric Botcazou  <ebotca...@adacore.com>

        * gcc-interface/utils2.c (gnat_stabilize_reference): Propagate
        TREE_THIS_NOTRAP flag.


-- 
Eric Botcazou
Index: gcc-interface/utils2.c
===================================================================
--- gcc-interface/utils2.c	(revision 174690)
+++ gcc-interface/utils2.c	(working copy)
@@ -2570,5 +2570,8 @@ gnat_stabilize_reference (tree ref, bool
   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;
 }

Reply via email to