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/60657] [4.9 Regression] ICE: error: insn does not satisfy its constraints
Date: Thu, 27 Mar 2014 08:01:00 -0000	[thread overview]
Message-ID: <bug-60657-4-S1Ndb3sstp@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-60657-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60657

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This fixes this for me, based on:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/BABIDBHE.html
If gas accepts some other value beyond those, the conditions can be tweaked of
course, or it could be solved through more tight predicates and/or more
correct/tight constraints (don't see how 0-32 or any power of 2 applies here,
plus the ICE is that const_int_operand + no specific condition allowed combine
to match garbage insn and once you match it with a wrong number, when the
operand doesn't have a register possibility, there is no way to reload it).

Can somebody please test this (together with the testcase, dunno if
-march=armv7-a is tested often enough that the testcase could be just added to
gcc.c-torture/compile/pr60657.c or if you really want to add the -march=armv7-a
option explicitly).  I'd also think that it would be worthwhile to look at all
arm insns with const_int_operand and constraint that doesn't accept all
CONST_INT values and check if it shouldn't be tightened.

--- gcc/config/arm/arm.md.jj    2014-01-03 11:41:20.000000000 +0100
+++ gcc/config/arm/arm.md    2014-03-27 08:53:48.267277083 +0100
@@ -4581,7 +4581,9 @@ (define_insn "*extv_reg"
     (sign_extract:SI (match_operand:SI 1 "s_register_operand" "r")
                          (match_operand:SI 2 "const_int_operand" "M")
                          (match_operand:SI 3 "const_int_operand" "M")))]
-  "arm_arch_thumb2"
+  "arm_arch_thumb2
+   && IN_RANGE (INTVAL (operands[3]), 0, 31)
+   && IN_RANGE (INTVAL (operands[2]), 1, 32 - INTVAL (operands[3]))"
   "sbfx%?\t%0, %1, %3, %2"
   [(set_attr "length" "4")
    (set_attr "predicable" "yes")
@@ -4594,7 +4596,9 @@ (define_insn "extzv_t2"
     (zero_extract:SI (match_operand:SI 1 "s_register_operand" "r")
                          (match_operand:SI 2 "const_int_operand" "M")
                          (match_operand:SI 3 "const_int_operand" "M")))]
-  "arm_arch_thumb2"
+  "arm_arch_thumb2
+   && IN_RANGE (INTVAL (operands[3]), 0, 31)
+   && IN_RANGE (INTVAL (operands[2]), 1, 32 - INTVAL (operands[3]))"
   "ubfx%?\t%0, %1, %3, %2"
   [(set_attr "length" "4")
    (set_attr "predicable" "yes")


  parent reply	other threads:[~2014-03-27  8:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25 16:31 [Bug target/60657] New: " doko at gcc dot gnu.org
2014-03-25 16:39 ` [Bug target/60657] " doko at gcc dot gnu.org
2014-03-25 18:18 ` ramana at gcc dot gnu.org
2014-03-26 12:52 ` rguenth at gcc dot gnu.org
2014-03-26 20:45 ` jakub at gcc dot gnu.org
2014-03-26 20:46 ` jakub at gcc dot gnu.org
2014-03-27  8:01 ` jakub at gcc dot gnu.org [this message]
2014-03-31  9:57 ` rguenth at gcc dot gnu.org
2014-04-01 19:43 ` law at redhat dot com
2014-04-02 18:29 ` law at redhat dot com
2014-04-03  3:55 ` law at redhat dot com
2014-04-04 13:13 ` law at gcc dot gnu.org
2014-04-04 13:14 ` law at redhat dot com
2014-04-07 13:17 ` ramana at gcc dot gnu.org
2014-04-07 22:11 ` jakub 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-60657-4-S1Ndb3sstp@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).