https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104440
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Richard Biener from comment #6) > (In reply to Andrew Pinski from comment #5) > > (In reply to Tom de Vries from comment #4) > > > (In reply to Andrew Pinski from comment #2) > > > > I thought there was another bug that reported a similar issue. > > > > > > You mean related to nvptx, or in general? > > > > It was in general. PR 21111 is related but not the same issue. > > > > > > PR 61810 is the one pointing out the problems with init-regs and talking > > about removing it. > > I think there's a bug that ifcombine produces the situation and that > valgrind complains about uninitialized uses. > > Note that indeed the init-regs pass should go away. > > It's somewhat unfeasible to compute a must-initialized regs so the issue > is really hard to avoid. But nobody tried yet (it would also come at a cost > of course). It would definitely inhibit all early short-circuiting on > GENERIC (a good thing, but with a lot of fallout I think). > > That said, --param logical-op-non-short-circuit=0 is only a workaround until > you hit ifcombine doing similar transforms. > > LOGICAL_OP_NON_SHORT_CIRCUIT is a target macro btw, so you could arrange it > to be zero for nvptx (but that's of course too late since the hosts > LOGICAL_OP_NON_SHORT_CIRCUIT value will be used). But it would at least prevent ifcombine from doing the transform (ifcombine only runs on the offload side).