https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116461
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|linkw at gcc dot gnu.org |pinskia at gcc dot gnu.org --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Kewen Lin from comment #3) > (In reply to Andrew Pinski from comment #2) > > The easiest fix is todo: > > ``` > > for (int i = 0; i < N; ++i) > > { > > a[i] = BASE1 + i * 5; > > b[i] = BASE2 - i * 4; > > /* b[i] cannot be 0 as that is undefined for `% b[i]`. */ > > b[i] = b[i] ? b[i] : 1; > > __asm__ volatile (""); > > } > > ``` > > > > On x86_64, I suspect we are getting a trap on the `% b[i]` rather than a > > comparison difference too. Which is why the fix should be on the > > initialization rather than the checking. > > > but your proposed fix is more straightforward, will you post it? Yes I can. I will do it in the next few hours.