[PATCH, V3, #7 of 10], Implement PCREL_OPT relocation optimization

Segher Boessenkool segher@kernel.crashing.org
Mon Sep 9 20:56:00 GMT 2019


On Mon, Sep 09, 2019 at 04:32:39PM -0400, Michael Meissner wrote:
> On Fri, Sep 06, 2019 at 07:09:45AM -0500, Segher Boessenkool wrote:
> > On Wed, Sep 04, 2019 at 01:26:27PM -0400, Michael Meissner wrote:
> > 
> > [snip]
> > 
> > > So to keep other passes from 'improving' things, I opted to do the pass as the
> > > last pass before final.
> > 
> > If the problem is that you do not properly analyse dependencies between
> > insns, well, fix that?
> > 
> > If this really needs to be done after everything else GCC does, that is
> > problematic.  What when you have two or more passes with that property?
> > 
> > If this really needs to be done after everything else GCC does, does it
> > belong in the compiler at all?  Should the assembler do it instead, or
> > the linker?
> 
> No, with the definition of the PCREL_OPT there can be only one reference.

I don't see why you think that argues for having to do it last?

> Yeah, there might be other ways to do it, but fundamentally you need to do this
> as late as possible and prevent any other optimizations from messing things up.

That is true for *everything*.


You haven't addressed the "if it should be after everything the compiler
does, does this belong in the compiler at all" question.


Segher



More information about the Gcc-patches mailing list