]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/45380 (ICE in gfc_conv_intrinsic_any_all at -O{n>0})
authorMikael Morin <mikael@gcc.gnu.org>
Mon, 23 Aug 2010 18:42:21 +0000 (18:42 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Mon, 23 Aug 2010 18:42:21 +0000 (18:42 +0000)
2010-08-23  Mikael Morin  <mikael@gcc.gnu.org>

PR fortran/45380
* frontend-passes.c (optimize_equality): Don't optimize array equality

From-SVN: r163484

gcc/fortran/ChangeLog
gcc/fortran/frontend-passes.c

index eba7534df8608df40623e4767839aa235f326b4c..831c7796d8254a72dbf569377426faddb9bfe1e9 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-23  Mikael Morin  <mikael@gcc.gnu.org>
+
+       PR fortran/45380
+       * frontend-passes.c (optimize_equality): Don't optimize array equality
+
 2010-08-23  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/45366
index ce3ee9a27208230676b19f211311acfa726e43e7..27ff0feb9a34b6d2d19c4eee1d7a9f21710475f4 100644 (file)
@@ -399,6 +399,13 @@ optimize_equality (gfc_expr *e, bool equal)
       return true;
     }
 
+  /* An expression of type EXPR_CONSTANT is only valid for scalars.  */
+  /* TODO: A scalar constant may be acceptable in some cases (the scalarizer
+     handles them well). However, there are also cases that need a non-scalar
+     argument. For example the any intrinsic. See PR 45380.  */
+  if (e->rank > 0)
+    return false;
+
   /* Check for direct comparison between identical variables.  Don't compare
      REAL or COMPLEX because of NaN checks.  */
   if (op1->expr_type == EXPR_VARIABLE