public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/99813] [11 Regression] SVE: Invalid assembly at -O3 (multiplier out of range in incb instruction)
Date: Tue, 30 Mar 2021 09:18:11 +0000	[thread overview]
Message-ID: <bug-99813-4-U8jzfDYbxl@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99813-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think the bug is in swapped constraints on add<mode>3_poly_1.
We have:
(define_constraint "Uai"
  "@internal
   A constraint that matches a VG-based constant that can be added by
   a single INC or DEC."
  (match_operand 0 "aarch64_sve_scalar_inc_dec_immediate"))

(define_constraint "Uav"
  "@internal
   A constraint that matches a VG-based constant that can be added by
   a single ADDVL or ADDPL."
 (match_operand 0 "aarch64_sve_addvl_addpl_immediate"))

and *add<mode>3_aarch64 has:
Uai,Uav
and matching output for those 2 constraints is:
  * return aarch64_output_sve_scalar_inc_dec (operands[2]);
  * return aarch64_output_sve_addvl_addpl (operands[2]);"
Now, *add<mode>3_poly_1 has:
Uav,Uai
and matching output for those 2 constraints is:
  * return aarch64_output_sve_scalar_inc_dec (operands[2]);
  * return aarch64_output_sve_addvl_addpl (operands[2]);
so IMHO, either we need to swap those 2 return lines, or do:
--- gcc/config/aarch64/aarch64.md.jj    2021-02-25 23:07:07.851319165 +0100
+++ gcc/config/aarch64/aarch64.md       2021-03-30 11:13:35.994077470 +0200
@@ -2051,7 +2051,7 @@
     (match_operand:GPI 0 "register_operand" "=r,r,r,r,r,r,&r")
     (plus:GPI
      (match_operand:GPI 1 "register_operand" "%rk,rk,rk,rk,rk,0,rk")
-     (match_operand:GPI 2 "aarch64_pluslong_or_poly_operand"
"I,r,J,Uaa,Uav,Uai,Uat")))]
+     (match_operand:GPI 2 "aarch64_pluslong_or_poly_operand"
"I,r,J,Uaa,Uai,Uav,Uat")))]
   "TARGET_SVE && operands[0] != stack_pointer_rtx"
   "@
   add\\t%<w>0, %<w>1, %2

  parent reply	other threads:[~2021-03-30  9:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29  9:16 [Bug target/99813] New: " acoplan at gcc dot gnu.org
2021-03-29  9:22 ` [Bug target/99813] [11 Regression] " ktkachov at gcc dot gnu.org
2021-03-30  9:18 ` jakub at gcc dot gnu.org [this message]
2021-03-30  9:46 ` jakub at gcc dot gnu.org
2021-03-30 15:20 ` rsandifo at gcc dot gnu.org
2021-03-30 15:58 ` jakub at gcc dot gnu.org
2021-03-30 16:10 ` jakub at gcc dot gnu.org
2021-03-31  8:48 ` cvs-commit at gcc dot gnu.org
2021-03-31  8:49 ` jakub at gcc dot gnu.org
2021-03-31 13:29 ` 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-99813-4-U8jzfDYbxl@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).