Patchwork [fortran] PR45380 ICE in gfc_conv_intrinsic_any_all

login
register
mail settings
Submitter Mikael Morin
Date Aug. 23, 2010, 9:38 p.m.
Message ID <4C72EA3B.4080605@sfr.fr>
Download mbox | patch
Permalink /patch/62502/
State New
Headers show

Comments

Mikael Morin - Aug. 23, 2010, 9:38 p.m.
Hello,

I plan to commit the following patch under the obvious rule once the 
regression tests finish.

Mikael
2010-08-23  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/45380
	* frontend-passes.c (optimize_equality): Don't optimize array equality
Mikael Morin - Aug. 23, 2010, 10:42 p.m.
Le 23.08.2010 23:38, Mikael Morin a écrit :
> Hello,
>
> I plan to commit the following patch under the obvious rule once the
> regression tests finish.
>
> Mikael
>
revision 163484

Patch

Index: frontend-passes.c
===================================================================
--- frontend-passes.c	(révision 163469)
+++ frontend-passes.c	(copie de travail)
@@ -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