* trans.c (gfc_build_array_ref): Use STRIP_TYPE_NOPS to eliminate
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Feb 2007 21:16:23 +0000 (21:16 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Feb 2007 21:16:23 +0000 (21:16 +0000)
NON_LVALUE_EXPR nodes and useless type conversions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121522 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/trans.c

index 3ee0a28..edae9d6 100644 (file)
@@ -1,3 +1,8 @@
+2007-02-02  Roger Sayle  <roger@eyesopen.com>
+
+       * trans.c (gfc_build_array_ref): Use STRIP_TYPE_NOPS to eliminate
+       NON_LVALUE_EXPR nodes and useless type conversions.
+
 2007-02-02  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/30284
index 3040319..d942ebd 100644 (file)
@@ -302,6 +302,9 @@ gfc_build_array_ref (tree base, tree offset)
   if (DECL_P (base))
     TREE_ADDRESSABLE (base) = 1;
 
+  /* Strip NON_LVALUE_EXPR nodes.  */
+  STRIP_TYPE_NOPS (offset);
+
   return build4 (ARRAY_REF, type, base, offset, NULL_TREE, NULL_TREE);
 }