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]
Other format: [Raw text]

Re: Fixing jumps reachability after block reordering


Gregory B. Prokopski wrote:
I reorder the basic blocks in passes.c, right after compute_alignmnets ().
I added a call to shorten_branches(NULL_RTX) right after my BB reordering,
but it didn't change a thing, and I am still getting as errors:

shorten_branches does this:
/* Compute initial lengths, addresses, and varying flags for each insn. */
for (insn_current_address = 0, insn = first;
insn != 0;
insn_current_address += insn_lengths[uid], insn = NEXT_INSN (insn))
{ ... }


where FIRST is the argument, which means that shorten_branches(NULL_RTX) will do nothing, which is exactly what you discovered. Try calling it correctly with a start instruction. If you grep for it, you will see that the main call to it is
shorten_branches (get_insns ());
which runs it on the entire function. This is probably what you want.
--
Jim Wilson, GNU Tools Support, http://www.specifix.com



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