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 middle-end/70992] Infinite recursion between fold_build2_stat_loc and fold_binary_loc w/ -fwrapv


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70992

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think the issue is that the associate case treats (0 % 0 + 1) * 2 as constant
but that gets further "simplified" when combined with the rest.

In the end our refusal to simplify 0 % 0 to 0 causes things to go downhill
(we _do_ simplify 0 % a to 0!)

 (for mod (ceil_mod floor_mod round_mod trunc_mod)
 /* 0 % X is always zero.  */
 (simplify
  (mod integer_zerop@0 @1)
  /* But not for 0 % 0 so that we can get the proper warnings and errors.  */
  (if (!integer_zerop (@1))
   @0))

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