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 :)