https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81003
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 41500 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41500&action=edit gcc8-pr81003.patch We can't allow ->op to be something other than SSA_NAME or NULL (the latter means GIMPLE_COND at the end of some bb), because we need e.g. corresponding stmt iterator to know where to insert related stuff. The reason why we get an integer in ->op is that there is almost no cleanup after cunroll pass before reassoc is invoked, so gimple fold during force_gimple_operand_gsi is successful in optimizing it into a constant. This untested patch ensures we have an SSA_NAME and therefore also stmt iterator for it.