------- Comment #4 from rguenth at gcc dot gnu dot org  2010-01-02 22:08 -------
With the patch we'll still not optimize

extern void bar (void);
int foo (int i, int j, int b)
{
  int res = 0;

  if (b)
    res = i/j;

  res += i/j;
  bar ();
  return res;
}

That's not so easy to avoid.  We'd need to separately clean ANTIC_OUT
and EXP_GEN[BLOCK] - TMP_GEN[BLOCK], for the latter we can simply avoid
putting trapping expressions into EXP_GEN if a possibly noreturning call
precedes them in their basic-block.

In theory we might not need to clean EXP_GEN[BLOCK] - TMP_GEN[BLOCK] at all(?),
thus only clean S.  Only if we are also careful not adding expressions that
die in their own block to EXP_GEN.


-- 


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

Reply via email to