Compiler output: $ gcc -fbounds-check achar_4.f90 achar_4.f90: In function 'up': achar_4.f90:10:0: error: type mismatch in comparison expression integer(kind=8) integer(kind=8) integer(kind=4) D.1758 = D.1594 != 1; achar_4.f90:10:0: internal compiler error: verify_gimple failed Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Tested revisions: r163921 - crash r158095 - crash
Confirmed on x86_64-apple-darwin10. The ICE disappears with -m32 and does not show up on builds with --enable-checking=release.
Index: trans-intrinsic.c =================================================================== --- trans-intrinsic.c (r��vision 163809) +++ trans-intrinsic.c (copie de travail) @@ -4612,7 +4612,7 @@ se->expr = info->descriptor; if (expr->ts.type == BT_CHARACTER) - se->string_length = dest_word_len; + se->string_length = fold_convert (gfc_charlen_type_node, dest_word_len); return;
Subject: Bug 45564 Author: mikael Date: Tue Sep 7 16:04:55 2010 New Revision: 163958 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163958 Log: 2010-09-07 Mikael Morin <mikael@gcc.gnu.org> * trans-stmt.c (gfc_trans_character_select): Be conversion-safe while checking string length value. * trans-intrinsic.c (gfc_conv_intrinsic_char): Build integer using gfc_charlen_type_node type. PR fortran/45564 * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Convert string length to gfc_charlen_type_node. 2010-09-07 Mikael Morin <mikael@gcc.gnu.org> * gfortran.dg/achar_4.f90: Enable bounds checking. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-intrinsic.c trunk/gcc/fortran/trans-stmt.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/achar_4.f90
Fixed.