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> I have a 5,000+ line program that can be compiled with either g++
Iain> or gcc.  Basically, it's ANSI C that has prototypes and casts for
Iain> everything.

Mark> It would be interesting to get a look at this program.. perhaps
Mark> you could even boil this down to an example?

I compared the assembly generated by g++ and gcc, and I noticed one
fairly common difference.  g++ seems to have trouble combining the
end-of-loop test with the backwards branch at the end of the loop.
gcc, on the same code, does not.  The trouble seems to stem from a
function inlined in the code body.

The 23 line program at the end of this email compiles to different
assembly through gcc and g++, and demonstrates this problem.  This
problem may account for a good chunk of my performance degredation,
since I have tons of linked list traversals.

I tested this code against gcc 2.7.2.  I would appreciate knowing if
the same problem exists in egcs, even if you don't have the time to
find what the problem is.

Thank you,

-Iain McClatchie


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]