[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] [RFT] [PATCH] New linker optimizations.
From: |
Björn Haase |
Subject: |
Re: [avr-libc-dev] [RFT] [PATCH] New linker optimizations. |
Date: |
Sun, 16 Oct 2005 13:08:03 +0200 |
User-agent: |
KMail/1.7.1 |
Bernd Trog wrote on Sonntag, 16. Oktober 2005 12:30 :
> On Sun, 16 Oct 2005, Björn Haase wrote:
> Now I get:
>
> ../../src/bfd/elf32-avr.c: In function `elf32_avr_relax_section':
> ../../src/bfd/elf32-avr.c:1269: parse error before `int'
>
> I think my old-fashioned gcc-2.95 doesn't like your
> new C(99?) style. (gcc-4.0.1 works OK here)
The difficulty probably is that I made the mistake to define a new variable
not at the beginning of a {...} block but in the center. Gcc3 does not
complain about this. Changing the code segment such that it reads
/* Shrinking the code size makes the gaps larger in the
case of wrap-arounds. So we use a heuristical safety
margin to avoid that during relax the distance gets
again too large for the short jumps. Let's assume
a typical code-size reduction due to relax for a
16k device of 600 bytes. So let's use twice the
typical value as safety margin. */
int rgap;
int safety_margin;
int assumed_shrink = 600;
if (avr_pc_wrap_around > 0x4000)
assumed_shrink = 900;
safety_margin = 2 * assumed_shrink;
should solve the issue.
Bjoern.