r266775 - /branches/ssa-range/gcc/range.c

aldyh@gcc.gnu.org aldyh@gcc.gnu.org
Tue Dec 4 12:54:00 GMT 2018


Author: aldyh
Date: Tue Dec  4 12:54:05 2018
New Revision: 266775

URL: https://gcc.gnu.org/viewcvs?rev=266775&root=gcc&view=rev
Log:
Fix casting of bool to 1-bit signed.  Special casing is needed in
operator_cast::fold_range().

The testcase is the following, with a breakpoint in fold_range:

struct S { int s : 1; };
int a;

void
foo (int x, int y)
{
  struct S s;
  s.s = !!y;
  while (1)
    {
      unsigned l = 94967295;
      a = x || (s.s &= l);
    }
}

Modified:
    branches/ssa-range/gcc/range.c



More information about the Gcc-cvs mailing list