[Bug tree-optimization/82433] New: IPA-VRP not handling tcc_binary with constant argument

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 5 08:42:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82433

            Bug ID: 82433
           Summary: IPA-VRP not handling tcc_binary with constant argument
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

On -O2 -fdump-{tree,ipa}-all-alias -fno-inline:

volatile int z, w;

static int
foo (int x, int y)
{
  z = x + 1;
  w = y + 1;
  return x + y;
}

static int
bar (int x, int y)
{
  return foo (x + 1, y + 1) + 1;
}

int
baz (int x, int y)
{
  return bar (x & 4095, y & 4095) + bar (x & 255, y & 255);
}

IPA-CP seems to figure out that foo's arguments have non-zero bits 8191, but
doesn't figure out their range is [1, 4096].  Seems we only handle tcc_unary,
not tcc_binary with constant argument for IPA-VRP, but somehow do handle it for 
the alignment/nonzero-bits propagation.


More information about the Gcc-bugs mailing list