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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
We would certainly need to punt on gimple_could_trap_p assignments, as can be
seen e.g. on
static inline int
foo (int x)
{
  return __builtin_constant_p ((x + 32) / 0);
}

int
bar (void)
{
  return foo (35);
}
with -O2 -fno-early-inlining.
Anyway, I'm actually not sure if it is safe to perform this change at all.
Consider:
int
foo (int x)
{
  if (x < __INT_MAX__ - 30)
    return 23;
  int y = x + 30;
  if (__builtin_constant_p (y))
    return y;
  return 42;
}
with -O2 -fdisable-tree-evrp
y is constant (__INT_MAX__), but x is certainly not constant.

Reply via email to