BackupGGCode / propgcc

GCC for the Parallax Propeller Microcontroller
Other
0 stars 0 forks source link

immediate constants not loaded properly in -mcog mode #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The code

long long foo() { return 0x123456789abcdef0; }

produces the following assembly under options -mcog -Os:

    .text
    .balign 4
    .global _foo
_foo
    mov r0, .LC0
    rdlong  r1, .LC1
    jmp lr
    .balign 4
.LC0
    long    -1698898192
    long    305419896
    .balign 4
.LC1
    long    .LC0+4

The rdlong is incorrect; it should be "mov r1, .LC0+4".

Original issue reported on code.google.com by ersm...@hfx.eastlink.ca on 13 Jun 2012 at 12:39

GoogleCodeExporter commented 9 years ago
Fix checked in: now the compiler understands that if .LC0 is a COG address then 
so is .LC0+4, so it doesn't try to do the indirect load via .LC1.

Original comment by ersm...@hfx.eastlink.ca on 13 Jun 2012 at 4:46