From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3CAFB395B083; Mon, 29 Jun 2020 21:30:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3CAFB395B083 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593466225; bh=l2Qh0JHgmOqH9zwhgEc3LA8DC/9XoYAcUSeW2p224UM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HAeZ+o5cljmNMFgQ+95qP5wO2WKJ4ZhQbB9tiTdPM5etKbqIigL3eMhjP2i5Ngox3 u66WNovQu07/YjeRCb0trfaczr/js37AUlRFwpNLAD/546+tZoWiwFCUeXWgKgWLgH QA7WUbyFUP3bO4eZxqYkDF4RXdRb836SDlIv/ZVI= From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/95971] [10 regression] Optimizer converts a false boolean value into a true boolean value Date: Mon, 29 Jun 2020 21:30:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: glisse at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2020 21:30:25 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95971 --- Comment #11 from Marc Glisse --- while(!a.isZero()); that doesn't look like something you would find in real code. Are you waiti= ng for a different thread to modify a? Then you should use an atomic operation. Are you waiting for the hardware to change something? Use volatile. Do you really want an infinite loop? Spell it out if(!a.isZero())for(;;);=