On 11/8/23 08:51, Alexandre Oliva wrote:

c-c++-common/goacc/kernels-loop-g.c has been failing (compare-debug)
on i686-linux-gnu since r13-3172, because the implementation enabled
debug stmts to cause discriminators to be assigned differently, and
the discriminators are printed in the .gkd dumps that -fcompare-debug
compares.

This patch prevents debug stmts from affecting the discriminators in
nondebug stmts, but enables debug stmts to get discriminators just as
nondebug stmts would if their line numbers match.

I suppose we could arrange for discriminators to be omitted from the
-fcompare-debug dumps, but keeping discriminators in sync is probably
good to avoid other potential sources of divergence between debug and
nondebug.

Regstrapped on x86_64-linux-gnu, also tested with gcc-13 on i686- and
x86_64-.  Ok to install?

(Eugene, I suppose what's special about this testcase, that may not
apply to most other uses of assign_discriminators, is that goacc creates
new functions out of already optimized code.  I think
assign_discriminators may not be suitable for new functions, with code
that isn't exactly pristinely in-order.  WDYT?)


for  gcc/ChangeLog

        * tree-cfg.cc (assign_discriminators): Handle debug stmts.
OK
jeff

Reply via email to