From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A47413858403; Tue, 8 Nov 2022 14:06:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A47413858403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667916415; bh=aONxRuZcNRTLj4SQ7GNrMttXpIvMn7h1vZr943hzgR4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=M43RI7fStV+xZhNwgBxbyzmZiDzvgT23JFMi4rJ1A3Ho3hIPF3L6Q3u2MeHI5iVUF tPIZrc8xW7VfF7nIwzCxWSyPyDYoRGZMnnC7JUQXICXSZJLrIiXhv5H9KraztRf8Ns 12ZKGqvocrNXfKvDd+Sj7QEKHJUcY4lCqKbnn62A= From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/107565] [12/13 Regression] -Wanalyzer-use-of-uninitialized-value false positive with rdrand Date: Tue, 08 Nov 2022 14:06:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: dmalcolm 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: 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=3D107565 --- Comment #2 from David Malcolm --- (In reply to Andrew Pinski from comment #1) > Confirmed. > else if (!fndecl_has_gimple_body_p (callee_fndecl) > && (!(callee_fndecl_flags & (ECF_CONST | ECF_PURE))) > && !fndecl_built_in_p (callee_fndecl)) > unknown_side_effects =3D true; >=20 > The last part is part of the problem I think. At least here. I think the problem is here, in the analyzer: I think the analyzer is here making the assumption that builtins that haven't been explicitly handled do= n't have side effects (such as writing through the input pointers), which is clearly wrong for this builtin. > Yes maybe we should have another builtin which returns a "_Complex unsign= ed > long long" here which is folded into for __builtin_ia32_rdrand*_step to > remove the need to the address too. >=20 > I am going to declare this one as a target issue but there might be other > builtins which are harder to do the "_Complex" trick. Andrew: I see you've marked this as a target missed-optimization bug, but arguably there's still an analyzer bug here. Should we reassign this back = to the analyzer, or perhaps make a clone of the bug so that we can cover the t= wo aspects of this separately?=