From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 308E63858400; Tue, 14 Dec 2021 08:54:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 308E63858400 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/94414] only `--` gives constexpr Date: Tue, 14 Dec 2021 08:54:20 +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: 10.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia 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: cf_reconfirmed_on everconfirmed bug_status bug_severity component 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: Tue, 14 Dec 2021 08:54:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94414 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-12-14 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Severity|normal |enhancement Component|c++ |tree-optimization --- Comment #4 from Andrew Pinski --- To me there looks like an unrolling not happening: [local count: 1014686026]: # __first_35 =3D PHI <__first_15(4), &MEM [(void *)&arr + 8B](2)> _14 =3D MEM[(const int &)__first_35]; if (_14 <=3D 5) goto ; [94.50%] else goto ; [5.50%] [local count: 958878296]: __first_15 =3D __first_35 + 4; if (&MEM [(void *)&arr + 16B] !=3D __first_15) goto ; [94.50%] else goto ; [5.50%] But from what I can tell it is we unroll the one loop and then we can't unr= oll this one until much later on. It is really interesting testcase.=