[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Mega 128 not optimising correctly ...
From: |
E. Weddington |
Subject: |
Re: [avr-gcc-list] Mega 128 not optimising correctly ... |
Date: |
Mon, 11 Nov 2002 09:40:50 -0700 |
On 11 Nov 2002 at 10:14, Rob Ward wrote:
> Hi Eric and others. I have used your suggestion below, but in some
> cases it does not compile as you have suggested. For example...
>
> #define SetClockHigh() (PORTD |= 0x80) // set clock line high
> #define SetClockLow() (PORTD &= ~0x80) // set clock line low
>
> SetClockHigh(); // set clock line hi
> 5e: 97 9a sbi 0x12, 7 ; 18
> SetClockLow(); // set clock line low
> 60: 82 b3 in r24, 0x12 ; 18
> 62: 83 23 and r24, r19
> 64: 82 bb out 0x12, r24 ; 18
>
> This is using -O2 or -O3 optimisation. However if I change to -Os I
> get a mixture in various places...
>
> SetClockHigh(); // set clock line hi
> b0: 97 9a sbi 0x12, 7 ; 18
> SetClockLow(); // set clock line low
> b2: 3f e7 ldi r19, 0x7F ; 127
> b4: 82 b3 in r24, 0x12 ; 18
> b6: 83 23 and r24, r19
> b8: 82 bb out 0x12, r24 ; 18
>
> and also...
>
> SetClockHigh(); // set clock line hi
> 84: 97 9a sbi 0x12, 7 ; 18
> SetClockLow(); // set clock line low
> 86: 97 98 cbi 0x12, 7 ; 18
>
> Is this something that could be improved or am I missing something?
>
> TIA.
>
> Rob
The version of GCC that I use is 3.2 experimental, from the latest
AVRFreaks distribution. For compiler flags I use -Os as well as
-std=gnu99. Does yours match, what do you use?
Let me know,
Thanks.
Eric
avr-gcc-list at http://avr1.org
- [avr-gcc-list] Mega 128 not optimising correctly ..., Rob Ward, 2002/11/03
- Re: [avr-gcc-list] Mega 128 not optimising correctly ..., E. Weddington, 2002/11/03
- Re: [avr-gcc-list] Mega 128 not optimising correctly ..., Rob Ward, 2002/11/15
- [avr-gcc-list] Anybody perhaps solved these JTAGICE in AVR STUDIO4 problems??, Marc Wetzel, 2002/11/15
- Re: [avr-gcc-list] Mega 128 not optimising correctly ...,
E. Weddington <=
- Re: [avr-gcc-list] Mega 128 not optimising correctly ..., Rob Ward, 2002/11/15
- Re: [avr-gcc-list] Mega 128 not optimising correctly ..., E. Weddington, 2002/11/15
- Re: [avr-gcc-list] Mega 128 not optimising correctly ..., Rob Ward, 2002/11/15
- Re: [avr-gcc-list] Mega 128 not optimising correctly ..., E. Weddington, 2002/11/15
- Re: [avr-gcc-list] Mega 128 not optimising correctly ..., Theodore A. Roth, 2002/11/15
- Re: [avr-gcc-list] Mega 128 not optimising correctly ..., E. Weddington, 2002/11/15