From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F23FF3858D39; Mon, 23 Oct 2023 10:38:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F23FF3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698057524; bh=lbOGtJZvK+vNLq5m+87FmN/cLahQlbXr+Egi2DQTSMw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=i+9F5IpP4CY6UZWfD7JWggCr4FHMSfcZx8n45qCDlxbZ/H6P9Ksium00eIQCa0M+V 0bSeS53mrth8Rj808PSve+DL7K00SvCHonAh7/70oZDpXhxOvY9XD4eTBqk0qzEGb0 6hiL7VTxn7P+lRyEFkHIzKTjb97GnoMA1IzSa52o= From: "ebotcazou at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/111873] [12/13/14 Regression] runtime Segmentation fault with '-O3 -fno-code-hoisting -fno-early-inlining -fno-tree-fre -fno-tree-pre' Date: Mon, 23 Oct 2023 10:38:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ebotcazou at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ebotcazou at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D111873 --- Comment #8 from Eric Botcazou --- The bug is in the (early) SRA pass though; void h (const struct a i) { const short int i$b; int _1; short int _2; int _3; short int _4; int _5; : i$b_10 =3D i.b; i.b =3D i$b_10; _1 =3D g (i); d =3D _1; _2 =3D i$b_10; _3 =3D (int) _2; f (_3); _4 =3D i$b_10; _5 =3D (int) _4; e (_5); return; } which creates a store to the read-only parameter i: (gdb) p debug_gimple_stmt(stmt) # .MEM =3D VDEF <.MEM> i.b =3D i$b; $2 =3D void (gdb) p debug_tree(gimple_get_lhs (stmt)) unit-size align:16 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7ffff71b6930 precision:16 min max > readonly arg:0 unit-size align:16 warn_if_not_align:0 symtab:0 alias-set -1 canonical-ty= pe 0x7ffff71b6540 fields > readonly used read HI pr111873.c:18:24 size unit-size align:16 warn_if_not_align:0 context arg-type > arg:1 unit-size align:16 warn_if_not_align:0 symtab:0 alias-set -1 canonical-ty= pe 0x7ffff702a498 precision:16 min max > HI pr111873.c:5:9 size unit-size align:16 warn_if_not_align:0 offset_align 128 decl_not_flexarray: 1 offset bit-offset context > pr111873.c:21:7 start: pr111873.c:21:6 finish: pr111873.c:21:8> /* In a VAR_DECL, PARM_DECL or FIELD_DECL, or any kind of ..._REF node, nonzero means it may not be the lhs of an assignment. Nonzero in a FUNCTION_DECL means this function should be treated as "const" function (can only read its arguments). */ #define TREE_READONLY(NODE) (NON_TYPE_CHECK (NODE)->base.readonly_flag)=