From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B25A3385DC35; Thu, 25 Jun 2020 08:38:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B25A3385DC35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593074337; bh=QQ96IMcT5OhqAcVUZVqTRG5KjCH9jqesoXekenEJIdE=; h=From:To:Subject:Date:From; b=D9ohmU34bsTwbHmIYOrx1mPP7K0gJAbOSTVO0PRKx3X0+EjD1oRVN0znxLSSTE10t SnaTqXQSRMXK/k5Rj6MTdZKwLXoUVXrrsdw0n8iTByOISOd924DGk99PmVfW21wYzR Ut7oFQMJEA0W3lLOw6+0C8qFzp1riokwybimzfj4= From: "jm at bourguet dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/95891] New: Missing optimization Date: Thu, 25 Jun 2020 08:38:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jm at bourguet dot org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Thu, 25 Jun 2020 08:38:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95891 Bug ID: 95891 Summary: Missing optimization Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: jm at bourguet dot org Target Milestone: --- I'm sorry, this is perhaps not the correct component but my knowledge of gcc internals does not allow me to do more than guess. For all version of gcc I've tried, the following code: struct point { int x, y; }; bool f(point a, point b) { return a.x =3D=3D b.x && a.y =3D=3D b.y; } bool f(unsigned long long a, unsigned long long b) { return a =3D=3D b; } is compiled to f(point, point): xor eax, eax cmp edi, esi je .L5 ret .L5: sar rdi, 32 sar rsi, 32 cmp edi, esi sete al ret f(unsigned long long, unsigned long long): cmp rdi, rsi sete al ret I'd expect f(point, point) to have the same assembly as f(unsigned long lon= g, unsigned long long). Yours, -- Jean-Marc Bourguet=