This is the mail archive of the gcc-bugs@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]

Re: GCC fails to inline a short function




Hi Tal,

the mistake was mine. 


On Mon, Jun 11, 2001 at 02:35:23AM -0500, Ali Bahar wrote:
> 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 still happens. I don't know why. 
I don't think you should read too much into it, until I actually get
glibc to build -- which is yet to happen!!




> 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

The mistake was mine. glibc-2.2.3's installation instructions leave it
to _me_ to define a CFLAGS. As I was interested only in debugging, I
defined this to be '-ggdb3'. The absence of '-O' caused the absence of
inlining! I'd set this flag several weeks ago, and had completely
forgottten about it!
Of course, since the build will fail without it, not defining CFLAGS
is perhaps a bug in glibc's installation instructions.

Once glibc builds, I will try your file again. I will send a tarball
of my tests to you separately -- off this list.
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);
> > }

-- 
                            smaller is better.
                                   unix


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