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]

RE: [patch] inc/dec improvement on H8/300 and H8/S (revised)


Hi Jeff,

> Also note however, that not setting the cc bits can be 
> useful.  Consider if
> we had something like
> 
> 1 (set (reg X) (and (reg Y) (reg Z)))
> 2 (set (reg A) (plus (reg A) (const_int ))
> 3 (set (cc0) (reg X)))
> 
> If insn #2 was implemented with inc/dec instead of adds/subs 
> we wouldn't
> be able to eliminate the test at insn #3.
> 
> I have no idea which of the two scenarios is more common.

Actually, I have thought about that. I found the following in gcc's manual
under "Machine Descriptions/Defining Jump Instruction Patterns", but I don't
know what they mean by "until the end." The end of compilation? Until the
peephole?

"The reason you can do this is that GNU CC always generates a pair of
consecutive RTL insns, possibly separated by note insns, one to set the
condition code and one to test it, and keeps the pair inviolate until the
end."

Thanks,

Kazu Hirata

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