This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch, avr] Relax LDS/STS to IN/OUT if symbol is in I/O address range
- From: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- To: Denis Chertykov <chertykov at gmail dot com>
- Cc: Georg-Johann Lay <avr at gjlay dot de>, "binutils at sourceware dot org" <binutils at sourceware dot org>, Nick Clifton <nickc at redhat dot com>
- Date: Fri, 10 Oct 2014 10:04:48 +0530
- Subject: Re: [Patch, avr] Relax LDS/STS to IN/OUT if symbol is in I/O address range
- Authentication-results: sourceware.org; auth=none
- References: <20140929104545 dot GA984 at atmel dot com> <CADOs=zaSvw-8Lpg5Te1v0YE19KBh6uN8udCpsNAWuvfpL7YHbA at mail dot gmail dot com> <20140930021023 dot GA14314 at atmel dot com> <5431C74C dot 5030500 at gjlay dot de> <20141006042945 dot GA1261 at atmel dot com> <20141009103449 dot GF3842 at atmel dot com> <CADOs=zbn053kb85j7GxSAVpbyGJcjRTwF5x70H0zhFrb=UrXhw at mail dot gmail dot com>
On Thu, Oct 09, 2014 at 06:26:06PM +0400, Denis Chertykov wrote:
> 2014-10-09 14:34 GMT+04:00 Senthil Kumar Selvaraj
> <senthil_kumar.selvaraj@atmel.com>:
> > That worked, and I've sent a patch to the avr-libc mailing list.
> >
> > That said, this patch will still help if the address read from/written
> > to is not a compile time constant and happens to fall in IO address
> > range (extern variables, library code etc..).
> >
> > According to the binutils documentation
> > (https://sourceware.org/binutils/docs/ld/M68HC11_002f68HC12.html#M68HC11_002f68HC12)
> > the linker even transforms addressing modes. This patch does something
> > similar.
>
> 1. M68HC1x is not a one of the most popular GCC target. (It's not a
> good example to follow)
Oh ok, didn't know that.
> 2. You poin to a place where the linker change one jump instruction to
> another. IMHO it's predictable from the linker.
The AVR linker also performs tail call optimization (call,ret -> jmp)
> 3. Your patch change loading/storing from memory to input/output -
> it's not so predictable from the linker.
Hmm, IMO, it fits with the intent behind --relax
"On some platforms the `--relax' option performs target specific, global
optimizations that become possible when the linker resolves addressing
in the program, such as relaxing address modes, synthesizing new
instructions, selecting shorter version of current instructions, and
combining constant values."
> 4. I worry only on compatibility issues.
Ok.
> 5. It's not a strong objection.
> 6. Look at this (already approved) patch:
> https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00683.html
Yes, that helps if the user explicitly specifies the attribute on the
declaration.
> 6. If somebody else will vote for your patch then it will be approved.
Ok :)
Regards
Senthil