This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: split_edge, reg-stack and function.c fix
- To: Jan Hubicka <hubicka at atrey dot karlin dot mff dot cuni dot cz>
- Subject: Re: split_edge, reg-stack and function.c fix
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 16 Dec 1999 03:54:36 -0700
- cc: egcs-patches at egcs dot cygnus dot com, rth at cygnus dot com
- Reply-To: law at cygnus dot com
In message <19990705082403.22270@atrey.karlin.mff.cuni.cz>you write:
>
> Hi
> While looking at the asm outputs, I've found following code:
> jne .L11
> jmp .L9
> .L15:
> fxch %st(2)
> .p2align 4,,7
> .L9:
> <loop body>
> cmpb $1,%ah
> je .L15
> .L16:
> .L17:
Unfortunately, you did not provide any testcode, only the results of compiling
testcodes. So we can't track the problem you were trying to solve with this
patch.
> (BTW also note the redundant label L17. Why this happends?
It's normal and nothing to get particularly concerned about. Most commonly
it happens when there is a NOTE of some kind between two CODE_LABELs.
> There are
> few notes between in the .stack dump, but jump IMO ought to remove it or
> not?),
It depends on a number of factors. We actually want to keep those separate
labels until fairly late in the compilation if there's a LOOP note between
them.
Similarly I think we need to keep them if there's a block scope note between
them. Other notes I'm less sure about.
> The problem I am shooting for is that the alignment pseudo is *inside* the
> loop, resulting code is much slower, because it has to eat all those nops
> every iteration.
>
> I it is caused by reg-stack by by coexistence of two problems:
> 1) The LOOP_BEG function is placed incorrectly before the basic block for
> the jmp L9 instruction.
I believe this was fixed by a change I made to split_edge a while back.
> 2) Shorten branches is done before reg-stack so alginment of most branches
> touched by reg-stack is completely wrong.
This sounds like something we should fix. The only thing that should happen
after branch shortening is peepholes and assembly output.
[ ... ]
> I've also attached patch to i386.c in new_ia32_branch to make length
> function happy about this code.
I fixed this a while back too.
>
> Honza
>
> Sun Jul 4 06:01:01 CEST 1999 Jan Hubicka <hubicka@freesoft.cz>
> * flow.c (loops_starting_here): New function.
> (loops_ending_here): New function.
> (end_of_loop): New function.
> (move_loop_beg_notes): New function.
> (split_edge):
This code is no longer needed.
> * toplev.c (rest_of_compilation): Do shorted_branches after regstack.
I've installed this change.
> * function.c (thread_prologue_and_epilogue_insns): Mess up flow info
> in more split_edge friendly way, call commit_edge_insertions before
> this mess is done.
> * i386.c (ix86_attr_length_default): Handle FXCH nicely.
These should no longer be desirable or necessary either.
jeff