From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 876BE3857351; Tue, 18 Jul 2023 15:35:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 876BE3857351 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689694532; bh=6rRfdlYVdTcQHpZQafbTsO7bj21wPB4A3vHdiOr4++I=; h=From:To:Subject:Date:From; b=OzaHLua1eisNuCVw1P9PlsyYlqj+kvyIPGk1kvMzNlIsKNOU5mMx6rqQmf+PyD0+1 XEexvow3Km0C5dYato1JkP9Ut3lLCdAS8spezWULnGN5LGYjwCyL1PcEu7wAwC2Ztp VkYCjatJMn184cDsHQ11KJ6KeZWTI8UFCkLaQLQI= From: "palmer at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110722] New: FP is Saved/Restored around inline assembly Date: Tue, 18 Jul 2023 15:35:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: palmer at gcc dot gnu.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110722 Bug ID: 110722 Summary: FP is Saved/Restored around inline assembly Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: palmer at gcc dot gnu.org Target Milestone: --- I'm not sure if this is some ABI-related requirement that I've managed to forget about, but it looks like we're saving/restoring FP around inline assembly. long fp_asm(long arg0) { asm volatile ("addi a0, a0, 1" : "+r"(arg0)); return arg0; } produces fp_asm(long): addi sp,sp,-16 sd s0,8(sp) addi s0,sp,16 addi a0, a0, 1 ld s0,8(sp) addi sp,sp,16 jr ra We've got a ton of inline assembly in Linux these days and defconfig has `-fno-omit-frame-pointer`, so this probably manifests as a performance issue for someone somewhere -- though Clement just ran into it because he was curious, so I don't have anything concrete.=