This is the mail archive of the gcc-patches@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: [testcase] Simplified testcases why current gcc trunk cannot compile glibc


On Wed, Oct 17, 2001 at 05:03:48PM -0200, Alexandre Oliva wrote:
> On Oct 15, 2001, Jakub Jelinek <jakub@redhat.com> wrote:
> 
> > I prefer something like __attribute__((used)) and __attribute__((noinline)),
> 
> How about this?  Ok to install?  Tested on athlon-pc-linux-gnu.

I like it, just wonder about attr-noinline.c test:
extern inline void __attribute__((noinline)) foo(void) {}
doesn't make much sense (in current C inline implementation), it will act
the same way as if there were only extern void foo(void); prototypes.
In C++ it will force a the function to be emitted into .gnu.linkonce.
section.
What makes more sense to test is IMHO:

/* { dg-do compile } */
/* { dg-options "-O3" } */

static void function_declaration_before(void) __attribute__((__noinline__));

static void function_declaration_before(void) {}

static void function_declaration_after(void) {}

static void function_declaration_after(void) __attribute__((__noinline__));

static void __attribute__((__noinline__)) function_declaration_at(void) {}

int f () {
  function_declaration_before ();
  function_declaration_after ();
  function_declaration_at ();
}

/* { dg-final { scan-assembler "function_declaration_before" } } */
/* { dg-final { scan-assembler "function_declaration_after" } } */
/* { dg-final { scan-assembler "function_declaration_at" } } */

	Jakub


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