Question #256933: Internal Compiler error with Cortex M0+ and -mtpcs-leaf-frame

Bug #1390053 reported by Uwe Bonnes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
Won't Fix
Undecided
Terry Guo

Bug Description

This is the source file to reproduce the problem reported in #256033. The files have only some additions to be self-consistant and don't need further include. Further discussion is added to question #256033.

Revision history for this message
Uwe Bonnes (bon) wrote :
Terry Guo (terry.guo)
Changed in gcc-arm-embedded:
assignee: nobody → Terry Guo (terry.guo)
Revision history for this message
Terry Guo (terry.guo) wrote :

It's strange that I still can't reproduce it. Here is my screen paste:

terguo01@terry-pc01:mtpcs-frame$ ls
core_cm0plus.h core_cmFunc.h core_cmInstr.h test.c
terguo01@terry-pc01:mtpcs-frame$ cat test.c
#include "core_cm0plus.h"
int main(void)
{
    return 0;
}
terguo01@terry-pc01:mtpcs-frame$ /work/terguo01/tools/gcc-arm-none-eabi-4_8-2014q3/bin/arm-none-eabi-gcc -c -MD -MP -mcpu=cortex-m0plus -mthumb -D__CORTEX__ -ffunction-sections -fdata-sections -fomit-frame-pointer -g3 -Og -Wall -Wstrict-prototypes -Werror -O0 -mtpcs-frame -fno-omit-frame-pointer test.c
terguo01@terry-pc01:mtpcs-frame$ echo $?
0

gcc version 4.8.4 20140725 (release) [ARM/embedded-4_8-branch revision 213147] (GNU Tools for ARM Embedded Processors)

Are you sure you can trigger the error through my above steps?

Revision history for this message
Uwe Bonnes (bon) wrote :

Terry,

my deepest regrets for pointing you in the wrong direction. The culprit is "-mtpcs-leaf-frame " as visible in the difference of the commandlines given with my original question and in the title of the question and bug report

Please, try with -mtpcs-leaf-frame

I can now also reproduce with the MBED include like
>arm-none-eabi-gcc -c -MD -MP -mcpu=cortex-m0plus -mthumb -D__CORTEX__ -ffunction-sections -fdata-sections -fomit-frame-pointer -g3 -Og -Wall -Wstrict-prototypes -Werror -O0 -mtpcs-frame -mtpcs-leaf-frame -fno-omit-frame-pointer test.c -I/devel/mbed/libraries/mbed/targets/cmsis/ -DIRQn_Type=int -D__NVIC_PRIO_BITS=2 -DSysTick_IRQn=0

Revision history for this message
Terry Guo (terry.guo) wrote :

Now I can reproduce the issue for 4.8 and trunk.

terguo01@terry-pc01:mtpcs-frame$ /work/terguo01/tools/gcc-arm-none-eabi-5_0-2014q4/bin/arm-none-eabi-gcc -c -MD -MP -mcpu=cortex-m0plus -mthumb -D__CORTEX__ -ffunction-sections -fdata-sections -fomit-frame-pointer -g3 -Og -Wall -Wstrict-prototypes -Werror -O0 -mtpcs-leaf-frame -fno-omit-frame-pointer test.c
test.c: In function 'main':
test.c:5:1: error: unrecognizable insn:
 }
 ^
(insn 20 19 21 (set (reg:SI 2 r2)
        (reg:SI 15 pc)) test.c:3 -1
     (nil))
test.c:5:1: internal compiler error: in extract_insn, at recog.c:2327
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

gcc version 5.0.0 20141106 (experimental) [trunk revision 217200] (GNU Tools for ARM Embedded Processors)

Changed in gcc-arm-embedded:
status: New → Confirmed
Revision history for this message
Uwe Bonnes (bon) wrote :

Any progess on this bug?

The bug still happens with gcc-arm-none-eabi-4_9-2015q1.

Revision history for this message
Terry Guo (terry.guo) wrote :

We are going to deprecate all TPCS related options https://gcc.gnu.org/gcc-5/changes.html. So please try not using them.

Changed in gcc-arm-embedded:
status: Confirmed → Won't Fix
Revision history for this message
Uwe Bonnes (bon) wrote :

Dear Terry,

can you tell what compiler option now has to be used for generating stack frames? Looking at the manpage, the only none-tpcs stack frame related option is "-mapcs-frame" which is also deprecated.

Thanks

Revision history for this message
Terry Guo (terry.guo) wrote :

Some one is asking similar question https://gcc.gnu.org/ml/gcc-help/2015-03/msg00098.html. Please allow me to check internally and then get back to you.

Revision history for this message
Uwe Bonnes (bon) wrote :

Dear Terry,

any news on this subject?

Revision history for this message
Terry Guo (terry.guo) wrote :

Dear Uwe,

Really sorry for my slow response. Please refer to this mail https://gcc.gnu.org/ml/gcc-help/2015-05/msg00080.html.

Revision history for this message
Uwe Bonnes (bon) wrote :

The bug still happens with gcc-arm-none-eabi-4_9-2015q2.

Revision history for this message
Tejas Belagod (belagod-tejas) wrote :

Hi Uwe, does this happen with -mapcs-frame or the old option -mtpcs-leaf-frame?
Thanks.

Revision history for this message
Uwe Bonnes (bon) wrote :

I happens when mtpcs-leaf-frame is given. With only mtpcs-frame, the sample program compiles.

Revision history for this message
Uwe Bonnes (bon) wrote :

However mtpcs-leaf-frame is needed to get full backtrace information for leaf function. Any chance to get mtpcs-leaf-frame fixed?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.