This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gfortran, committed] Remove redundant code


This check appeared twice in gfc_is_nodesc_array:
  if (sym->attr.pointer || sym->attr.allocatable)
    return 0;

I removed the later one, as it can never be reached.  Bubblestrapped and
regtested, committed to the mainline as obviously correct.  Something like
this function will very probably be needed for the CHARACTER fixes and
cleanups Paul and I are looking at, so I will commit this to 4.0 once testing
finishes as well to avoid divergence, even though this by itself doesn't fix a
bug.

- Tobi

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/ChangeLog,v
retrieving revision 1.422
diff -u -p -r1.422 ChangeLog
--- ChangeLog   11 May 2005 22:32:01 -0000      1.422
+++ ChangeLog   12 May 2005 17:29:40 -0000
@@ -1,5 +1,9 @@
 2005-05-11  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>

+       * trans-types.c (gfc_is_nodesc_array): Remove redundant check.
+
+2005-05-11  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
        PR fortran/21260
        * io.c (check_format): Look for literal characters inside
        hollerith constant.
Index: trans-types.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-types.c,v
retrieving revision 1.42
diff -u -p -r1.42 trans-types.c
--- trans-types.c       10 May 2005 22:06:44 -0000      1.42
+++ trans-types.c       12 May 2005 17:29:40 -0000
@@ -785,9 +785,6 @@ gfc_is_nodesc_array (gfc_symbol * sym)
   if (sym->attr.result || sym->attr.function)
     return 0;

-  if (sym->attr.pointer || sym->attr.allocatable)
-    return 0;
-
   gcc_assert (sym->as->type == AS_EXPLICIT);

   return 1;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]