From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E3C753839DE3; Wed, 31 Aug 2022 09:07:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3C753839DE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661936875; bh=xcBhxb6LrrZgzEQxSt5odOLG6JsGnjpgEHuJdO1rWhU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Mqcjz1aVenN3ATzDM8ldCW8YXiJn1cQI4Yr7qVy+izKFCnVfaLxi6HwkiW/OCMYsy WwsM0Yh1Yf3QLihLDaIZSbMizdyRKlqPbSKsF8z7N25VOjlMXj1VVQYWL7Pyauk7EM 0cdciACazQwn/vdft7HWrKnt87RBZEMHUreSTPFs= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/65244] Bogus -Wmaybe-uninitialized warning with posix_memalign() and -Og Date: Wed, 31 Aug 2022 09:07:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED 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=3D65244 --- Comment #17 from Richard Biener --- OK, so the "optimization" is needed on the DEF side as extern void __attribute__((noreturn)) abort (void); int foo (int flag, int val) { int tem; if (flag) { if (val =3D=3D 0) abort (); tem =3D val; } /* large - prevent jump threading */ __asm__ volatile ("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); if (flag) return tem; return 0; } shows (I'll add that testcase). Otherwise we pick up ((NOT (val_5(D) =3D=3D 0)) AND (flag_3(D) !=3D 0)) as the condition on which 'tem' is well-defined and the guard of the use is just ((flag_3(D) !=3D 0))=