From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D21BD3851C03; Mon, 29 Jun 2020 19:15:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D21BD3851C03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593458133; bh=9kOeIu2dKaT7raEI5uXo0oqumuAYEw1SLXVvisJRaEA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oWo9y4oeK+35nxLgixtzHsEUgvURh9wGSk55Ic6YJZE9T5aCB1P3gvXH7+KzqvkLa p9crhpbMexYe13wiYoFWNaWwPc84noszF4IXslbTnODLIFaDhJgZ1Uq++CPc7eSX3l 59j6K1eSedpEuBsSdwydYcRrAmC1sDBcfQQerm2U= From: "0xe2.0x9a.0x9b at gmail dot com" 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 19:15:33 +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: 0xe2.0x9a.0x9b at gmail dot com 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 19:15:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95971 --- Comment #9 from Jan Ziak (http://atom-symbol.net) <0xe2.0x9a.0x9b at gm= ail dot com> --- (In reply to Martin Li=C5=A1ka from comment #8) > Or you can use -fno-finite-loops option. I am sorry, but I cannot trust this compiler not to force me again spending several hours of time just to learn that -O2 is semantically different from= -O1 and -O3. The meaning of "semantically equivalent" in my mind is different from the meaning of "semantically equivalent" in your mind. Infinite loopiness is in= my opinion semantically significant, so the compiler should have printed a war= ning that would inform me about the fact that the compiler is changing the seman= tics of the code in question. With -O3, the assembly code is: Dump of assembler code for function main: <+0>: sub $0x8,%rsp <+4>: xor %edi,%edi <+6>: callq xbool(bool) <+11>: jmp main+11 "11: jmp 11" is a prime example of what -ffinite-loops is supposed to preve= nt from being generated. Assuming that -O3 actually does include -ffinite-loops, which I am unable to verify because "g++ --help=3Doptimizers -Q" doesn't accept the -std=3Dgnu++= 11 option.=