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 if whose condition is always true


This small patch fixes a minor weirdness in trans-stmt.c: since tmp2 ==
wheremask in the affected parts of the code, and wheremask != NULL,
consequently tmp2 != NULL as well.  Hence the if is superfluous in both
instances.  Spotted by Andrew Pinski.

Bubblestrapped, regtested, commited unter the obviously correct rule.

- Tobi

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/ChangeLog,v
retrieving revision 1.322
diff -u -p -r1.322 ChangeLog
--- ChangeLog   12 Feb 2005 15:44:00 -0000      1.322
+++ ChangeLog   13 Feb 2005 15:27:41 -0000
@@ -1,3 +1,9 @@
+2005-02-13  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * trans-stmt.c (generate_loop_for_temp_to_lhs,
+       generate_loop_for_rhs_to_temp): Remove if whose condition is
+       always true.
+
 2005-02-12  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>

        * symbol.c (gfc_use_ha_derived): Remove, fold functionality into ...
Index: trans-stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-stmt.c,v
retrieving revision 1.23
diff -u -p -r1.23 trans-stmt.c
--- trans-stmt.c        27 Jan 2005 00:58:11 -0000      1.23
+++ trans-stmt.c        13 Feb 2005 15:27:41 -0000
@@ -1578,10 +1578,8 @@ generate_loop_for_temp_to_lhs (gfc_expr
      /* Form the mask expression according to the mask tree list.  */
      if (wheremask)
        {
-         tmp2 = wheremask;
-         if (tmp2 != NULL)
-            wheremaskexpr = gfc_build_array_ref (tmp2, count3);
-         tmp2 = TREE_CHAIN (tmp2);
+        wheremaskexpr = gfc_build_array_ref (wheremask, count3);
+         tmp2 = TREE_CHAIN (wheremask);
          while (tmp2)
            {
              tmp1 = gfc_build_array_ref (tmp2, count3);
@@ -1684,10 +1682,8 @@ generate_loop_for_rhs_to_temp (gfc_expr
   /* Form the mask expression according to the mask tree list.  */
   if (wheremask)
     {
-      tmp2 = wheremask;
-      if (tmp2 != NULL)
-        wheremaskexpr = gfc_build_array_ref (tmp2, count3);
-      tmp2 = TREE_CHAIN (tmp2);
+      wheremaskexpr = gfc_build_array_ref (wheremask, count3);
+      tmp2 = TREE_CHAIN (wheremask);
       while (tmp2)
         {
           tmp1 = gfc_build_array_ref (tmp2, count3);


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