Subject: Re: Compiler bug building SDL
To: Jason Thorpe <thorpej@wasabisystems.com>
From: Gary Duzan <gary@duzan.org>
List: tech-toolchain
Date: 10/23/2003 16:09:35
In Message <1C2260F4-0592-11D8-BEBB-000A957650EC@wasabisystems.com> ,
   Jason Thorpe <thorpej@wasabisystems.com> wrote:

=>
=>On Thursday, October 23, 2003, at 04:35  AM, Gary Duzan wrote:
=>> SDL_RLEaccel.c: In function `RLEClipBlit':
=>> SDL_RLEaccel.c:845: error: invalid `asm': invalid expression as operand
=>> SDL_RLEaccel.c:845: error: invalid `asm': invalid expression as operand
=>> SDL_RLEaccel.c:845: error: invalid `asm': invalid expression as operand
=>> gmake[3]: *** [SDL_RLEaccel.lo] Error 1
=>> ======================================================================= 
=>> ====
=>>
=>> Removing -O2 or changing it to -O3 allows it to compile normally. -O
=>> generates a similar message, but with only two "invalid `asm'"  
=>> messages.
=>>
=>>    Is this a known problem? Should I send-pr it or report it to the
=>> gcc folks?
=>
=>How is this a compiler problem?  It could just as well be bogus asm()  
=>statements in the SDL source code (which are often affected by  
=>optimization level).

   Ah, ok. I was assuming one of the optimizations was broken,
leading to the error, as opposed to the optimization level uncovering
a bug in the program. (It worked with the old compiler at -O2.)
The code in question is part of a huge macro expansion, so I ran
it through the preprocessor and "indent `cat /usr/share/misc/indent.pro`",
and the asm statements that the compiler flagged in the result
didn't look particularly broken at first glance. I'll dig into it
some more and see what I turn up.

					Gary Duzan