GCC fails to inline a short function

Ali Bahar a.bahar@computer.org
Sun Jun 10 23:35:00 GMT 2001


Hi Tal,

Do you still see this problem? Or have you gotten to the bottom of it?

I've tried this with gcc 3.0 (tonight's image) & 2.95.2, both on an
x86 Linux. The file will not build; it does not like your passing that
struct ("conversion to non-scalar type requested"). So I wonder if
this is a valid test, or if gcc is at fault. (I thought passing a
struct was ok with recent compilers.)

The reason why I am interested in this, is that glibc.2.2.3 is not
linking due to, what appears like, similar reasons. Several inline
functions are UNDefined in the generated libs. And at least one of
these functions seems very correct.

It is a nested inline. But no code seems generated for its
definition. ('-fno-implement-inlines' has not been used.) As expected,
this leads to the ld failure.

I will investigate even further, before posting a bug.

regards,
ali



On Thu, Jun 07, 2001 at 04:22:36PM +0200, Tal Agmon wrote:
> When compiling the attached file with gcc version 2.95.2 19991024 (release) on platform sparc-sun-solaris,
> the function 'compat' is not inlined as requested (see file.s).
> When compiling with the flag -Winline, the compiler outputs a warning: "inlining failed in call to `compat' "
>  but there is no reason  for the failure is not given.
> 
> Can anyone explain to me what is the reason for the failure?
> 
> The command line is:
>      gcc -O -Winline file.c
> 
> Regards,
>      Tal agmon
>      CompactRISC compiler team
>      National Semiconductor

 
> struct { unsigned int        S[2]; } colour4;
> __inline__ void
> compat( col4)
> 
>     struct { unsigned int        S[2]; } col4;
> {
> 
> }
> main()
> {
> 
>    compat( colour4);
> }



-- 

        GNU/Linux: The Only OS That Matters!



More information about the Gcc-bugs mailing list