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/51302] ICE with VOLATILE loop variable


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)


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