delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/03/13/19:19:38

Date: Fri, 13 Mar 92 18:28:42 EST
From: DJ Delorie <dj AT ctron DOT com>
To: bergstro AT src DOT honeywell DOT com
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: question re: generated code
>Posted-Date: Fri, 13 Mar 92 16:19:23 CST
>Date: Fri, 13 Mar 92 16:19:23 CST
>From: bergstro AT src DOT honeywell DOT com (Pete Bergstrom)
Status: O

>I'm using djgpp verion 1.03.  In examining the .S output from a C++
>code file, I find an enormous number of (to my mind) useless jmps.

>They jmp over '.align 2,144' statements and even setting optimization
>on does nothing to get rid of them.  Are they in fact optimized by the
>assembler, in which case I wouldn't know the difference?

The assembler doesn't do optimizations in gcc.

>I got sidetracked onto this by trying to figure out why my ray tracer
>was so slow compared to those of people using Borland's C++.

Two things make djgpp faster: longs and pointers (vs shorts and far
pointers).  Floating point isn't faster (same chip) and code speed
isn't much faster (except for far jumps).

>I would appreciate any pointers, including whether this is improved in
>gcc 2.0 (if the problem exists at all, of course).

>Thanks,
>Pete

Using -O (gcc -S -O foo.cc) gets rid of a lot of that kind of stuff.
I hope 2.0 solves it also; I haven't bothered to check.

1.06 will be out soon, and it will have gcc 2.0 in it.

DJ
dj AT ctron DOT com
Life is a banana.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019