On Thu, Sep 04, 2025 at 09:58:14AM +0200, Richard Biener wrote:
> I'm in favor of disabling but I also fear the code will bitrot quickly if so?
> We might also want to have a set of testcases for the -fcompare-debug
> issues that are fixed by the change of defaults?
>
> Otherwise I defer to Jakub who will better remember why we didn't
> do this earlier.
I remember a lot of fallout, but trying this patch (I've just applied it,
rebuilt stage3 cc1/cc1plus/f951/lto1 and did make check-{gcc,g++} for
dwarf2.exp and guality.exp) I'm getting just
-FAIL: gcc.dg/guality/pr36728-4.c -O3 -g -DPREVENT_OPTIMIZATION line 14 y
== 2
-FAIL: gcc.dg/guality/pr43051-1.c -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions -DPREVENT_OPTIMIZATION line 34 c ==
&a[0]
+FAIL: gcc.dg/guality/pr43479.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none -DPREVENT_OPTIMIZATION line 18 j == 8
+FAIL: gcc.dg/guality/pr43479.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects -DPREVENT_OPTIMIZATION line 18 j == 8
+FAIL: g++.dg/guality/pr55665.C -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects line 23 p == 40
on x86_64-linux and
-FAIL: gcc.dg/guality/pr36728-4.c -O3 -g -DPREVENT_OPTIMIZATION line 14 y
== 2
on i686-linux, so I agree in guality it is a wash.
So as you said, I'd suggest to enable -gstatement-frontiers and/or
-gvariable-location-views on a few copies of guality tests (both C and C++)
and on say 20-30 randomly chosen other tests (perhaps torture ones such that
it is tested at different optimization levels; but in a form of
dg-additional-options if the test doesn't contain dg-options already).
Jakub