https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84784

--- Comment #4 from anlauf at gcc dot gnu.org ---
OK, the following fixes the ICE:

diff --git a/gcc/fortran/trans-intrinsic.cc b/gcc/fortran/trans-intrinsic.cc
index fccf0a9b229..d5564f659f8 100644
--- a/gcc/fortran/trans-intrinsic.cc
+++ b/gcc/fortran/trans-intrinsic.cc
@@ -7254,13 +7254,15 @@ gfc_conv_intrinsic_popcnt_poppar (gfc_se * se, gfc_expr
*expr, int parity)
                                                 arg2));

       /* Combine the results.  */
+      tree builtin_type = integer_type_node;
       if (parity)
-       se->expr = fold_build2_loc (input_location, BIT_XOR_EXPR, result_type,
+       se->expr = fold_build2_loc (input_location, BIT_XOR_EXPR, builtin_type,
                                    call1, call2);
       else
-       se->expr = fold_build2_loc (input_location, PLUS_EXPR, result_type,
+       se->expr = fold_build2_loc (input_location, PLUS_EXPR, builtin_type,
                                    call1, call2);

+      se->expr = convert (result_type, se->expr);
       return;
     }

Reply via email to