[Bug target/77822] [6/7 Regression] arm64 Error: immediate value out of range 0 to 63 at operand 3

2016-11-07 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77822

--- Comment #18 from ktkachov at gcc dot gnu.org ---
Author: ktkachov
Date: Mon Nov  7 11:43:57 2016
New Revision: 241898

URL: https://gcc.gnu.org/viewcvs?rev=241898=gcc=rev
Log:
[AArch64] Fix PR target/77822: Use tighter predicates for zero_extract patterns

PR target/77822
* config/aarch64/aarch64.md (*tb1): Use
aarch64_simd_shift_imm_ predicate for operand 1.
(, ANY_EXTRACT): Use tighter predicates on operands 2 and 3
to restrict them to an appropriate range and add FAIL check if the
region they specify is out of range.  Delete useless constraint
strings.
(*, ANY_EXTRACT): Add appropriate predicates on operands
2 and 3 to restrict their range and add pattern predicate.

* g++.dg/torture/pr77822.C: New test.


Added:
trunk/gcc/testsuite/g++.dg/torture/pr77822.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/aarch64/aarch64.md
trunk/gcc/testsuite/ChangeLog

[Bug target/77822] [6/7 Regression] arm64 Error: immediate value out of range 0 to 63 at operand 3

2016-10-05 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77822

--- Comment #17 from Segher Boessenkool  ---
Yes, combine should avoid forming patterns that can never match.  It already
does that in many cases.  Where does it form this one?

And yes, the target should not allow patterns it has no instruction for,
let alone patterns on which it will crash later ;-)

[Bug target/77822] [6/7 Regression] arm64 Error: immediate value out of range 0 to 63 at operand 3

2016-10-05 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77822

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

 CC||segher at gcc dot gnu.org

--- Comment #16 from ktkachov at gcc dot gnu.org ---
The reduced testcase for aarch64 at -O3 is:

using UINT8 = char;
using UINT32 = int;
using UINT64 = long;
class A {
  void m_fn1();
  struct B {
UINT32 m_multiplier;
  };
  UINT8 m_datawidth;
  UINT8 m_subunits;
  B m_subunit_infos[];
};
int a;
UINT64 b;
void A::m_fn1() {
  int c = 32, d = m_datawidth / c;
  for (int e = 0; e < d; e++) {
UINT32 f = e * 32;
if (b >> f & 1)
  m_subunit_infos[m_subunits].m_multiplier = a;
  }
}

The aarch64 patterns for extzv and *tb1 don't have the appropriate
predicates on their zero extract operands and end up allowing silly values like
192.
They should be fixed, but the zero_extract patterns are being formed in
combine. ISTR combine started forming zero_extracts more aggressively in GCC 6
but shouldn't it avoid forming them when the RTX it generates is clearly bogus
like:
(zero_extract:DI (reg:DI 75 [ b.0_3 ])
(const_int 1 [0x1])
(const_int 192 [0xc0]))

?

[Bug target/77822] [6/7 Regression] arm64 Error: immediate value out of range 0 to 63 at operand 3

2016-10-05 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77822

Matthias Klose  changed:

   What|Removed |Added

 CC||doko at gcc dot gnu.org

--- Comment #15 from Matthias Klose  ---
fwiw, I see something similar on s390x:
https://launchpadlibrarian.net/288309956/buildlog_ubuntu-yakkety-s390x.mame_0.178-1_BUILDING.txt.gz

[Bug target/77822] [6/7 Regression] arm64 Error: immediate value out of range 0 to 63 at operand 3

2016-10-04 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77822

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #14 from ktkachov at gcc dot gnu.org ---
I'll have a look

[Bug target/77822] [6/7 Regression] arm64 Error: immediate value out of range 0 to 63 at operand 3

2016-10-04 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77822

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||assemble-failure
 Status|WAITING |NEW
   Last reconfirmed|2016-10-03 00:00:00 |2016-10-4
  Known to work||5.4.1
   Target Milestone|--- |6.3
Summary|[6 REGRESSION] arm64 Error: |[6/7 Regression] arm64
   |immediate value out of  |Error: immediate value out
   |range 0 to 63 at operand 3  |of range 0 to 63 at operand
   ||3
  Known to fail||6.2.1, 7.0

--- Comment #13 from ktkachov at gcc dot gnu.org ---
Thanks for that. Reproduced and confirmed