https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122581
Bug ID: 122581
Summary: [16 Regression] nvptx 'g++.dg/other/pr104989.C' vs.
'c++: C++26 va_start - part of P3348R4 - C++26 should
refer to C23 not C17'
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: compile-time-hog
Severity: minor
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: tschwinge at gcc dot gnu.org
CC: jakub at gcc dot gnu.org, vries at gcc dot gnu.org
Target Milestone: ---
Target: nvptx
(Jakub, anyone, if you have any comments I'm happy to hear them, but otherwise,
this is just me dumping my state, for later.)
With commit r16-4338-g4e44fe4280bf2d9ddc135dec18ec109805c539b9 'c++: C++26
va_start - part of P3348R4 - C++26 should refer to C23 not C17',
'--target=nvptx-none' acquired:
XFAIL: g++.dg/other/pr104989.C -std=gnu++17 (test for excess errors)
XFAIL: g++.dg/other/pr104989.C -std=gnu++98 (test for excess errors)
+WARNING: program timed out
XFAIL: g++.dg/other/pr104989.C -std=gnu++26 (test for excess errors)
... that is, GCC/nvptx gets stuck for '-std=gnu++26', when it previously
completed instantly, and still does now for other than '-std=gnu++26'.
Before r16-4338, '-std=gnu++23' vs. '-std=gnu++26' dumps are identical.
Before r16-4338 '-std=gnu++23' vs. after r16-4338 '-std=gnu++23' dumps are
identical.
After r16-4338, '-std=gnu++23' vs. '-std=gnu++26' dumps are identical up to
'pr104989.C.271t.optimized', but 'pr104989.C.272r.expand' has differences:
@@ -93,22 +93,26 @@
(insn 19 18 20 2 (set (reg:DI 36)
(reg:DI 35))
"source-gcc/gcc/testsuite/g++.dg/other/pr104989.C":8:16 -1
(nil))
-(insn 20 19 21 2 (set (reg:DI 38)
+(insn 20 19 21 2 (set (reg:DI 37)
(plus:DI (reg/f:DI 17 virtual-stack-vars)
(const_int 2305843009213693952 [0x2000000000000000])))
"source-gcc/gcc/testsuite/g++.dg/other/pr104989.C":8:16 -1
(nil))
+(insn 21 20 22 2 (set (mem:DI (reg/f:DI 19 virtual-outgoing-args) [0 S8
A64])
+ (reg:DI 37))
"source-gcc/gcc/testsuite/g++.dg/other/pr104989.C":8:16 -1
+ (nil))
-(insn 21 20 22 2 (set (reg:DI 37)
- (reg:DI 38))
"source-gcc/gcc/testsuite/g++.dg/other/pr104989.C":8:16 -1
+(insn 22 21 23 2 (set (reg:DI 38)
+ (reg/f:DI 1 %stack))
"source-gcc/gcc/testsuite/g++.dg/other/pr104989.C":8:16 -1
(nil))
-(call_insn 22 21 26 2 (parallel [
- (call (mem:QI (symbol_ref:DI ("_Z1cz") [flags 0x3]
<function_decl 0x7f0656ab7f00 c>) [0 c S1 A8])
+(call_insn 23 22 27 2 (parallel [
+ (call (mem:QI (symbol_ref:DI ("_Z1cz") [flags 0x3]
<function_decl 0x7f926334e000 c>) [0 c S1 A8])
(const_int 0 [0]))
- (use (reg:DI 37))
+ (use (reg:DI 38))
]) "source-gcc/gcc/testsuite/g++.dg/other/pr104989.C":8:16 -1
- (expr_list:REG_CALL_DECL (symbol_ref:DI ("_Z1cz") [flags 0x3]
<function_decl 0x7f0656ab7f00 c>)
+ (expr_list:REG_CALL_DECL (symbol_ref:DI ("_Z1cz") [flags 0x3]
<function_decl 0x7f926334e000 c>)
(nil))
- (nil))
+ (expr_list:DI (use (mem/f:DI (reg/f:DI 19 virtual-outgoing-args) [0
S8 A64]))
+ (nil)))
-(insn 26 22 24 2 (const_int 0 [0])
"source-gcc/gcc/testsuite/g++.dg/other/pr104989.C":8:23 discrim 1 -1
+(insn 27 23 25 2 (const_int 0 [0])
"source-gcc/gcc/testsuite/g++.dg/other/pr104989.C":8:23 discrim 1 -1
(nil))
-(insn 24 26 0 2 (asm_input/v (""))
"source-gcc/gcc/testsuite/g++.dg/other/pr104989.C":8:23 -1
+(insn 25 27 0 2 (asm_input/v (""))
"source-gcc/gcc/testsuite/g++.dg/other/pr104989.C":8:23 -1
(nil))
What is causing that, is that expected?
Are there similar 'expand' changes for other targets, or only nvptx?
Why does GCC/nvptx get stuck on this?
(gdb) bt
#0 0x0000000001390d92 in get_initial_register_offset (from=<optimized
out>, to=<optimized out>) at [...]/gcc/rtlanal.cc:367
#1 rtx_addr_can_trap_p_1 (x=0x7ffff76e91e0, offset=..., size=...,
mode=E_DImode, unaligned_mems=false) at [...]/gcc/rtlanal.cc:601
#2 0x0000000001395e18 in may_trap_p_1 (x=0x7ffff784d0c0, flags=0) at
[...]/gcc/rtlanal.cc:3262
#3 0x0000000000f6b628 in get_eh_region_and_lp_from_rtx
(insn=insn@entry=0x7ffff784c580, pr=pr@entry=0x7fffffffce88,
plp=plp@entry=0x7fffffffce80) at [...]/gcc/except.cc:1839
#4 0x0000000000f6bb01 in get_eh_landing_pad_from_rtx
(insn=insn@entry=0x7ffff784c580) at [...]/gcc/except.cc:1873
#5 can_throw_internal (insn=insn@entry=0x7ffff784c580) at
[...]/gcc/except.cc:1895
#6 0x0000000001e902f5 in control_flow_insn_p
(insn=insn@entry=0x7ffff784c580) at [...]/gcc/cfgbuild.cc:118
#7 0x0000000000e7af9e in rtl_verify_bb_insns () at
[...]/gcc/cfgrtl.cc:2831
#8 0x0000000000e845fa in rtl_verify_flow_info_1 () at
[...]/gcc/cfgrtl.cc:2921
#9 rtl_verify_flow_info () at [...]/gcc/cfgrtl.cc:3166
#10 0x0000000000e68940 in verify_flow_info () at [...]/gcc/cfghooks.cc:283
#11 0x0000000000e837ca in checking_verify_flow_info () at
[...]/gcc/cfghooks.h:214
#12 commit_edge_insertions () at [...]/gcc/cfgrtl.cc:2152
#13 0x000000000100b2fe in thread_prologue_and_epilogue_insns () at
[...]/gcc/function.cc:6161
#14 0x00000000017f9abb in nvptx_reorg () at
[...]/gcc/config/nvptx/nvptx.cc:5806
#15 0x000000000138dffa in (anonymous
namespace)::pass_machine_reorg::execute (this=<optimized out>) at
[...]/gcc/reorg.cc:3924
#16 0x00000000012db103 in execute_one_pass (pass=pass@entry=0x2a6f490) at
[...]/gcc/passes.cc:2648
#17 0x00000000012dba20 in execute_pass_list_1 (pass=0x2a6f490) at
[...]/gcc/passes.cc:2757
#18 0x00000000012dba32 in execute_pass_list_1 (pass=0x2a6f2b0) at
[...]/gcc/passes.cc:2758
#19 0x00000000012dba32 in execute_pass_list_1 (pass=0x2a6d450) at
[...]/gcc/passes.cc:2758
#20 0x00000000012dba59 in execute_pass_list (fn=0x7ffff7fb90c8,
pass=<optimized out>) at [...]/gcc/passes.cc:2768
#21 0x0000000000ea7719 in cgraph_node::expand (this=0x7ffff7847000) at
[...]/gcc/context.h:48
#22 cgraph_node::expand (this=0x7ffff7847000) at
[...]/gcc/cgraphunit.cc:1821
#23 0x0000000000ea8b1b in expand_all_functions () at
[...]/gcc/cgraphunit.cc:2051
#24 symbol_table::compile (this=0x7ffff76ed000) at
[...]/gcc/cgraphunit.cc:2428
#25 0x0000000000eab39e in symbol_table::compile (this=0x7ffff76ed000) at
[...]/gcc/cgraphunit.cc:2338
#26 symbol_table::finalize_compilation_unit (this=0x7ffff76ed000) at
[...]/gcc/cgraphunit.cc:2617
#27 0x00000000013ea46e in compile_file () at [...]/gcc/toplev.cc:480
#28 0x0000000000a57bd0 in do_compile () at [...]/gcc/toplev.cc:2222
#29 toplev::main (this=this@entry=0x7fffffffd34e, argc=<optimized out>,
argc@entry=23, argv=<optimized out>, argv@entry=0x7fffffffd478) at
[...]/gcc/toplev.cc:2385
#30 0x0000000000a593db in main (argc=23, argv=0x7fffffffd478) at
[...]/gcc/main.cc:39