From 34e9b3c70d0cdc0b9ef1344a49110ebf4337aed5 Mon Sep 17 00:00:00 2001 From: ebotcazou Date: Sun, 8 Feb 2009 23:10:00 +0000 Subject: [PATCH] * tree-ssa-loop-ivopts.c (may_be_nonaddressable_p) : Make case self-contained. : Test TYPE_NONALIASED_COMPONENT flag. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity) : Set TYPE_NONALIASED_COMPONENT on the array type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144021 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/ada/ChangeLog | 5 +++++ gcc/ada/gcc-interface/decl.c | 1 + gcc/tree-ssa-loop-ivopts.c | 11 +++++------ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 11c3612ee4f..c5833dd3ab4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-02-08 Eric Botcazou + + * tree-ssa-loop-ivopts.c (may_be_nonaddressable_p) : + Make case self-contained. + : Test TYPE_NONALIASED_COMPONENT flag. + 2009-02-07 Anatoly Sokolov * config/avr/avr.c (avr_mcu_t): Add ata6289 device. diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 31000a4133a..4da0bbb7222 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2009-02-08 Eric Botcazou + + * gcc-interface/decl.c (gnat_to_gnu_entity) : + Set TYPE_NONALIASED_COMPONENT on the array type. + 2009-01-31 Laurent GUERBY * gcc-interface/Makefile.in: Fix mipsel linux handling. diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 25c4d816b43..874b1ccb035 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -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; diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index ca1ab98b85a..a1f5c47572d 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -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; -- 2.11.0