This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: GCC fails to inline a short function
- To: Tal Agmon <Tal dot Agmon at nsc dot com>
- Subject: Re: GCC fails to inline a short function
- From: Ali Bahar <a dot bahar at computer dot org>
- Date: Mon, 11 Jun 2001 02:35:23 -0500
- Cc: gcc-bugs at gcc dot gnu dot org, Gali Carmel <Gali dot Carmel at nsc dot com>,Irit Mano <Irit dot Mano at nsc dot com>
- References: <OFDE3DCEDD.DBE6CD2F-ON42256A64.00495AA4@nsc.com>
- Reply-To: a dot bahar at computer dot org, alih at internetDog dot org
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!