public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "felix.yang at huawei dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-94678-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94678

            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 with
-mgeneral-regs-only.

>> test1.c:
#pragma GCC aarch64 "arm_sve.h" 

svbool_t
f1()
{
  return svptrue_b8 ();
}

$aarch64-linux-gnu-gcc -S -march=armv8.2-a+sve -mgeneral-regs-only test1.c 

Assembly output:
f1:
.LFB0:
        .cfi_startproc
        ptrue   p0.b, all   <==== predicate register is used here even with
-mgeneral-regs-only 
        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=armv8.2-a+sve -mgeneral-regs-only test2.c 

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 need 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.

             reply	other threads:[~2020-04-21  7:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21  7:11 felix.yang at huawei dot com [this message]
2020-04-21  7:12 ` [Bug target/94678] " felix.yang at huawei dot com
2020-04-22 17:25 ` cvs-commit at gcc dot gnu.org
2020-04-22 17:26 ` rsandifo at gcc dot gnu.org
2020-04-23 15:08 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94678-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).