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

--- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so the "optimization" is needed on the DEF side as

extern void __attribute__((noreturn)) abort (void);

int foo (int flag, int val)
{
  int tem;
  if (flag)
    {
      if (val == 0)
        abort ();
      tem = val;
    }
  /* large - prevent jump threading */
  __asm__ volatile ("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  if (flag)
    return tem;
  return 0;
}

shows (I'll add that testcase).  Otherwise we pick up

        ((NOT (val_5(D) == 0)) AND (flag_3(D) != 0))

as the condition on which 'tem' is well-defined and the guard of the use is
just

        ((flag_3(D) != 0))

Reply via email to