public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Koning <paulkoning@comcast.net>
To: GCC Development <gcc@gcc.gnu.org>
Subject: LRA produces RTL not meeting constraint
Date: Tue, 10 Jan 2023 14:39:34 -0500	[thread overview]
Message-ID: <30F1C49F-FD69-4489-B132-61E94AF9A005@comcast.net> (raw)

In pdp11.md I have:

(define_insn_and_split "addhi3"
  [(set (match_operand:HI 0 "nonimmediate_operand" "=rR,rR,Q,Q")
	(plus:HI (match_operand:HI 1 "general_operand" "%0,0,0,0")
		 (match_operand:HI 2 "general_operand" "rRLM,Qi,rRLM,Qi")))]
  ""
  "#"
  "reload_completed"
  [(parallel [(set (match_dup 0)
		   (plus:HI (match_dup 1) (match_dup 2)))
	      (clobber (reg:CC CC_REGNUM))])]
  ""
  [(set_attr "length" "2,4,4,6")])

While compiling libgcc2.c I see this RTL in the .ira dump file:

(insn 49 48 53 5 (set (reg/f:HI 136)
        (plus:HI (reg/f:HI 5 r5)
            (const_int -8 [0xfffffffffffffff8]))) "../../../../../gcc/libgcc/libgcc2.c":276:4 68 {addhi3}
     (expr_list:REG_EQUIV (plus:HI (reg/f:HI 5 r5)
            (const_int -8 [0xfffffffffffffff8]))
        (nil)))

Then in the .reload dump it appears this way:

(insn 49 48 53 5 (set (reg/f:HI 5 r5 [136])
        (plus:HI (reg/f:HI 6 sp)
            (const_int 40 [0x28]))) "../../../../../gcc/libgcc/libgcc2.c":276:4 68 {addhi3}
     (expr_list:REG_EQUIV (plus:HI (reg/f:HI 5 r5)
            (const_int -8 [0xfffffffffffffff8]))
        (nil)))

which obviously causes an ICE because that RTL doesn't meet the constraints.  This happens only when LRA is used.

I also see this in the .reload file, but I don't know what it means:

	 Choosing alt 1 in insn 49:  (0) rR  (1) 0  (2) Qi {addhi3}
            1 Non-pseudo reload: reject+=2
            1 Non input pseudo reload: reject++
            Cycle danger: overall += LRA_MAX_REJECT
          alt=0,overall=609,losers=1,rld_nregs=2
            alt=1: Bad operand -- refuse
            alt=2: Bad operand -- refuse
          alt=3,overall=0,losers=0,rld_nregs=0

Any ideas?  I ran into this when trying to make LRA the default for this target.

	paul


             reply	other threads:[~2023-01-10 19:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 19:39 Paul Koning [this message]
2023-01-11 19:52 ` Segher Boessenkool
2023-01-12  0:38   ` Paul Koning
2023-01-12  1:17     ` Paul Koning
2023-01-12 16:23     ` Segher Boessenkool

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=30F1C49F-FD69-4489-B132-61E94AF9A005@comcast.net \
    --to=paulkoning@comcast.net \
    --cc=gcc@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).