Re: avr-gcc making really bad inlining decisions.

Bill Westfield <[email protected]>
Newsgroups gmane.comp.hardware.avr.gcc
Message-ID <CAPmNOeChLqX0VDtsQdUbPUEsQvmzY5eTgP-ebm3JVtxqXcJ2BQ@mail.gmail.com>
Hmm.  Particularly interesting is this series of "Considering"
paragraphs.  about 42 all together (one for each call to move3Servos()
in loop()?)

============
Considering void move3Servos(Servo, float, Servo, float, Servo, float,
float) with 87 size
 to be inlined into void loop() in oiOSoul.ino:353
 Estimated growth after inlined into all is +176 insns.
 Estimated badness is -1073741832, frequency 0.04.
 Inlined into void loop() which now has time 467 and size 792,net change of -8.
New minimal size reached: 1550

Considering void move3Servos(Servo, float, Servo, float, Servo, float,
float) with 87 size
 to be inlined into void doseOff() in oiOSoul.ino:412
 Estimated growth after inlined into all is +184 insns.
 Estimated badness is -1073741832, frequency 1.00.
 Inlined into void doseOff() which now has time 4671 and size 180,net
change of -8.
New minimal size reached: 1542

   :

Considering void move3Servos(Servo, float, Servo, float, Servo, float,
float) with 87 size
 to be inlined into void loop() in oiOSoul.ino:325
 Estimated growth after inlined into all is +412 insns.
 Estimated badness is -1073741824, frequency 0.01.
 Inlined into void loop() which now has time 360 and size 628,net change of +0.
==============

Each time, the "estimated growth" grows by 8, but the "new minimal
size" shrinks by 8 (if I'm even close to interpreting the text
correctly.)  That last one, where inlined growth of 412 instructions
results in a loop() size of 360, is especially confusing.   Also that
value for "badness" is really suspicious (0xBFFFFFF8); in the older
compiler, usual values were in the 100 to 1000 range.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.