From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 21E343858D33; Mon, 9 Oct 2023 12:42:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21E343858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696855351; bh=gLbXGnpuNdRGCaW10heDHvWNvq5o7QEtxjfCruLQjkI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=N5IZtgLFc+aFgnzliBE2IPnmQLi9ByQ0v0r0/TRxSy2bEOwpS86EYNcXwprmDRMA3 NfPflv21GISzWAFLRuof0H3//TGqpAgCDlVb8FDcADor0Jr1u/ZlFMyR0tlGKJfmZg KNvbphJTDZ80kBtGrUTm7mtnDLsG2pH8iO7v7Fb8= From: "19373742 at buaa dot edu.cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/111734] wrong code with '-O3 -fno-inline-functions-called-once -fno-inline-small-functions -fno-omit-frame-pointer -fno-toplevel-reorder -fno-tree-fre' Date: Mon, 09 Oct 2023 12:42:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: needs-reduction, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: 19373742 at buaa dot edu.cn X-Bugzilla-Status: UNCONFIRMED 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: 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=3D111734 --- Comment #2 from CTC <19373742 at buaa dot edu.cn> --- A reduced testcase: #include #include struct a {}; struct { uint32_t b; int16_t c; } d, f =3D {9, 1}; int32_t e; static int32_t *g(); static uint32_t h() { int32_t *i =3D &e; struct a j; g(j, i, &i); if (*i) f =3D d; } int32_t *g(uint32_t, int32_t, int32_t **m) { int32_t *k =3D &e; *m =3D k; } int main() { h(); printf("%d\n", f.c); }=