This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/53385] "Error: operand out of range" after changes for LSHIFT_EXPR in vrp.c


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

--- Comment #4 from Alan Modra <amodra at gmail dot com> 2012-05-17 12:25:03 UTC ---
Here's the problem.  Compiled with -m64 -O2, this

int f (long val)
{
  int i;

  if (val < 0)
    i = -1;
  else
    for (i = 0; i < 64; i++)
      if ((val <<= 1) < 0)
        break;

  return i;
}

is miscompiled to

         sradi 3,3,63
        ori 3,3,64
        blr


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]