https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122187
Bug ID: 122187
Summary: internal compiler error: in avr_out_extr
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: nospam at kota dot moe
Target Milestone: ---
Created attachment 62515
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62515&action=edit
-freport-bug output on 16.0.0
Given the below short input file, GCC fails with "internal compiler error: in
avr_out_extr" from command line:
> avr-gcc -mmcu=attiny10 -std=c23 -O3 -Wall -Wextra -pedantic a.c -o a
a.c:
> #include <stdint.h>
> #include <avr/io.h>
> int main() {
> uint16_t h = 0;
> for (uint32_t s = 0; s < 0x10000; ++s)
> h += (PINB >> PB1) & 1;
> OCR0A = h;
> }
If I add the -freorder-blocks-algorithm=simple option, the error goes away
Full error backtrace and other -freport-bug output is in the attached file
This occurs both for the 16.0.0 git master branch, as well as 14.2.0-2 as built
by Debian (https://snapshot.debian.org/package/gcc-avr/1%3A14.2.0-2/)
Note the error message in 14.2.0-2 is different, but still fails to compile
just the same:
> during RTL pass: bbro
> a.c: In function ‘main’:
> a.c:9:1: internal compiler error: in simplify_subreg, at simplify-rtx.cc:7549
> 9 | }
> | ^
> 0x7f3e0d5e0ca7 __libc_start_call_main
> ../sysdeps/nptl/libc_start_call_main.h:58
> 0x7f3e0d5e0d64 __libc_start_main_impl
> ../csu/libc-start.c:360
The attached file is 16.0.0 output, not 14.2.0-2