public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/56470] New: [4.8 Regression] ICE output_operand: invalid shift operand
@ 2013-02-27  9:40 jakub at gcc dot gnu.org
  2013-03-04  7:01 ` [Bug target/56470] " rearnsha at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-27  9:40 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56470
           Summary: [4.8 Regression] ICE output_operand: invalid shift
                    operand
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
            Target: arm


int w[5];

void
foo (int x, unsigned y)
{
  long long r = 0;
  long long s;
  int i;
  switch (x)
    {
    case 1:
      for (i = 0; i < 4; i++)
        {
          if (!y)
            s = (w[9] << (10 - 2 * i)) >> (32 - 5 * i + 5 * i);
          r |= (s & 0xffffffff) << (i * 5);
        }
      break;
    case 3:
      r = w[x] >> y;
    }
  w[x] = r;
}

ICEs at -O2 on arm-linux-gnuabi.  This reduced testcase ICEs also in 4.7, but
the unreduced one at https://bugzilla.redhat.com/show_bug.cgi?id=915830#c1
only ICEs in 4.8 and not in 4.7.
I wonder why arm backend uses constraints (N) to enfore the shift count in the
range, rather than e.g. masking the operand & 31 if CONST_INT before printing.
Shift counts >= 32 for SImode are of course undefined behavior, so it really
doesn't matter what gets emitted, but we shouldn't ICE on it.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-03-18 11:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-27  9:40 [Bug target/56470] New: [4.8 Regression] ICE output_operand: invalid shift operand jakub at gcc dot gnu.org
2013-03-04  7:01 ` [Bug target/56470] " rearnsha at gcc dot gnu.org
2013-03-04  8:18 ` jakub at gcc dot gnu.org
2013-03-05  7:02 ` rearnsha at gcc dot gnu.org
2013-03-05  9:15 ` jakub at gcc dot gnu.org
2013-03-06 10:27 ` rearnsha at gcc dot gnu.org
2013-03-08 15:46 ` [Bug target/56470] [4.7/4.8 " rguenth at gcc dot gnu.org
2013-03-11 11:49 ` rearnsha at gcc dot gnu.org
2013-03-11 14:38 ` [Bug target/56470] [4.7 " rearnsha at gcc dot gnu.org
2013-03-18 11:52 ` rearnsha at gcc dot gnu.org
2013-03-18 11:54 ` rearnsha at gcc dot gnu.org

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).