http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51302
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rejects-valid |ice-on-valid-code --- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-25 13:43:39 UTC --- Draft patch - untested: --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -1259,7 +1280,8 @@ gfc_trans_simple_do (gfc_code * code, stmtblock_t *pblock, tree dovar, loc = code->ext.iterator->start->where.lb->location; /* Initialize the DO variable: dovar = from. */ - gfc_add_modify_loc (loc, pblock, dovar, from); + gfc_add_modify_loc (loc, pblock, dovar, + fold_convert (TREE_TYPE(dovar), from)); /* Save value for do-tinkering checking. */ if (gfc_option.rtcheck & GFC_RTCHECK_DO)