tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): Make case self-contained.
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 8 Feb 2009 23:10:00 +0000 (23:10 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 8 Feb 2009 23:10:00 +0000 (23:10 +0000)
* tree-ssa-loop-ivopts.c (may_be_nonaddressable_p) <VIEW_CONVERT_EXPR>:
Make case self-contained.
<ARRAY_REF>: Test TYPE_NONALIASED_COMPONENT flag.
ada/
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_String_Literal_Subtype>:
Set TYPE_NONALIASED_COMPONENT on the array type.

From-SVN: r144021

gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/tree-ssa-loop-ivopts.c

index 11c3612ee4ff61c35c68989542a3039faac297a1..c5833dd3ab4566286a1b4d4a3c68baa6cae13bce 100644 (file)
@@ -1,3 +1,9 @@
+2009-02-08  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * tree-ssa-loop-ivopts.c (may_be_nonaddressable_p) <VIEW_CONVERT_EXPR>:
+       Make case self-contained.
+       <ARRAY_REF>: Test TYPE_NONALIASED_COMPONENT flag.
+
 2009-02-07  Anatoly Sokolov  <aesok@post.ru>
 
        * config/avr/avr.c (avr_mcu_t): Add ata6289 device.
index 31000a4133a8b5a9088dc77d0e640d080fb910b4..4da0bbb7222f526602cdaaf7b8101e12894bcb57 100644 (file)
@@ -1,3 +1,8 @@
+2009-02-08  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/decl.c (gnat_to_gnu_entity) <E_String_Literal_Subtype>:
+       Set TYPE_NONALIASED_COMPONENT on the array type.
+
 2009-01-31  Laurent GUERBY  <laurent@guerby.net>
 
        * gcc-interface/Makefile.in: Fix mipsel linux handling.
index 25c4d816b43a2655547679360306bb957619c698..874b1ccb0353d67f449c9b953e9be98c080806c9 100644 (file)
@@ -2615,6 +2615,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
        gnu_type
          = build_array_type (gnat_to_gnu_type (Component_Type (gnat_entity)),
                              gnu_index_type);
+       TYPE_NONALIASED_COMPONENT (gnu_type) = 1;
        copy_alias_set (gnu_type,  gnu_string_type);
       }
       break;
index ca1ab98b85af6b6879918cad08ccf93c494d7e3b..a1f5c47572dd4df7e81b343155fe2be150b9ed37 100644 (file)
@@ -1562,15 +1562,14 @@ may_be_nonaddressable_p (tree expr)
         and make them look addressable.  After some processing the
         non-addressability may be uncovered again, causing ADDR_EXPRs
         of inappropriate objects to be built.  */
-      if (is_gimple_reg (TREE_OPERAND (expr, 0))
-         || !is_gimple_addressable (TREE_OPERAND (expr, 0)))
-       return true;
-
-      /* ... fall through ... */
+      return is_gimple_reg (TREE_OPERAND (expr, 0))
+            || !is_gimple_addressable (TREE_OPERAND (expr, 0))
+            || may_be_nonaddressable_p (TREE_OPERAND (expr, 0));
 
     case ARRAY_REF:
     case ARRAY_RANGE_REF:
-      return may_be_nonaddressable_p (TREE_OPERAND (expr, 0));
+      return TYPE_NONALIASED_COMPONENT (TREE_TYPE (TREE_OPERAND (expr, 0)))
+            || may_be_nonaddressable_p (TREE_OPERAND (expr, 0));
 
     CASE_CONVERT:
       return true;