------- Comment #13 from dominiq at lps dot ens dot fr 2008-12-20 13:01 ------- The patch in comment #12 fixes the pr without causing the regressions reported in comments #8 and #9. Compiling gcc/testsuite/gfortran.dg/char_length_7.f90 gives an ICE:
gimplification failed: 2 <integer_cst 0x4168ec30 type <integer_type 0x41611310 integer(kind=4)> constant 2> /opt/gcc/_gcc_clean/gcc/testsuite/gfortran.dg/char_length_7.f90: In function 'xx': /opt/gcc/_gcc_clean/gcc/testsuite/gfortran.dg/char_length_7.f90:30: internal compiler error: gimplification failed and the following code: [ibook-dhum] f90/bug% cat pr31608_4_red_1.f90 character(len=1) :: string = "z" character(len=20) :: tmp = "" tmp = Upper ("abcdefgh") print *, tmp contains Character (len=20) Function Upper (string) Character(len=*) string print *, len(string) print *, size(transfer(string,"xy",len(string))) Upper = "" Upper(1:2) = & transfer(merge(transfer(string,"xy",len(string)), & string(1:2), .true.), "xy") return end function Upper end yields a wrong code: the executable gives 8 4 ab while it gives 8 8 ab when compiled with ifort. Currently regtesting. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38538