[Bug tree-optimization/60115] [4.8/4.9 Regression] wrong code at -O3 on x86_64-linux-gnu

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 10 11:05:00 GMT 2014


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

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue is that tree_could_trap_p, while handling

    case ARRAY_REF:
      base = TREE_OPERAND (expr, 0);
      if (tree_could_trap_p (base))
        return true;
      if (TREE_THIS_NOTRAP (expr))
        return false;
      return !in_array_bounds_p (expr);

doesn't handle out-of-bound accesses via MEM_REF at all.

    case MEM_REF:
      if (TREE_CODE (TREE_OPERAND (expr, 0)) == ADDR_EXPR)
        return false;

I have a fix.



More information about the Gcc-bugs mailing list