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:ICEongcccode (-m32) due to infinite recursion in type conversion ruledriver/111527:gcchits environment size limit early due to an internalCOLLECT_GCC_OPTIONSvariablertl-optimization/111619:make profiledbootstrapis very slow to build in unoptimized buildsother/111629:make profiledbootstrapSIGSEGVgccon shutdown due to aggcbugbootstrap/111642:make profiledbootstrapfails to type checkgccownpoly_int64constructorc++/111647:-fchecking=0/2disagree on validity ofIFNDRc++handlingbootstrap/111653:-fchecking=0/2generate different code on the same inputlibgcctrampoline build fix:libgccbuild failure inlibc-less modertl-optimization/112107: bootstrap failure oni686-linux: enabling debug changed register allocator outputmiddle-end/112321:gccSIGSEGVindebugmode as it generated invalid objectstarget/112332:ICEingccwhen it attempted to useSIMDinstruction for stack access- c/112347:
ICEonjemallocin newly added-Walloc-sizeanalysis bootstrap/112379: bootstrap builds failure: unused function when asserts are disabled (code under#ifdef)libstdc++/112467:__assume__inlibstdc++brokeclangusage of that librarytarget/112523:mpfr,libsodiumandunboundtests were failing for an invalidshrdinstruction use- target/112540:
gstreamerICEinRTL(invalid addressing mode forSIMD) target/112567:linuxICE onRTLdue togccgenerating invalid objectsipa/112601:ICEonllvm-17.0.5code in-fchecking=2mode related to function attribute inferencetarget/112613: bad code in comparison code whenAVX2registers 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 behavior.
-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 a few 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!