[net.text] Possible BUG in AZTEC C???

godawski@usceast.UUCP (Mike Godawski) (06/28/86)

To do my thesis work, I have been using Aztec C compiler on a Speary IT
computer equipped with an IBM EGA (256K ega ver).  Since the compiler 
does not know what the ega is, I had to write (copy from books) some 
routines that seem to display my images correctly.  

The problem seems to come when I compile my programs with the (+F) option
on the compiler.  This option supposedly creates Fast code.  When I
compile my routines with the +F, my program runs, but my images are
displayed in a strange repeating pattern on the screen.  When I omit the
+F, my program works perfectly. 

I know, you're going to say "Well, don't use the +F option", but can there
be some REAL reason for this to happen?  

One additional note, I am compiling my programs using the large code+large
data options.

Thanks for any insight.

mwg

bright@dataio.UUCP (Walter Bright) (06/30/86)

In article <2261@usceast.UUCP> godawski@usceast.UUCP (Mike godawski) writes:
>To do my thesis work, I have been using Aztec C compiler on a Speary IT
>computer equipped with an IBM EGA (256K ega ver).  Since the compiler 
>does not know what the ega is, I had to write (copy from books) some 
>routines that seem to display my images correctly.  
>The problem seems to come when I compile my programs with the (+F) option
>on the compiler.  This option supposedly creates Fast code.  When I
>compile my routines with the +F, my program runs, but my images are
>displayed in a strange repeating pattern on the screen.  When I omit the
>+F, my program works perfectly. 
>Can there be some REAL reason for this to happen?  

Optimization strikes again! Code that deals with device registers and
such usually cannot be optimized by classic optimization techniques. The
solutions are:

	1) Isolate the code that writes to the EGA to a separate module,
	   and compile just that module with optimization turned off.

	2) Use the 'volatile' type modifier on the accesses to the
	   hardware. Of course, I don't know if Aztec supports volatile,
	   but Datalight C does.