trans.c (Identifier_to_gnu): Don't set TREE_THIS_NOTRAP on a dereference built for...
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 18 Jun 2011 10:31:26 +0000 (10:31 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 18 Jun 2011 10:31:26 +0000 (10:31 +0000)
* gcc-interface/trans.c (Identifier_to_gnu): Don't set TREE_THIS_NOTRAP
on a dereference built for a by-ref object if it has an address clause.

From-SVN: r175172

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

index b3db7a9..fdba3c4 100644 (file)
@@ -1,5 +1,10 @@
 2011-06-18  Eric Botcazou  <ebotcazou@adacore.com>
 
+       * gcc-interface/trans.c (Identifier_to_gnu): Don't set TREE_THIS_NOTRAP
+       on a dereference built for a by-ref object if it has an address clause.
+
+2011-06-18  Eric Botcazou  <ebotcazou@adacore.com>
+
        * einfo.ads (Address_Taken): Document use for the second argument of
        Asm_Input and Asm_Output attributes.
        * sem_attr.adb (Analyze_Attribute) <Attribute_Asm_Input>: If the second
index 8e949a8..bf533bd 100644 (file)
@@ -1018,7 +1018,8 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
       else
        {
          gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_result);
-         if (TREE_CODE (gnu_result) == INDIRECT_REF)
+         if (TREE_CODE (gnu_result) == INDIRECT_REF
+             && No (Address_Clause (gnat_temp)))
            TREE_THIS_NOTRAP (gnu_result) = 1;
        }