internal compiler error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

internal compiler error

457 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rkiryanov on Sat Feb 06 03:13:31 MST 2010

Quote:
Building file: ../src/entry.cpp
Invoking: MCU C++ Compiler
arm-none-eabi-c++ -DNDEBUG -D__CODE_RED -O2 -g -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fno-rtti -fno-exceptions -Wa,-ahlnds=entry.asm -mcpu=cortex-m0 -mthumb -D__NEWLIB__ -MMD -MP -MF"src/entry.d" -MT"src/entry.d" -o"src/entry.o" "../src/entry.cpp"
../src/entry.cpp: In function 'void<unnamed>::CreateThreads()':
../src/entry.cpp:43: warning: unused variable 'b2'
../src/entry.cpp: In function 'void Reset_Handler()':
../src/entry.cpp:44: internal compiler error: in expand_expr_addr_expr_1, at expr.c:6854
Please submit a full bug report,
with preprocessed source if appropriate.



I tried to "Preprocess only (-E)" but found nothing.
0 Kudos
12 Replies

440 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rkiryanov on Tue Feb 09 08:51:08 MST 2010

Quote: CodeRedSupport
Actually, I just checked Visual Studio 2008 and it *does* call operator delete() in the destructors.



I have checked too. Yes, it does, but they are called in "A::`scalar deleting destructor'" and linker should throw them away as unreferenced. No need any _sbrk 'cos no new/delete in executable.
0 Kudos

440 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Feb 09 08:40:51 MST 2010
Actually, I just checked Visual Studio 2008 and it *does* call operator delete() in the destructors.
0 Kudos

440 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Feb 09 08:29:53 MST 2010
I can't comment on what other compilers do. I think you will find any GCC-based C++ compiler will do the same.
0 Kudos

440 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rkiryanov on Tue Feb 09 08:26:49 MST 2010

Quote: CodeRedSupport
Your destructors are causing operator delete() to be called.



For stack objects? What memory is allocated/deleted? Why MSVC 2008 SP1 Express and IAR do not such thing?
0 Kudos

440 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Feb 09 08:17:46 MST 2010
Your destructors are causing operator delete() to be called.

You can see this in the disassembly of the functions.
0 Kudos

440 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rkiryanov on Tue Feb 09 06:52:00 MST 2010
up.
0 Kudos

440 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rkiryanov on Sat Feb 06 08:01:39 MST 2010

Quote: CodeRedSupport
The compiler constructions/destructors are using the malloc/free library.



What purpose of malloc/free in 'ctor and 'dctor for stack objects? They are only special decorated functions.
0 Kudos

440 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sat Feb 06 07:48:48 MST 2010
Hi

Thanks for reporting this. I think when you add more code to this example, I think you will find the problem will go away.

re: your question on _sbrk: The compiler constructions/destructors are using the malloc/free library. You will need to link with the Newlib (nohost) library to link in these functions. Linker/Target/"Use C library"
0 Kudos

440 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rkiryanov on Sat Feb 06 06:35:01 MST 2010

Quote: CodeRedSupport
I get no errors when compiling that project.



Try "Release", "Debug" actually build well. LPCXpresso: Build id: 2010-01-22 (v3.2.2)
0 Kudos

440 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sat Feb 06 06:29:10 MST 2010
I get no errors when compiling that project.
0 Kudos

440 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rkiryanov on Sat Feb 06 05:04:24 MST 2010
Here it is. I have a question about virtual functions (before I use it in IAR): LPCXpresso requires _sbrk and allocates additional SRAM if using virtual 'dctor (without exceptions). Why?
0 Kudos

440 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sat Feb 06 04:42:21 MST 2010
Can you please send a project that contains everything we need to be able to reproduce the problem.
0 Kudos