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]

Re: [EGCS] Does egcs do performance regression tests?


Iain> The 23 line program at the end of this email compiles to different
Iain> assembly through gcc and g++, and demonstrates this problem.
Iain> I tested this code against gcc 2.7.2.

Excuse me for leaving out important information: the program was
compiled by the following two command lines:

gcc -m486 -O3 -S -c tmp.cc
   gives this loop:
.L9:
	testl %eax,%eax
	je .L10
	movl %edx,4(%eax)
	movl (%eax),%eax
	jmp .L9

gcc -m486 -O3 -S -c tmp2.c
   gives this loop:
.L13:
	movl %edx,4(%eax)
	movl (%eax),%eax
	testl %eax,%eax
	jne .L13

The source code once again:

extern inline void *
stalloc( void *stack )
{
  void   *ret= stack;

  return ret;
}

typedef struct net_list_t {
  struct net_list_t    *next;
  void                 *net;
} net_list_t;

void
initialize_connectivity( void *temppool, net_list_t *list )
{
  net_list_t     *netp;

  for( netp = list; netp != 0; netp = netp->next ) {
    netp->net = stalloc( temppool );
  }
}


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