From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6848B3858D1E; Thu, 11 Apr 2024 11:38:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6848B3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712835525; bh=36wextjzNDyIwHTyS9GfBjM3XtMkWjUJlVI2l6kgWu0=; h=From:To:Subject:Date:From; b=Oiz98tQI7csQEorZgff5l2mnFNEl1XB7jVh7IJgq/uqO35nZd6xR6rCe3uBh9XW2e KVkeYHUcIzsnK1H3TuytTwlZrm5HMEjoUzqSeqdShOH5+WygApkLVLTLA85NSCT0MQ +/3EmHnu6RtAkd+jci8puGcJUzSdEweigTHYJHj8= From: "absoler at smail dot nju.edu.cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/114693] New: `expand` introduce redundant store facing logic expression Date: Thu, 11 Apr 2024 11:38:44 +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: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: absoler at smail dot nju.edu.cn 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114693 Bug ID: 114693 Summary: `expand` introduce redundant store facing logic expression Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: absoler at smail dot nju.edu.cn Target Milestone: --- A simple case, regression from gcc-5 ``` struct S{ char f0; int f3; } s; int g, f; void func_1() { int a =3D 0; s.f0 =3D 1 && ((3 > a) & g); } ``` compiled with -O2 : ``` func_1(): 401340: mov 0x10846(%rip),%eax # 411b8c 401346: mov %al,0x10844(%rip) # 411b90 40134c: andb $0x1,0x1083d(%rip) # 411b90 401353: retq=20=20 ``` it seems "1 && " interfere the compiler, after removing it the compiler generates: ``` func_1(): 401340: movzbl 0x10845(%rip),%eax # 411b8c 401347: and $0x1,%eax 40134a: mov %al,0x10840(%rip) # 411b90 401350: retq=20=20=20 ```=