[Bug target/94420] [8/9/10 Regression] ICE error: insn does not satisfy its constraints

2020-04-18 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94420

Jeffrey A. Law  changed:

   What|Removed |Added

 CC||law at redhat dot com
 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #11 from Jeffrey A. Law  ---
Commit referenced by c#10 fixed this problem.

[Bug target/94420] [8/9/10 Regression] ICE error: insn does not satisfy its constraints

2020-04-01 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94420

--- Comment #10 from CVS Commits  ---
The master branch has been updated by Segher Boessenkool :

https://gcc.gnu.org/g:032f2366a4cd57f781f2093d977b9cf9600c83b8

commit r10-7497-g032f2366a4cd57f781f2093d977b9cf9600c83b8
Author: Segher Boessenkool 
Date:   Wed Apr 1 16:51:04 2020 +

rs6000: Make code questionably using r2 not ICE (PR94420)

The example code in the PR uses r2 (the TOC register) directly.  In the
RTL generated for that, r2 is copied to some pseudo, and then cprop
propagates that into a "*tocref" insn, because nothing is
preventing it from doing that.

So, put the same condition in the insn condition for this as we will
later encounter in the constraint anyway, fixing this.

2020-04-01  Segher Boessenkool  

PR target/94420
* config/rs6000/rs6000.md (*tocref for P): Add insn condition
on operands[1].

[Bug target/94420] [8/9/10 Regression] ICE error: insn does not satisfy its constraints

2020-04-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94420

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug target/94420] [8/9/10 Regression] ICE error: insn does not satisfy its constraints

2020-03-31 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94420

--- Comment #9 from Segher Boessenkool  ---
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index dcccb03..11ab745 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -10311,7 +10311,8 @@ (define_insn "*largetoc_low_aix"
 (define_insn_and_split "*tocref"
   [(set (match_operand:P 0 "gpc_reg_operand" "=b")
(match_operand:P 1 "small_toc_ref" "R"))]
-   "TARGET_TOC"
+   "TARGET_TOC
+&& legitimate_constant_pool_address_p (operands[1], QImode, false)"
"la %0,%a1"
"&& TARGET_CMODEL != CMODEL_SMALL && reload_completed"
   [(set (match_dup 0) (high:P (match_dup 1)))


This works on the testcase fine; regression testing now.

[Bug target/94420] [8/9/10 Regression] ICE error: insn does not satisfy its constraints

2020-03-31 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94420

Segher Boessenkool  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |segher at gcc dot 
gnu.org

--- Comment #8 from Segher Boessenkool  ---
I put it in the insn condition, testing it now.

[Bug target/94420] [8/9/10 Regression] ICE error: insn does not satisfy its constraints

2020-03-31 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94420

Segher Boessenkool  changed:

   What|Removed |Added

   Keywords|ice-on-invalid-code |ice-on-valid-code

--- Comment #7 from Segher Boessenkool  ---
But okay, let's call it valid code, it doesn't actually *do* anything with
the undefined value in this example :-)

[Bug target/94420] [8/9/10 Regression] ICE error: insn does not satisfy its constraints

2020-03-31 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94420

--- Comment #6 from Jakub Jelinek  ---
So shouldn't predicate on that operand verify the same thing as the constraint
does (or insn condition)?

[Bug target/94420] [8/9/10 Regression] ICE error: insn does not satisfy its constraints

2020-03-31 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94420

--- Comment #5 from Segher Boessenkool  ---
It is undefined behaviour to access such a register in any way -- sure,
you *can* inspect it, there just is no guarantee at all what value you
will get.

It still is a useful thing to do in debug code and the like, of course.

[Bug target/94420] [8/9/10 Regression] ICE error: insn does not satisfy its constraints

2020-03-31 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94420

--- Comment #4 from Segher Boessenkool  ---
cprop1 has done

LOCAL COPY-PROP: Replacing reg 2 in insn 7 with reg 118

which is wrong: the insn isn't valid after that.  But there is nothing
that expresses that, the "R" constraint "just" becomes unsatisfiable.

[Bug target/94420] [8/9/10 Regression] ICE error: insn does not satisfy its constraints

2020-03-31 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94420

--- Comment #3 from Jakub Jelinek  ---
I'm not sure about the invalid, of course if one uses a global register var for
a fixed reg and stores something into it, then it is clearly UB, but this case
is ont about changing it, just inspecting, and I believe users use both global
and local register vars for various fixed regs quite often, whether it is a
stack pointer, hard frame pointer, _GLOBAL_OFFSET_TABLE_ etc.

[Bug target/94420] [8/9/10 Regression] ICE error: insn does not satisfy its constraints

2020-03-31 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94420

--- Comment #2 from Segher Boessenkool  ---
Reserving a register that already *is* reserved (by the ABI) is undefined,
of course.

But we shouldn't ICE.

[Bug target/94420] [8/9/10 Regression] ICE error: insn does not satisfy its constraints

2020-03-31 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94420

Jakub Jelinek  changed:

   What|Removed |Added

   Last reconfirmed||2020-03-31
 Ever confirmed|0   |1
 CC||jakub at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
Summary|ICE error: insn does not|[8/9/10 Regression] ICE
   |satisfy its constraints |error: insn does not
   ||satisfy its constraints
   Target Milestone|--- |8.5

--- Comment #1 from Jakub Jelinek  ---
With additional -fno-common it is quite old regression.