This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Inlining fails on very simple code


Hija,

I've just discovered a strange phenomenon on ppc-gnu-linux 
and a trunk gcc from 3 days ago: The attached preprocessed
code contains an idct code with 3 functions:
One to calculate an IDCT row, one for a column and one
to put them together.

Although the row and column code is specified to be static inline
and called exactly in one place there's no option on earth
I can convince gcc to inline it although it is clearly a win
situation as it removes the function call overhead and it is used 
exactly once which is a fact that gcc knows (or at least has the chance
to). I would have suspected that gcc uses the opportunity to at least
spare the overhead for the call if not even beat the crap out of this
situation and optimize over the border of the call.

Indeed if I directly move the codeblock in the row and col functions 
directly into the loops the compiler does a much better job which
results in a smaller objectfile and 15% faster execution. 

Anyone having an idea what's going on?

--
Servus,
       Daniel

Attachment: simple_idct.i
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]