This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix IA-64 recip approx cse bug


This fixes PR 35695.  There is a divide inside a loop.  The loop is
partly unrolled at the tree-ssa level.  We then emit RTL expanding
divides as sequences using the reciprocal approximation instruction.
Then the loop gets completely unrolled at the RTL level.  The cse2 pass
then sees that we have FP constants as inputs to the recip approx
sequence, and tries to simplify it, getting the wrong result.

The main problem here is that the recip approx insn uses DIV for the
result, which confuses CSE into thinking that we have an actual divide
result when we don't.  Changing the recip approx pattern to use UNSPEC
instead of DIV solves the problem.

This was tested by Andreas Schwab.
    http://gcc.gnu.org/ml/gcc-testresults/2008-03/msg02106.html

I have checked in the patch.

Jim

Attachment: patch.recip.approx
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]