From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D1F93858D28; Wed, 12 Apr 2023 11:31:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D1F93858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681299061; bh=PjT+swtpBLUBMbHO++YWfL5NShEOGq0KS2mQXweHl98=; h=From:To:Subject:Date:In-Reply-To:References:From; b=c9/h3qUsLG1kig9nIf8MxwJgf0cNA3CatunU+slX+qI8nvk/5GficYJitAoeLPHKh n0ZW6S5vMreVgJfRtEtubquHlV0al16bXvDgT3cmToDrBzRHVdDpuNI/rAWJq64oI9 4VHBi3wkhtmDudKY5TYMUm9vvZjXy7neaPm6wpNs= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/109478] FAIL: g++.dg/other/pr104989.C -std=gnu++14 (internal compiler error: Segmentation fault) Date: Wed, 12 Apr 2023 11:31:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on cc bug_status everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109478 Richard Biener 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 --- 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=3D1, args=3D0x3398c30, args_size=3D0x7fffffffc750, n_named_args=3D1, exp=3D, struct_value_addr_value=3D, fndecl=3D, fntype=3D, args_so_far=3D.= .., reg_parm_stack_space=3D64, old_stack_level=3D0x7fffffffc6e0, old_pending_adj=3D0x7fffffffc6d8, must_preallocate=3D0x7fffffffc708, ecf_flags=3D0x7fffffffc700, may_tailcall=3D0x7fffffffc78f, call_from_thunk_= p=3Dfalse) at /space/rguenther/src/gcc/gcc/calls.cc:1519 1519 && XEXP (XVECEXP (args[i].reg, 0, 0), 0) =3D=3D 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=3D1,= =20 args=3D0x3398c30, args_size=3D0x7fffffffc750, n_named_args=3D1,=20 exp=3D, struct_value_addr_value=3D,= =20 fndecl=3D,=20 fntype=3D, args_so_far=3D...,=20 reg_parm_stack_space=3D64, old_stack_level=3D0x7fffffffc6e0,=20 old_pending_adj=3D0x7fffffffc6d8, must_preallocate=3D0x7fffffffc708,=20 ecf_flags=3D0x7fffffffc700, may_tailcall=3D0x7fffffffc78f,=20 call_from_thunk_p=3Dfalse) at /space/rguenther/src/gcc/gcc/calls.cc:1519 #1 0x00000000011da16d in expand_call (exp=3D,=20 target=3D0x0, ignore=3D1) at /space/rguenther/src/gcc/gcc/calls.cc:2973 #2 0x00000000013af7cf in expand_expr_real_1 (exp=3D,=20 target=3D0x0, tmode=3DE_VOIDmode, modifier=3DEXPAND_NORMAL, alt_rtl=3D0= x0,=20 inner_reference_p=3Dfalse) at /space/rguenther/src/gcc/gcc/expr.cc:11868 #3 0x00000000013a171e in expand_expr_real (exp=3D,=20 target=3D0x7ffff71cb490, tmode=3DE_VOIDmode, modifier=3DEXPAND_NORMAL,= =20 alt_rtl=3D0x0, inner_reference_p=3Dfalse) at /space/rguenther/src/gcc/gcc/expr.cc:9000 #4 0x00000000011cc17f in expand_expr (exp=3D,=20 target=3D0x7ffff71cb490, mode=3DE_VOIDmode, modifier=3DEXPAND_NORMAL) at /space/rguenther/src/gcc/gcc/expr.h:310 #5 0x00000000011f3928 in expand_call_stmt (stmt=3D0x7ffff73371b0) at /space/rguenther/src/gcc/gcc/cfgexpand.cc:2831 (gdb) p debug_gimple_stmt (stmt) # .MEM_3 =3D VDEF <.MEM_2> c (D.2324); (gdb) p debug_tree (exp) unit-size align:64 warn_if_not_align:0 symtab:0 alias-set 1 canonical-type 0x7ffff731bd20 fields context full-name "struct a" X() X(constX&) this=3D(X&) n_parents=3D0 use_template=3D0 interface-unknown pointer_to_this reference_to_this chain > used ignored BLK t.ii:4:16 size unit-size align:64 warn_if_not_align:0 context (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 =3D pa_function_arg_size (mode, type); 9800 if (arg_size > 1) (gdb) p arg_size $7 =3D 0 so isn't able to decipher things down to a "valid" argument spec. Note above for the argument type we have TYPE_SIZE =3D=3D 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 =3D arg.mode; int max_arg_words =3D (TARGET_64BIT ? 8 : 4); int alignment =3D 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 =3D 0, ub =3D arg_size; + int i; + HOST_WIDE_INT offset =3D 0, ub =3D arg_size; /* Align the base register. */ gpr_reg_base -=3D alignment;=