Using -save-temps results in different code
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linaro GCC |
Fix Released
|
Low
|
Chung-Lin Tang | ||
gcc |
Fix Released
|
Medium
|
Bug Description
The attached example code produces different result when compiled with -save-temps than without.
I tested this with the gcc-4.5-
This is the result with (linaro 2010.11 release):
$ arm-none-
$ arm-none-
mytest-notemps.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <optimized>:
0: e92d4800 push {fp, lr}
4: e28db004 add fp, sp, #4
8: e1a00000 nop ; (mov r0, r0)
c: e8bd8800 pop {fp, pc}
...
$ arm-none-
$ arm-none-
mytest-savetemps.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <optimized>:
0: e59f3020 ldr r3, [pc, #32] ; 28 <optimized+0x28>
4: e92d4800 push {fp, lr}
8: e28db004 add fp, sp, #4
c: e5933000 ldr r3, [r3]
10: e3130001 tst r3, #1
14: 0a000001 beq 20 <optimized+0x20>
18: e1a00000 nop ; (mov r0, r0)
1c: e8bd8800 pop {fp, pc}
20: e1a00000 nop ; (mov r0, r0)
24: e8bd8800 pop {fp, pc}
28: 00000000 .word 0x00000000
...
This gcc bug might be relevant: http://
Related branches
- Linaro Toolchain Developers: Pending requested
-
Diff: 155 lines (+106/-3)5 files modifiedChangeLog.linaro (+18/-0)
gcc/jump.c (+7/-1)
gcc/rtl.c (+18/-2)
gcc/testsuite/gcc.target/i386/pr46865-1.c (+31/-0)
gcc/testsuite/gcc.target/i386/pr46865-2.c (+32/-0)
Changed in gcc: | |
importance: | Undecided → Unknown |
status: | New → Unknown |
Changed in gcc-linaro: | |
assignee: | nobody → Chung-Lin Tang (cltang) |
status: | Triaged → In Progress |
Changed in gcc-linaro: | |
milestone: | none → 4.5-2011.01-0 |
status: | In Progress → Fix Committed |
Changed in gcc-linaro: | |
status: | Fix Committed → Fix Released |
Changed in gcc: | |
importance: | Unknown → Medium |
status: | Unknown → In Progress |
Changed in gcc: | |
status: | In Progress → Fix Released |
Confirmed in gcc-linaro- 2010.11- 1 and upstream gcc 4.5.1.
Note that the example and particular usage are very unusual. The summary from the upstream bug is that you can get different results from multi-line #defines depending if you preprocess or not.