public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/94678] New: aarch64: unexpected result with -mgeneral-regs-only and sve
@ 2020-04-21  7:11 felix.yang at huawei dot com
  2020-04-21  7:12 ` [Bug target/94678] " felix.yang at huawei dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: felix.yang at huawei dot com @ 2020-04-21  7:11 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-23 15:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21  7:11 [Bug target/94678] New: aarch64: unexpected result with -mgeneral-regs-only and sve felix.yang at huawei dot com
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

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