gcc-14 bugs, pile 3
This week GCC 14 entered stage 3.
Most major features are already pushed to master
branch and the main
focus now is to stabilize the result.
It’s a good time to look at bugs I noticed over past two months. This
time I saw 19
of those. That almost twice as much than over
previous 2 months.
summary
Bugs (or patches) in the order I observed them:
- tree-optimization/111435:
ICE
ongcc
code (-m32
) due to infinite recursion in type conversion rule - driver/111527:
gcc
hits environment size limit early due to an internalCOLLECT_GCC_OPTIONS
variable - rtl-optimization/111619:
make profiledbootstrap
is very slow to build in unoptimized builds - other/111629:
make profiledbootstrap
SIGSEGV
sgcc
on shutdown due to aggc
bug - bootstrap/111642:
make profiledbootstrap
fails to type checkgcc
’s ownpoly_int64
constructor - c++/111647:
-fchecking=0/2
disagree on validity ofIFNDR
c++
handling - bootstrap/111653:
-fchecking=0/2
generate different code on the same input libgcc
trampoline build fix:libgcc
build failure inlibc
-less mode- rtl-optimization/112107: bootstrap
failure on
i686-linux
: enabling debug changed register allocator output - middle-end/112321:
gcc
SIGSEGV
indebug
mode as it generated invalid objects - target/112332:
ICE
ingcc
when it attempted to useSIMD
instruction for stack access - c/112347:
ICE
onjemalloc
in newly added-Walloc-size
analysis - bootstrap/112379: bootstrap builds
failure: unused function when asserts are disabled (code under
#ifdef
) - libstdc++/112467:
__assume__
inlibstdc++
brokeclang
usage of that library - target/112523:
mpfr
,libsodium
andunbound
tests were failing for an invalidshrd
instruction use - target/112540:
gstreamer
ICE
inRTL
(invalid addressing mode forSIMD
) - target/112567:
linux
ICE onRTL
due togcc
generating invalid objects - ipa/112601:
ICE
onllvm-17.0.5
code in-fchecking=2
mode related to function attribute inference - target/112613: bad code in comparison
code when
AVX2
registers are present in generated code
fun discovery
I found a few new things as part of poking at those bugs:
IFNDR “Ill-Formed, No Diagnostic Required” is the known invalid code from type checking standpoint that is allowed to be compiled. In this case the whole program has an undefined behaviour.
-Walloc-size
added in PR71219 detects
interesting cases of T * p = malloc(sz)
calls when it’s clear that sz
is smaller than sizeof(T)
. It also works on calloc()
and already
found a few benign instances in
elfutils,
waypipe,
sway
and
swaybg.
histograms
Looking at the bug categories:
target
: 5bootstrap
: 3rtl-optimization
: 2tree-optimization
: 1driver
: 1other
: 1c++
: 1middle-end
: 1ipa
: 1c
: 1libstdc++
: 1libgcc
: 1
This cycle was very unusual: it has more bugs than I expected, it spans
over 12 categories of compiler components, most of bugs are in i386
target.
parting words
This cycle felt very busy: about 2-3 bugs per week.
I had a lot of joy fixing PGO
bootstrap
and submitting a few trivial fixes upstream.
I encountered only two bugs related to wrong code generated by gcc
.
Most of the bugs were compiler crashes which are a lot easier to detect,
report and fix. Chances are I did not get to running enough test suites
as there were so many obvious bugs that required some attention.
Let’s see what stage 3 will bring us.
Have fun!