From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0EEE1385841E; Thu, 11 Apr 2024 07:06:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0EEE1385841E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712819179; bh=CLyCORlqt7WU2+IhJijQ1G+X0kK/ONgXDg3EgTm49SY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DTAirLOpSu08snjIzLo9FHVF9xyvl3odJLwpV48N/Kd8aQgbEkterhtf6iQr3ZrB2 O19V4P9hob1yJvmxRZdhyUfNEIEIEDGY64Ie9unOXXGig/wPSomHRLpZwecHCiOAKX nHH2DCjDyxzmjeBqfM6tJsDh21Gknt+kciSzgNXQ= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/114688] repeat load argument of an inline function Date: Thu, 11 Apr 2024 07:06:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: missed-optimization, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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 keywords everconfirmed cf_gcctarget bug_status 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=3D114688 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2024-04-11 Keywords| |missed-optimization, ra Ever confirmed|0 |1 Target| |x86_64-*-* Status|UNCONFIRMED |NEW --- Comment #1 from Richard Biener --- char g; int v; static inline __attribute__((always_inline)) void foo(char p_17); void func_1() { foo(g); } static inline void foo(char c) {=20 v =3D (char)(2 - c) & c;=20 } shows that with -Os we get func_1: .LFB0: .cfi_startproc movb g(%rip), %dl movb $2, %al subl %edx, %eax andl %edx, %eax movsbl %al, %eax movl %eax, v(%rip) ret I think we have duplicate bugs that show we're too happy replicating memory operands to multiple instructions. That might be a target cost thing in the end.=