From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BA160385C33A; Fri, 30 Sep 2022 08:47:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA160385C33A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664527658; bh=gT0dnOi+hie+jqqYDucOYklQNTPHyoG2QEI4YY80/8c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jFzFZDu7CfTtyyh1OZqR/Q5pROxggyVAOG+uIHsCRSjJxpDVPCEepJGAyyDRsgAXP nsSxnysybgqz8UCELXqp/94niRqpHiXIpTMiMfypCrV5wQuYgb3Qivo09ZwX/L0VnB YHdqp6tuha9D9BNcuW5EACiIBOGMk49+8NwCVHA0= From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107065] GCC treats rvalue as an lvalue Date: Fri, 30 Sep 2022 08:47:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: glisse 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=3D107065 --- Comment #13 from Marc Glisse --- (In reply to Jakub Jelinek from comment #12) > Doing it on the match.pd side doesn't look right, there could be many oth= er > optimizations that result in something similar. $ grep -c non_lvalue match.pd=20=20=20 12 probably they should be removed and those that were useful should be fixed = by similar techniques as you are considering... To add one more option to your list, maybe the generic-simplify machinery c= ould add non_lvalue automatically in some cases? I still prefer your first option though, tweaking the warning code, which probably expected x!=3D0 and now g= ets !(x=3D=3D0) or something similar.=