This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/42438] [4.4/4.5 Regression] Fix for PR38819 is too conservative
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jan 2010 22:08:41 -0000
- Subject: [Bug tree-optimization/42438] [4.4/4.5 Regression] Fix for PR38819 is too conservative
- References: <bug-42438-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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