https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128174
Torbjorn SVENSSON <azoff at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |azoff at gcc dot gnu.org
--- Comment #3 from Torbjorn SVENSSON <azoff at gcc dot gnu.org> ---
The change in r17-5746-gbb77ebb8b6a4ae introduces a regression for
arm-none-eabi (Cortex-M0 and Cortex-M0+ verified). LRA appears not to converge
when compiling g++.dg/gcov/gcov-22.C with -O0 -fpath-coverage.
I confirmed that r17-5745-ga8b927a09c7931 completes successfully, whereas
r17-5746-gbb77ebb8b6a4ae never finishes. Cortex-M0 and Cortex-M0+ both use
Thumb-1, with a restricted set of registers available to many instructions.
Testing gcov/gcov-22.C, -std=gnu++20
doing compile
Executing on host: /build/r17-5746-gbb77ebb8b6a4ae/bin/arm-none-eabi-g++
/build/gcc_src/gcc/testsuite/g++.dg/gcov/gcov-22.C -mthumb -march=armv6s-m
-mcpu=cortex-m0 -mfloat-abi=soft -mfpu=auto -fdiagnostics-plain-output
-fmessage-length=0 -std=gnu++20 -fpath-coverage -S -o gcov-22.s
(timeout = 800)
spawn -ignore SIGHUP /build/r17-5746-gbb77ebb8b6a4ae/bin/arm-none-eabi-g++
/build/gcc_src/gcc/testsuite/g++.dg/gcov/gcov-22.C -mthumb -march=armv6s-m
-mcpu=cortex-m0 -mfloat-abi=soft -mfpu=auto -fdiagnostics-plain-output
-fmessage-length=0 -std=gnu++20 -fpath-coverage -S -o gcov-22.s
pid is 3768 -3768
WARNING: program timed out
doing kill, pid is 3768
pid is 3768
close result is 3768 exp7 0 0 CHILDKILLED SIGINT interrupt
output is status 1
compiler exited with status 1
The script below prints the LRA constraint iteration and next register number
at entry to lra_constraints, restricted to loop_setjmp_continue. The register
number reflects cumulative register creation, not the number of live registers.
The script deliberately terminates compilation at iteration 30.
python
class LRACounts(gdb.Breakpoint):
def stop(self):
name = gdb.parse_and_eval(
"(char *)cfun->decl->decl_minimal.name->identifier.id.str"
).string()
if name != "loop_setjmp_continue":
return False
iteration = int(gdb.parse_and_eval("lra_constraint_iter")) + 1
next_regno = int(gdb.parse_and_eval("x_rtl.emit.x_reg_rtx_no"))
print("LRA_COUNT,%d,%d" % (iteration, next_regno), flush=True)
if iteration >= 30:
gdb.execute("quit")
return False
LRACounts("lra_constraints")
end
run
$ /build/r17-5745-ga8b927a09c7931/bin/arm-none-eabi-g++
/build/gcc_src/gcc/testsuite/g++.dg/gcov/gcov-22.C -mthumb -mcpu=cortex-m0
-std=gnu++20 -O0 -fpath-coverage -S -wrapper
gdb,-batch,-x,/build/gdb-commands,--args
Breakpoint 1 at 0xe1d460: file /build/gcc_src/gcc/gcc/lra-constraints.cc, line
5995.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
LRA_COUNT,1,373
LRA_COUNT,2,628
LRA_COUNT,3,628
LRA_COUNT,4,1065
LRA_COUNT,5,1071
LRA_COUNT,6,1071
LRA_COUNT,7,1488
LRA_COUNT,8,1489
LRA_COUNT,9,1489
LRA_COUNT,10,2069
LRA_COUNT,11,2088
LRA_COUNT,12,2088
LRA_COUNT,13,2734
LRA_COUNT,14,2735
LRA_COUNT,15,2735
LRA_COUNT,16,3446
[Inferior 1 (process 3580159) exited normally]
$ /build/r17-5746-gbb77ebb8b6a4ae/bin/arm-none-eabi-g++
/build/gcc_src/gcc/testsuite/g++.dg/gcov/gcov-22.C -mthumb -mcpu=cortex-m0
-std=gnu++20 -O0 -fpath-coverage -S -wrapper
gdb,-batch,-x,/build/gdb-commands,--args
Breakpoint 1 at 0xe1d4b0: file /build/gcc_src/gcc/gcc/lra-constraints.cc, line
6010.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
LRA_COUNT,1,373
LRA_COUNT,2,628
LRA_COUNT,3,628
LRA_COUNT,4,1065
LRA_COUNT,5,1071
LRA_COUNT,6,1071
LRA_COUNT,7,1488
LRA_COUNT,8,1489
LRA_COUNT,9,1489
LRA_COUNT,10,2059
LRA_COUNT,11,2078
LRA_COUNT,12,2078
LRA_COUNT,13,2712
LRA_COUNT,14,2715
LRA_COUNT,15,2715
LRA_COUNT,16,3403
LRA_COUNT,17,3404
LRA_COUNT,18,3404
LRA_COUNT,19,4121
LRA_COUNT,20,4128
LRA_COUNT,21,4128
LRA_COUNT,22,4872
LRA_COUNT,23,4872
LRA_COUNT,24,5625
LRA_COUNT,25,6057
LRA_COUNT,26,6057
LRA_COUNT,27,7806
LRA_COUNT,28,8307
LRA_COUNT,29,8307
LRA_COUNT,30,11427
The parent revision completes after 16 LRA constraint iterations. With
r17-5746-gbb77ebb8b6a4ae, register creation continues through iteration 30,
where the script stops compilation.