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]

Re: RFA: Make compare_and_jump_seq check that it has a jump insn


On 06/23/2010 07:16 PM, Jeff Law wrote:
On 06/23/10 10:49, Eric Botcazou wrote:
The problem is that compare_and_jump_seq was then using the
JUMP_LABEL macro on an insn that was not a jump, and in the
process corrupting a completely unrelated insn. (It took me a
*long* time to track down exactly where this corruption was
occurring...).

Configuring with RTL checking (--enable-checking=yes,rtl) would presumably have revealed the problem immediately.

But isn't RTL checking still extremely expensive?

It is expensive indeed, but it is still worthwhile giving it a shot when something looks like memory corruption.

I think it's absolutely not a problem for do_compare_rtx_and_jump to
return something not ending with a label, for example a jump if greater or equal could be realized like this on a machine that has UNGE but lacks GE:


     cc=compare(r1,r2)
     jump if unordered to L2
     jump if unge to L1
  L2:

I think compare_and_jump_seq is just trying to do some poor-man jump-to-jump optimization. If the last insn is not a jump, it should work just as well to not adjust the label.

The problem is that in this case setting the REG_BR_PROB note will be not quite as easy as compare_and_jump_seq tries to put it.

Paolo


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