Skip to content

fatal error: error in backend: underestimated function size #647

@toyowata

Description

@toyowata

Summary

I got "fatal error: error in backend: underestimated function size" by compiling attached code.

fatal_error_atfe21_1_1.tar.gz

$ clang --target=arm-none-eabi -mcpu=cortex-m0plus -mfloat-abi=soft -g -O3 -std=gnu11 -c ./test_atfe21_1_1_pp.c
fatal error: error in backend: underestimated function size
PLEASE submit a bug report to https://github.com/arm/arm-toolchain/issues and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: clang --target=arm-none-eabi -mcpu=cortex-m0plus -mfloat-abi=soft -g -O3 -std=gnu11 -c ./test_atfe21_1_1_pp.c
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module './test_atfe21_1_1_pp.c'.
4.	Running pass 'ARM constant island placement and branch shortening pass' on function '@main'
 #0 0x00000001061b3bb4 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x1013c3bb4)
 #1 0x00000001061b1af0 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x1013c1af0)
 #2 0x00000001061b3288 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x1013c3288)
 #3 0x0000000106110064 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x101320064)
 #4 0x0000000106110010 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x101320010)
 #5 0x00000001061aeda0 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x1013beda0)
 #6 0x0000000104df6658 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x100006658)
 #7 0x000000010611a2c8 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x10132a2c8)
 #8 0x000000010611a194 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x10132a194)
 #9 0x00000001050becd4 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x1002cecd4)
#10 0x0000000105667fa4 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x100877fa4)
#11 0x0000000105a06bdc (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x100c16bdc)
#12 0x0000000105a0ce50 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x100c1ce50)
#13 0x0000000105a07550 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x100c17550)
#14 0x00000001065a24e0 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x1017b24e0)
#15 0x00000001067f0f64 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x101a00f64)
#16 0x00000001076790f0 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x1028890f0)
#17 0x0000000106bf1f74 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x101e01f74)
#18 0x0000000106b81638 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x101d91638)
#19 0x0000000106c62ef0 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x101e72ef0)
#20 0x0000000104df5aa4 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x100005aa4)
#21 0x0000000104df3888 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x100003888)
#22 0x00000001069e3cfc (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x101bf3cfc)
#23 0x000000010610ffe8 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x10131ffe8)
#24 0x00000001069e37bc (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x101bf37bc)
#25 0x00000001069ae920 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x101bbe920)
#26 0x00000001069aeae8 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x101bbeae8)
#27 0x00000001069c8bb0 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x101bd8bb0)
#28 0x0000000104df2908 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x100002908)
#29 0x0000000104dff2e4 (/Applications/ATfE-21.1.1-Darwin-universal/bin/clang-21+0x10000f2e4)
#30 0x000000018f1f9d54
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 21.1.1
Target: arm-unknown-none-eabi
Thread model: posix
InstalledDir: /Applications/ATfE-21.1.1-Darwin-universal/bin
Arm Toolchain ID: E0058 (1bbd3573)
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/92/d9hjnx8x18nb2yv3zbs34wxm0000gn/T/test_atfe21_1_1_pp-3387d9.c
clang: note: diagnostic msg: /var/folders/92/d9hjnx8x18nb2yv3zbs34wxm0000gn/T/test_atfe21_1_1_pp-3387d9.sh
clang: note: diagnostic msg: Crash backtrace is located in
clang: note: diagnostic msg: /Users/toyowata/Library/Logs/DiagnosticReports/clang-21_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang: note: diagnostic msg: 

********************

To Reproduce

  1. Extract attached file
  2. Build the file test_atfe21_1_1_pp.c:
clang --target=arm-none-eabi -mcpu=cortex-m0plus -mfloat-abi=soft -g -O3 -std=gnu11 -c ./test_atfe21_1_1_pp.c

The minimum.c is also a minimum reproducer code.

Expected behavior
The test_atfe21_1_1_pp.c is compiled without fatal error.

Actual behavior
The fatal error occurs and cannot compile the code.

Environment

Arm Toolchain version

$ clang --version
clang version 21.1.1
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /Applications/ATfE-21.1.1-Darwin-universal/bin
Arm Toolchain ID: E0058 (1bbd3573)

Host OS
macOS Tahoe 26.1

$ sw_vers -productVersion
26.1

kernel version

$ uname -a
Darwin xxxxx_MacBook-Pro.local 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:05 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6041 arm64

[Additional context]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions