This is the mail archive of the gcc-bugs@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]

[Bug fortran/55501] [F03] ICE using MERGE in constant expr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55501

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |janus at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #5 from janus at gcc dot gnu.org 2012-11-28 10:35:54 UTC ---
The following patch fixes it:

Index: gcc/fortran/simplify.c
===================================================================
--- gcc/fortran/simplify.c    (revision 193810)
+++ gcc/fortran/simplify.c    (working copy)
@@ -3973,8 +3973,10 @@ gfc_simplify_maskl (gfc_expr *i, gfc_expr *kind_ar
 gfc_expr *
 gfc_simplify_merge (gfc_expr *tsource, gfc_expr *fsource, gfc_expr *mask)
 {
-  if (tsource->expr_type != EXPR_CONSTANT
-      || fsource->expr_type != EXPR_CONSTANT
+  if ((tsource->expr_type != EXPR_CONSTANT
+       && tsource->expr_type != EXPR_STRUCTURE)
+      || (fsource->expr_type != EXPR_CONSTANT
+      && fsource->expr_type != EXPR_STRUCTURE)
       || mask->expr_type != EXPR_CONSTANT)
     return NULL;


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