From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 85A4B384B0C1; Tue, 21 Apr 2020 07:11:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85A4B384B0C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587453112; bh=/9erK4jg0ivzlNp2Q2S9fnnXcY+NbI1zZyIIeM2978I=; h=From:To:Subject:Date:From; b=FxBH0oe2/bbQu2MPd/wxUwFR3xg2dAgK1kIIQS2EnB8waCTVND3RQnQ4xDhPsKvQV /UX3RpfqQ4Fh/knjNFiTQ7fqLsVdWcn7CMfvU6gsE0X1CUlrxq0xEHNRtWWdXpuSjp mNLXE45k6QzaY2mVP+VhSZusxHkrsGDuEeGd1sm0= From: "felix.yang at huawei dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94678] New: aarch64: unexpected result with -mgeneral-regs-only and sve Date: Tue, 21 Apr 2020 07:11:52 +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: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: felix.yang at huawei dot com 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 cc target_milestone cf_gcctarget 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: Tue, 21 Apr 2020 07:11:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94678 Bug ID: 94678 Summary: aarch64: unexpected result with -mgeneral-regs-only and sve Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: felix.yang at huawei dot com CC: richard.sandiford at arm dot com Target Milestone: --- Target: aarch64 It looks like there are several issues out there for aarch64 sve codegen wi= th -mgeneral-regs-only. >> test1.c: #pragma GCC aarch64 "arm_sve.h"=20 svbool_t f1() { return svptrue_b8 (); } $aarch64-linux-gnu-gcc -S -march=3Darmv8.2-a+sve -mgeneral-regs-only test1.= c=20 Assembly output: f1: .LFB0: .cfi_startproc ptrue p0.b, all <=3D=3D=3D=3D predicate register is used here e= ven with -mgeneral-regs-only=20 ret .cfi_endproc .LFE0: >> test2.c: #pragma GCC aarch64 "arm_sve.h" svint8_t f2 (svbool_t *x, svint8_t *y) { return svadd_m (*x, *y, 1); } $aarch64-linux-gnu-gcc -S -march=3Darmv8.2-a+sve -mgeneral-regs-only test2.= c=20 This will trigger an ICE. We do ISA extension checks for SVE in check_required_extensions(aarch64-sve-builtins.cc), I think we may also nee= d to check -mgeneral-regs-only there and issue an error message when this option= is specified. This would be cheap as compared with adding && TARGET_GENERAL_REGS_ONLY to TARGET_SVE and similar macros. I have created a patch for that.=