[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] Strange asm output
From: |
Nicolas Schodet |
Subject: |
Re: [avr-libc-dev] Strange asm output |
Date: |
Thu, 11 Nov 2004 20:38:16 +0100 |
User-agent: |
Mutt/1.5.6+20040722i |
* Paul Schlie <address@hidden> [041111 18:14]:
> Might someone with a GCC 3.3.x (preferably 3.3.4) avr compiler try:
> [...]
Here is the listing with avr-gcc (GCC) 3.3.1:
1 .file "main.c"
2 .arch atmega64
3 __SREG__ = 0x3f
4 __SP_H__ = 0x3e
5 __SP_L__ = 0x3d
6 __tmp_reg__ = 0
7 __zero_reg__ = 1
8 .global __do_copy_data
9 .global __do_clear_bss
12 .text
13 .Ltext0:
38 .global foo0
40 foo0:
1:main.c **** /*Compiling: main.c using (for the sake of argument)
2:main.c ****
3:main.c **** avr-gcc -c -mmcu=atmega64 -I. -g -Os -funsigned-char
-funsigned-bitfields
4:main.c **** -fpack-struct
5:main.c **** -fshort-enums -Wall -Wstrict-prototypes
-Wa,-adhlns=main.lst
6:main.c **** -I/usr/local/avr/include
7:main.c **** -std=gnu99 -funsafe-math-optimizations
8:main.c **** -Wp,-M,-MP,-MT,main.o,-MF,.dep/main.o.d main.c
9:main.c **** -o main.o
10:main.c ****
11:main.c **** Linking: main.elf (again for the sake of argumnet)
12:main.c **** avr-gcc -mmcu=atmega64 -I. -g -Os -funsigned-char
-funsigned-bitfields
13:main.c **** -fpack-struct
14:main.c **** -fshort-enums -Wall -Wstrict-prototypes
-Wa,-adhlns=main.o
15:main.c **** -I/usr/local/avr/include
16:main.c **** -std=gnu99 -funsafe-math-optimizations
17:main.c **** -Wp,-M,-MP,-MT,main.o,-MF,.dep/main.elf.d main.o
18:main.c **** --output main.elf -Wl,-Map=main.map,--cref -lm
19:main.c ****
20:main.c **** File: main.c
21:main.c ****
22:main.c **** */
23:main.c ****
24:main.c **** int foo0 ( int a ){
42 .LM1:
43 /* prologue: frame size=0 */
44 /* prologue end (size=0) */
25:main.c ****
26:main.c **** if (a & 0x800000L)
46 .LM2:
47 0000 AA27 clr r26
48 0002 97FD sbrc r25,7
49 0004 A095 com r26
50 0006 BA2F mov r27,r26
51 0008 A7FF sbrs r26,7
52 000a 03C0 rjmp .L2
27:main.c **** return 1;
54 .LM3:
55 000c 81E0 ldi r24,lo8(1)
56 000e 90E0 ldi r25,hi8(1)
28:main.c **** else
29:main.c **** return 2 ;
30:main.c ****
31:main.c **** }
58 .LM4:
59 0010 0895 ret
60 .L2:
62 .LM5:
63 0012 82E0 ldi r24,lo8(2)
64 0014 90E0 ldi r25,hi8(2)
66 .LM6:
67 0016 0895 ret
68 /* epilogue: frame size=0 */
69 0018 0895 ret
70 /* epilogue end (size=1) */
71 /* function foo0 size 13 (12) */
73 .Lscope0:
77 .global foo1
79 foo1:
32:main.c ****
33:main.c **** int foo1 ( int a ){
81 .LM7:
82 /* prologue: frame size=0 */
83 /* prologue end (size=0) */
34:main.c ****
35:main.c **** if (a & (1L << 23))
85 .LM8:
86 001a AA27 clr r26
87 001c 97FD sbrc r25,7
88 001e A095 com r26
89 0020 BA2F mov r27,r26
90 0022 A7FF sbrs r26,7
91 0024 03C0 rjmp .L5
36:main.c **** return 1;
93 .LM9:
94 0026 81E0 ldi r24,lo8(1)
95 0028 90E0 ldi r25,hi8(1)
37:main.c **** else
38:main.c **** return 2 ;
39:main.c ****
40:main.c **** }
97 .LM10:
98 002a 0895 ret
99 .L5:
101 .LM11:
102 002c 82E0 ldi r24,lo8(2)
103 002e 90E0 ldi r25,hi8(2)
105 .LM12:
106 0030 0895 ret
107 /* epilogue: frame size=0 */
108 0032 0895 ret
109 /* epilogue end (size=1) */
110 /* function foo1 size 13 (12) */
112 .Lscope1:
116 .global foo2
118 foo2:
41:main.c ****
42:main.c **** int foo2 ( long a ){
120 .LM13:
121 /* prologue: frame size=0 */
122 /* prologue end (size=0) */
123 0034 DC01 movw r26,r24
124 0036 CB01 movw r24,r22
43:main.c ****
44:main.c **** if (a & 0x800000L)
126 .LM14:
127 0038 A7FF sbrs r26,7
128 003a 03C0 rjmp .L8
45:main.c **** return 1;
130 .LM15:
131 003c 81E0 ldi r24,lo8(1)
132 003e 90E0 ldi r25,hi8(1)
46:main.c **** else
47:main.c **** return 2 ;
48:main.c ****
49:main.c **** }
134 .LM16:
135 0040 0895 ret
136 .L8:
138 .LM17:
139 0042 82E0 ldi r24,lo8(2)
140 0044 90E0 ldi r25,hi8(2)
142 .LM18:
143 0046 0895 ret
144 /* epilogue: frame size=0 */
145 0048 0895 ret
146 /* epilogue end (size=1) */
147 /* function foo2 size 11 (10) */
149 .Lscope2:
153 .global foo3
155 foo3:
50:main.c ****
51:main.c **** int foo3 ( long a ){
157 .LM19:
158 /* prologue: frame size=0 */
159 /* prologue end (size=0) */
160 004a DC01 movw r26,r24
161 004c CB01 movw r24,r22
52:main.c ****
53:main.c **** if (a & (1L << 23))
163 .LM20:
164 004e A7FF sbrs r26,7
165 0050 03C0 rjmp .L11
54:main.c **** return 1;
167 .LM21:
168 0052 81E0 ldi r24,lo8(1)
169 0054 90E0 ldi r25,hi8(1)
55:main.c **** else
56:main.c **** return 2 ;
57:main.c ****
58:main.c **** }
171 .LM22:
172 0056 0895 ret
173 .L11:
175 .LM23:
176 0058 82E0 ldi r24,lo8(2)
177 005a 90E0 ldi r25,hi8(2)
179 .LM24:
180 005c 0895 ret
181 /* epilogue: frame size=0 */
182 005e 0895 ret
183 /* epilogue end (size=1) */
184 /* function foo3 size 11 (10) */
186 .Lscope3:
189 .global main
191 main:
59:main.c ****
60:main.c **** int main( void ){
193 .LM25:
194 /* prologue: frame size=2 */
195 0060 C0E0 ldi r28,lo8(__stack - 2)
196 0062 D0E0 ldi r29,hi8(__stack - 2)
197 0064 DEBF out __SP_H__,r29
198 0066 CDBF out __SP_L__,r28
199 /* prologue end (size=4) */
61:main.c ****
62:main.c **** volatile int a;
63:main.c ****
64:main.c **** a = foo0 ( a );
201 .LM26:
202 .LBB2:
203 0068 8981 ldd r24,Y+1
204 006a 9A81 ldd r25,Y+2
205 006c 0E94 0000 call foo0
206 0070 8983 std Y+1,r24
207 0072 9A83 std Y+2,r25
65:main.c **** a = foo1 ( a );
209 .LM27:
210 0074 8981 ldd r24,Y+1
211 0076 9A81 ldd r25,Y+2
212 0078 0E94 0000 call foo1
213 007c 8983 std Y+1,r24
214 007e 9A83 std Y+2,r25
66:main.c **** a = foo2 ( a );
216 .LM28:
217 0080 8981 ldd r24,Y+1
218 0082 9A81 ldd r25,Y+2
219 0084 AA27 clr r26
220 0086 97FD sbrc r25,7
221 0088 A095 com r26
222 008a BA2F mov r27,r26
223 008c BC01 movw r22,r24
224 008e CD01 movw r24,r26
225 0090 0E94 0000 call foo2
226 0094 8983 std Y+1,r24
227 0096 9A83 std Y+2,r25
67:main.c **** a = foo3 ( a );
229 .LM29:
230 0098 8981 ldd r24,Y+1
231 009a 9A81 ldd r25,Y+2
232 009c AA27 clr r26
233 009e 97FD sbrc r25,7
234 00a0 A095 com r26
235 00a2 BA2F mov r27,r26
236 00a4 BC01 movw r22,r24
237 00a6 CD01 movw r24,r26
238 00a8 0E94 0000 call foo3
239 00ac 8983 std Y+1,r24
240 00ae 9A83 std Y+2,r25
68:main.c ****
69:main.c **** return 0;
70:main.c **** }
242 .LM30:
243 .LBE2:
244 00b0 80E0 ldi r24,lo8(0)
245 00b2 90E0 ldi r25,hi8(0)
246 /* epilogue: frame size=2 */
247 00b4 0C94 0000 jmp exit
248 /* epilogue end (size=2) */
249 /* function main size 44 (38) */
254 .Lscope4:
256 .text
258 Letext:
259 /* File "main.c": code 92 = 0x005c ( 82), prologues
4, epilogues 6 */
DEFINED SYMBOLS
*ABS*:00000000 main.c
*ABS*:0000003f __SREG__
*ABS*:0000003e __SP_H__
*ABS*:0000003d __SP_L__
*ABS*:00000000 __tmp_reg__
*ABS*:00000001 __zero_reg__
/tmp/ccS6dcXA.s:40 .text:00000000 foo0
/tmp/ccS6dcXA.s:79 .text:0000001a foo1
/tmp/ccS6dcXA.s:118 .text:00000034 foo2
/tmp/ccS6dcXA.s:155 .text:0000004a foo3
/tmp/ccS6dcXA.s:191 .text:00000060 main
/tmp/ccS6dcXA.s:258 .text:000000b8 Letext
UNDEFINED SYMBOLS
__do_copy_data
__do_clear_bss
__stack
exit
/Nicolas
- [avr-libc-dev] Strange asm output, Nicolas Schodet, 2004/11/09
- Re: [avr-libc-dev] Strange asm output, Dmitry K., 2004/11/10
- Re: [avr-libc-dev] Strange asm output, Nicolas Schodet, 2004/11/10
- Re: [avr-libc-dev] Strange asm output, Dmitry K., 2004/11/10
- Re: [avr-libc-dev] Strange asm output, Paul Schlie, 2004/11/10
- Re: [avr-libc-dev] Strange asm output, Paul Schlie, 2004/11/11
- Re: [avr-libc-dev] Strange asm output,
Nicolas Schodet <=
- Re: [avr-libc-dev] Strange asm output, Paul Schlie, 2004/11/11
- [avr-libc-dev] soliciting feedback/thoughts on potential value of a few gcc 4.0 tweaks., Paul Schlie, 2004/11/19
- Re: [avr-libc-dev] soliciting feedback/thoughts on potential value of a few gcc 4.0 tweaks., Theodore A. Roth, 2004/11/19
- Re: [avr-libc-dev] soliciting feedback/thoughts on potential value of a few gcc 4.0 tweaks., Paul Schlie, 2004/11/20
- Re: [avr-libc-dev] soliciting feedback/thoughts on potential value of a few gcc 4.0 tweaks., Bob Paddock, 2004/11/19
- Re: [avr-libc-dev] soliciting feedback/thoughts on potential value of a few gcc 4.0 tweaks., Paul Schlie, 2004/11/20
- Re: [avr-libc-dev] soliciting feedback/thoughts on potential value of a few gcc 4.0 tweaks., Dmitry K., 2004/11/19
- Re: [avr-libc-dev] soliciting feedback/thoughts on potential value of a few gcc 4.0 tweaks., Paul Schlie, 2004/11/20
- Re: [avr-libc-dev] soliciting feedback/thoughts on potential value of a few gcc 4.0 tweaks., Geoffrey Wossum, 2004/11/22
- Re: [avr-libc-dev] soliciting feedback/thoughts on potential value of a few gcc 4.0 tweaks., Paul Schlie, 2004/11/22