On Thu, Mar 31, 2016 at 5:12 AM, fengwei.yin fengwei.yin@linaro.org wrote:
Because gcc 4.9 could build this file without any issue, I apply --save-temps with gcc 4.9. The ii file is attached. Can't see significant differences.
There is a patch in gcc-5 to make unified assembler syntax the default. Unfortunately, it changes how extended asms work, which is perhaps a bug. The message claims it doesn't affect extended asms, but it does. https://gcc.gnu.org/ml/gcc-patches/2015-11/msg01196.html The interesting bit is the change to ASM_APP_OFF.
gcc-4.9 emits a .thumb after the extended asm to switch back into thumb mode just in case. gcc-5.3 instead emits .syntax unified, which doesn't change the arm/thumb mode, just the syntax supported. This is arguably a bug, but this doesn't immediately help you. It could take a little time to get gcc-5.x source fixed, and then the compiler binary releases. Or alternatively we could fix the asm to work with gcc 5.
Jim
Hi Jim,
On 2016/4/1 1:26, Jim Wilson wrote:
On Thu, Mar 31, 2016 at 5:12 AM, fengwei.yin fengwei.yin@linaro.org wrote:
Because gcc 4.9 could build this file without any issue, I apply --save-temps with gcc 4.9. The ii file is attached. Can't see significant differences.
There is a patch in gcc-5 to make unified assembler syntax the default. Unfortunately, it changes how extended asms work, which is perhaps a bug. The message claims it doesn't affect extended asms, but it does. https://gcc.gnu.org/ml/gcc-patches/2015-11/msg01196.html The interesting bit is the change to ASM_APP_OFF.
gcc-4.9 emits a .thumb after the extended asm to switch back into thumb mode just in case. gcc-5.3 instead emits .syntax unified, which doesn't change the arm/thumb mode, just the syntax supported. This is arguably a bug, but this doesn't immediately help you. It could take a little time to get gcc-5.x source fixed, and then the compiler binary releases. Or alternatively we could fix the asm to work with gcc 5.
Thanks a lot for looking at this.
I think fixing asm is the thing we should try here. Removing thumb is not acceptable because we use gcc5.3 for AOSP for memory reduction.
This part of code was from libunwind actually. And it's defined like:
/* There is no getcontext() on ARM. Use a stub version which only saves GP registers. FIXME: Not ideal, may not be sufficient for all libunwind use cases. Stores pc+8, which is only approximately correct, really. */ #ifndef __thumb__ #define unw_tdep_getcontext(uc) (({ \ unw_tdep_context_t *unw_ctx = (uc); \ register unsigned long *unw_base asm ("r0") = unw_ctx->regs; \ __asm__ __volatile__ ( \ "stmia %[base], {r0-r15}" \ : : [base] "r" (unw_base) : "memory"); \ }), 0) #else /* __thumb__ */ #define unw_tdep_getcontext(uc) (({ \ unw_tdep_context_t *unw_ctx = (uc); \ register unsigned long *unw_base asm ("r0") = unw_ctx->regs; \ __asm__ __volatile__ ( \ ".align 2\nbx pc\nnop\n.code 32\n" \ "stmia %[base], {r0-r15}\n" \ "orr %[base], pc, #1\nbx %[base]" \ : [base] "+r" (unw_base) : : "memory", "cc"); \ }), 0) #endif
Remove the __thumb__ part?
Regards Yin, Fengwei
Jim
On Thu, Mar 31, 2016 at 5:04 PM, fengwei.yin fengwei.yin@linaro.org wrote:
Remove the __thumb__ part?
If you remove the __thumb__ part, then you will get an assembler error.
palantir:2025$ arm-linux-gnueabi-as UnwindCurrent.s UnwindCurrent.s: Assembler messages: UnwindCurrent.s:1504: Error: PC not allowed in register list -- `stmia r0,{r0-r15}' palantir:2026$
This instruction is not a valid thumb instruction. It is a valid arm instruction, but deprecated. The assembler gives an error because you are in thumb mode. Since you already have a __thumb__ version of the macro, you can put a ".thumb" directive at the end of the asm, after the orr instruction, to manually switch back into thumb mode.
Jim
On 2016/4/1 9:30, Jim Wilson wrote:
On Thu, Mar 31, 2016 at 5:04 PM, fengwei.yin fengwei.yin@linaro.org wrote:
Remove the __thumb__ part?
If you remove the __thumb__ part, then you will get an assembler error.
palantir:2025$ arm-linux-gnueabi-as UnwindCurrent.s UnwindCurrent.s: Assembler messages: UnwindCurrent.s:1504: Error: PC not allowed in register list -- `stmia r0,{r0-r15}' palantir:2026$
This instruction is not a valid thumb instruction. It is a valid arm instruction, but deprecated. The assembler gives an error because you are in thumb mode. Since you already have a __thumb__ version of the macro, you can put a ".thumb" directive at the end of the asm, after the orr instruction, to manually switch back into thumb mode.
Cool. Thanks a lot. I will try it.
Jim
On 31/03/16 18:26, Jim Wilson wrote:
On Thu, Mar 31, 2016 at 5:12 AM, fengwei.yin fengwei.yin@linaro.org wrote:
Because gcc 4.9 could build this file without any issue, I apply --save-temps with gcc 4.9. The ii file is attached. Can't see significant differences.
There is a patch in gcc-5 to make unified assembler syntax the default. Unfortunately, it changes how extended asms work, which is perhaps a bug. The message claims it doesn't affect extended asms, but it does. https://gcc.gnu.org/ml/gcc-patches/2015-11/msg01196.html The interesting bit is the change to ASM_APP_OFF.
The patch was intended to make unified asm as default for ARM state without having any impact with respect to unified / divided syntax for inline assembler.
The change to remove .arm and .thumb is a thinko and clearly a bug : I'll fix it shortly upstream.
regards Ramana
gcc-4.9 emits a .thumb after the extended asm to switch back into thumb mode just in case. gcc-5.3 instead emits .syntax unified, which doesn't change the arm/thumb mode, just the syntax supported. This is arguably a bug, but this doesn't immediately help you. It could take a little time to get gcc-5.x source fixed, and then the compiler binary releases. Or alternatively we could fix the asm to work with gcc 5.
Jim _______________________________________________ linaro-toolchain mailing list linaro-toolchain@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-toolchain
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
On 31/03/16 18:26, Jim Wilson wrote:
On Thu, Mar 31, 2016 at 5:12 AM, fengwei.yin fengwei.yin@linaro.org wrote:
Because gcc 4.9 could build this file without any issue, I apply --save-temps with gcc 4.9. The ii file is attached. Can't see significant differences.
There is a patch in gcc-5 to make unified assembler syntax the default. Unfortunately, it changes how extended asms work, which is perhaps a bug. The message claims it doesn't affect extended asms, but it does. https://gcc.gnu.org/ml/gcc-patches/2015-11/msg01196.html The interesting bit is the change to ASM_APP_OFF.
This is now https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70496 for FSF trunk.
Sorry about the breakage.
Ramana
gcc-4.9 emits a .thumb after the extended asm to switch back into thumb mode just in case. gcc-5.3 instead emits .syntax unified, which doesn't change the arm/thumb mode, just the syntax supported. This is arguably a bug, but this doesn't immediately help you. It could take a little time to get gcc-5.x source fixed, and then the compiler binary releases. Or alternatively we could fix the asm to work with gcc 5.
Jim _______________________________________________ linaro-toolchain mailing list linaro-toolchain@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-toolchain
On 1 April 2016 at 12:04, Ramana Radhakrishnan ramana.radhakrishnan@arm.com wrote:
On 31/03/16 18:26, Jim Wilson wrote:
On Thu, Mar 31, 2016 at 5:12 AM, fengwei.yin fengwei.yin@linaro.org wrote:
Because gcc 4.9 could build this file without any issue, I apply --save-temps with gcc 4.9. The ii file is attached. Can't see significant differences.
There is a patch in gcc-5 to make unified assembler syntax the default. Unfortunately, it changes how extended asms work, which is perhaps a bug. The message claims it doesn't affect extended asms, but it does. https://gcc.gnu.org/ml/gcc-patches/2015-11/msg01196.html The interesting bit is the change to ASM_APP_OFF.
This is now https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70496 for FSF trunk.
Sorry about the breakage.
Ramana
As Ramana fixed it promptly on trunk, we'll backport it and it will be available in our next linaro-gcc-5.x snapshot.
Thanks,
Christophe.
gcc-4.9 emits a .thumb after the extended asm to switch back into thumb mode just in case. gcc-5.3 instead emits .syntax unified, which doesn't change the arm/thumb mode, just the syntax supported. This is arguably a bug, but this doesn't immediately help you. It could take a little time to get gcc-5.x source fixed, and then the compiler binary releases. Or alternatively we could fix the asm to work with gcc 5.
Jim _______________________________________________ linaro-toolchain mailing list linaro-toolchain@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-toolchain
linaro-toolchain mailing list linaro-toolchain@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-toolchain
Hi Christophe,
On 2016/4/4 3:58, Christophe Lyon wrote:
On 1 April 2016 at 12:04, Ramana Radhakrishnan ramana.radhakrishnan@arm.com wrote:
On 31/03/16 18:26, Jim Wilson wrote:
On Thu, Mar 31, 2016 at 5:12 AM, fengwei.yin fengwei.yin@linaro.org wrote:
Because gcc 4.9 could build this file without any issue, I apply --save-temps with gcc 4.9. The ii file is attached. Can't see significant differences.
There is a patch in gcc-5 to make unified assembler syntax the default. Unfortunately, it changes how extended asms work, which is perhaps a bug. The message claims it doesn't affect extended asms, but it does. https://gcc.gnu.org/ml/gcc-patches/2015-11/msg01196.html The interesting bit is the change to ASM_APP_OFF.
This is now https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70496 for FSF trunk.
Sorry about the breakage.
Ramana
As Ramana fixed it promptly on trunk, we'll backport it and it will be available in our next linaro-gcc-5.x snapshot.
Thanks a lot. I will try once the next snapshot is ready.
Regards Yin, Fengwei
Thanks,
Christophe.
gcc-4.9 emits a .thumb after the extended asm to switch back into thumb mode just in case. gcc-5.3 instead emits .syntax unified, which doesn't change the arm/thumb mode, just the syntax supported. This is arguably a bug, but this doesn't immediately help you. It could take a little time to get gcc-5.x source fixed, and then the compiler binary releases. Or alternatively we could fix the asm to work with gcc 5.
Jim _______________________________________________ linaro-toolchain mailing list linaro-toolchain@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-toolchain
linaro-toolchain mailing list linaro-toolchain@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-toolchain
linaro-toolchain@lists.linaro.org