This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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: Exception causing insns in delay slots


 In message <200204262003.g3QK3Xrp004014@hiauly1.hia.nrc.ca>, "John David 
Anglin" writes:
 > One of the optimizations that was disabled in the hppa-linux dw2
 > implementation was the return pointer adjustment for unconditional
 > branches in the delay slot of a call sequence.  In this optimization,
 > the return pointer is adjusted to effect the branch when the return
 > occurs.  This causes the loss of the location of the throw.
 > 
 > I must admit that I find it strange that the compiler puts these
 > insns into the delay slot at all.  In all other cases, the delay
 > slot insn executes before the branch is actually taken.  This seems
 > inconsistent.
It's not inconsistent.

The branch executes before its delay slot -- only the side effect of changing
flow control happens after the delay slot.  All other effects such as
generation of the return address into the return register occur _before_ the
delay slot instruction.

It's a very important distinction and it's key to understanding why things
like modifying a return pointer in the delay slot of a call instruction to
eliminate an unconditional branch after the call work.

It's also an important distinction when dealing with branches that have
other side effects such as movb, addb.

jeff

ps.  The trick of modifying the return value in a delay slot of a call is an
interesting optimization, but is not generally useful on targets which have a
call/return stack for predicting branches.  This is why we disable it anytime
we're optimizing for a PA8000 or newer machine.



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