https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109478
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-04-12 CC| |law at gcc dot gnu.org Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. t.ii:2:9: warning: width of 'a::b' exceeds its type 2 | short b : -1ULL; | ^ Program received signal SIGSEGV, Segmentation fault. 0x00000000011d5bf4 in initialize_argument_information (num_actuals=1, args=0x3398c30, args_size=0x7fffffffc750, n_named_args=1, exp=<call_expr 0x7ffff71c3930>, struct_value_addr_value=<tree 0x0>, fndecl=<function_decl 0x7ffff7329200 c>, fntype=<function_type 0x7ffff7205e70>, args_so_far=..., reg_parm_stack_space=64, old_stack_level=0x7fffffffc6e0, old_pending_adj=0x7fffffffc6d8, must_preallocate=0x7fffffffc708, ecf_flags=0x7fffffffc700, may_tailcall=0x7fffffffc78f, call_from_thunk_p=false) at /space/rguenther/src/gcc/gcc/calls.cc:1519 1519 && XEXP (XVECEXP (args[i].reg, 0, 0), 0) == 0) Missing separate debuginfos, use: zypper install libgmp10-debuginfo-6.1.2-4.9.1.x86_64 libmpc3-debuginfo-1.1.0-1.47.x86_64 libmpfr6-debuginfo-4.0.2-3.3.1.x86_64 libzstd1-debuginfo-1.5.0-150400.3.3.1.x86_64 (gdb) bt #0 0x00000000011d5bf4 in initialize_argument_information (num_actuals=1, args=0x3398c30, args_size=0x7fffffffc750, n_named_args=1, exp=<call_expr 0x7ffff71c3930>, struct_value_addr_value=<tree 0x0>, fndecl=<function_decl 0x7ffff7329200 c>, fntype=<function_type 0x7ffff7205e70>, args_so_far=..., reg_parm_stack_space=64, old_stack_level=0x7fffffffc6e0, old_pending_adj=0x7fffffffc6d8, must_preallocate=0x7fffffffc708, ecf_flags=0x7fffffffc700, may_tailcall=0x7fffffffc78f, call_from_thunk_p=false) at /space/rguenther/src/gcc/gcc/calls.cc:1519 #1 0x00000000011da16d in expand_call (exp=<call_expr 0x7ffff71c3930>, target=0x0, ignore=1) at /space/rguenther/src/gcc/gcc/calls.cc:2973 #2 0x00000000013af7cf in expand_expr_real_1 (exp=<call_expr 0x7ffff71c3930>, target=0x0, tmode=E_VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0, inner_reference_p=false) at /space/rguenther/src/gcc/gcc/expr.cc:11868 #3 0x00000000013a171e in expand_expr_real (exp=<call_expr 0x7ffff71c3930>, target=0x7ffff71cb490, tmode=E_VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0, inner_reference_p=false) at /space/rguenther/src/gcc/gcc/expr.cc:9000 #4 0x00000000011cc17f in expand_expr (exp=<call_expr 0x7ffff71c3930>, target=0x7ffff71cb490, mode=E_VOIDmode, modifier=EXPAND_NORMAL) at /space/rguenther/src/gcc/gcc/expr.h:310 #5 0x00000000011f3928 in expand_call_stmt (stmt=0x7ffff73371b0) at /space/rguenther/src/gcc/gcc/cfgexpand.cc:2831 (gdb) p debug_gimple_stmt (stmt) # .MEM_3 = VDEF <.MEM_2> c (D.2324); (gdb) p debug_tree (exp) <call_expr 0x7ffff71c3930 ... arg:0 <var_decl 0x7ffff7337120 D.2324 type <record_type 0x7ffff731bd20 a cxx-odr-p type_5 BLK size <integer_cst 0x7ffff7338030 constant public overflow 0> unit-size <integer_cst 0x7ffff732efa8 constant 2305843009213693952> align:64 warn_if_not_align:0 symtab:0 alias-set 1 canonical-type 0x7ffff731bd20 fields <function_decl 0x7ffff7329c00 __dt > context <translation_unit_decl 0x7ffff71d7000 t.ii> full-name "struct a" X() X(constX&) this=(X&) n_parents=0 use_template=0 interface-unknown pointer_to_this <pointer_type 0x7ffff731b7e0> reference_to_this <reference_type 0x7ffff731b690> chain <type_decl 0x7ffff7314688 a>> used ignored BLK t.ii:4:16 size <integer_cst 0x7ffff7338030 overflow 0> unit-size <integer_cst 0x7ffff732efa8 2305843009213693952> align:64 warn_if_not_align:0 context <function_decl 0x7ffff7329200 c> (mem/c:BLK (reg/f:DI 63 virtual-stack-vars) [1 D.2324+0 S2305843009213693952 A64])> and the RTL for the argument is (parallel:BLK []) ick. pa_function_arg runs into 9786 arg_size = pa_function_arg_size (mode, type); 9800 if (arg_size > 1) (gdb) p arg_size $7 = 0 so isn't able to decipher things down to a "valid" argument spec. Note above for the argument type we have TYPE_SIZE == 0 but a very large TYPE_SIZE_UNIT. One "obvious" mistake is to use 'int arg_size' for the HOST_WIDE_INT pa_function_arg_size return value. Adjusting also downstream variable types helps to some extent but then we ICE in during RTL pass: dwarf2 t.ii: In function 'void c(...)': t.ii:4:23: internal compiler error: in dwarf2out_frame_debug_expr, at dwarf2cfi.cc:1960 4 | void c(...) { c(a()); } | ^ 0x12bd9d2 dwarf2out_frame_debug_expr /space/rguenther/src/gcc/gcc/dwarf2cfi.cc:1960 0x12bea15 dwarf2out_frame_debug /space/rguenther/src/gcc/gcc/dwarf2cfi.cc:2367 0x12bf81b scan_insn_after /space/rguenther/src/gcc/gcc/dwarf2cfi.cc:2726 0x12bfe3c scan_trace seeing (set (reg:DI 1 %r1) (plus:DI (reg/f:DI 30 %r30) (const_int 4611686018427379840 [0x3fffffffffffe080]))) which probably means PA would need some alternate form when the offset gets large. The following is what's required to get around the first ICE: diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc index 3f91ebce603..66371f7ced9 100644 --- a/gcc/config/pa/pa.cc +++ b/gcc/config/pa/pa.cc @@ -9775,7 +9775,7 @@ pa_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) machine_mode mode = arg.mode; int max_arg_words = (TARGET_64BIT ? 8 : 4); int alignment = 0; - int arg_size; + HOST_WIDE_INT arg_size; int fpr_reg_base; int gpr_reg_base; rtx retval; @@ -9840,7 +9840,8 @@ pa_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) justified data on a big-endian target. */ rtx loc[8]; - int i, offset = 0, ub = arg_size; + int i; + HOST_WIDE_INT offset = 0, ub = arg_size; /* Align the base register. */ gpr_reg_base -= alignment;