This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: Fix bug preventing some LICM in PRE
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 16 Jan 2005 19:44:34 -0500 (EST)
- Subject: [PATCH]: Fix bug preventing some LICM in PRE
Steven Bosscher noticed a bug related to PRE where we were marking uses in
conditionals (and other types of don't care statements) as
generating things in the TMP_GEN set.
This is not correct, only DEFs go in TMP_GEN.
This genreally showed up as our inability to perform loop invariant motion
on some things when there were conditionals with them as part of loop
tests, etc.
Fix + testcase attached.
The vect.exp change is because this patch will cause vect-8[6-8].c to fail
due to the particular code it wants to see vectorized (k = i + n in the
below example)
for (i = 0; i < n; i++)
{
for (j = 0; j < n; j++)
{
k = i + n;
a[j] = k;
}
b[i] = k;
}
is completely loop invariant out of both loops, and the fixed PRE will
happily move it.
I've simply added -fno-tree-pre to the default flags for the vectorizer
tests for now, since this is supposed to be testing vectorization, not
general optimization. This will let vectorizer people test that we
vectorize whatever they like.
It has been bootstrapped and regtestested on x86_64, ia64-linux, and
i686-pc-linux-gnu, with no regressions (thanks to steven for submitting
it to SuSE's autotesters).
Committed to mainline.
--Dan
Attachment:
cleandiff.diff
Description: Text document