This is the mail archive of the gcc@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]

Re: -fssa-dce fails on HAVE_cc0 port?


  In message <200107021628.MAA03486@iron.>you write:
  > 
  > It looks like we're deleting CC0 setters in the SSA passes.  This
  > results in the compiler crashing in cse when fold_rtx stumbles over
  > the fact that nobody set the cc0 value that's being tested for a
  > conditional branch.
  > 
  > If this is news to the SSA developers, I can see about providing a test
  > case.
Yes.  I ran into this some time ago.

Fundamentally, I do not think exposing HAVE_cc0 nonsense to the ssa-dce
code is wise.

In the lowering scheme I'm preparing to propose comparison/branch insns
are kept in a higher level, simpler form through the SSA optimizers, then
lowered (along with other things) to more closely match the target
capabilities after the SSA optimizers are complete.

The simpler form for compare/branch insns right now has one of two
forms:

(set (pc) (if_then_else (comparison_operator (op0) (op1))))

or

(set (pseudo) (comparison_operator (op0) (op1)))
(set (pc) (if_then_else (eq/ne (pseudo) (const_int 0))))

Where op0 & op1 will accept any register or immediate constant.  I
originally was thinking that we'd only have the first form, but the 
second form works just as well and doesn't introduce any weirdness
in the SSA optimizers.
 
In the HAVE_cc0 proof of concept port I've got here, there's a splitter in
the md file which takes the generic form and lowers it to the target
specific form.    We're looking to have the lowering happen in mostly
automatic fashion.

For IA64, we use the second form.


  >   -Os -fssa -fssa-dce
  > 
  > to the port I'm doing.  I don't know if this will cause any released
  > ports to crash or not.
It would definitely cause released ports to crash.  But as the docs say,
-fssa and -f[ssa]-dce are experimental.  Use them at your own risk :-)


jeff



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