Evan Ramos
2016-Jan-08 17:35 UTC
[flac-dev] warning: inlining failed in call to 'FLAC__bitwriter_write_raw_uint32.constprop':
Building with MinGW-w64 GCC 5.3.0 via Makefile.lite, I get the following warnings: bitwriter.c: In function 'FLAC__bitwriter_write_utf8_uint64': bitwriter.c:324:19: warning: inlining failed in call to 'FLAC__bitwriter_write_raw_uint32.constprop': --param large-function-growth limit reached [-Winline] inline FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, unsigned bits) ^ bitwriter.c:826:9: warning: called from here [-Winline] ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>6)&0x3F), 8); ^ bitwriter.c:324:19: warning: inlining failed in call to 'FLAC__bitwriter_write_raw_uint32.constprop': --param large-function-growth limit reached [-Winline] inline FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, unsigned bits) ^ bitwriter.c:823:9: warning: called from here [-Winline] ok &= FLAC__bitwriter_write_raw_uint32(bw, 0xF8 | (FLAC__uint32)(val>>24), 8); ^ bitwriter.c:324:19: warning: inlining failed in call to 'FLAC__bitwriter_write_raw_uint32.constprop': --param large-function-growth limit reached [-Winline] inline FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, unsigned bits) ^ bitwriter.c:826:9: warning: called from here [-Winline] ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>6)&0x3F), 8); ^ Would it be better to remove the inline keyword from the declaration of FLAC__bitwriter_write_raw_uint32 (and by extension, remove inline from FLAC__bitwriter_write_zeroes and add it to FLAC__bitwriter_write_unary_unsigned)? I suspect that the cache misses caused by code bloat from so much inlining would outweigh the comparable function call overhead, but performance testing would be necessary to confirm this. Best, Evan
lvqcl
2016-Jan-08 18:36 UTC
[flac-dev] warning: inlining failed in call to 'FLAC__bitwriter_write_raw_uint32.constprop':
Evan Ramos wrote:> Would it be better to remove the inline keyword from the declaration > of FLAC__bitwriter_write_raw_uint32 (and by extension, remove inline > from FLAC__bitwriter_write_zeroes and add it to > FLAC__bitwriter_write_unary_unsigned)? I suspect that the cache misses > caused by code bloat from so much inlining would outweigh the > comparable function call overhead, but performance testing would be > necessary to confirm this.I suspect that the main reason for inline attribute of FLAC__bitwriter_write_raw_uint32() is FLAC__bitwriter_write_raw_int32() function. Both of them are used in e.g. libFLAC/stream_encoder_framing.c, FLAC__subframe_add_(constant|fixed|lpc|verbatim) functions.