diff -up allegro-4.2.2/include/allegro/platform/al386gcc.h~ allegro-4.2.2/include/allegro/platform/al386gcc.h
--- allegro-4.2.2/include/allegro/platform/al386gcc.h~ 2008-01-21 19:18:34.000000000 +0100
+++ allegro-4.2.2/include/allegro/platform/al386gcc.h 2008-01-21 19:18:34.000000000 +0100
@@ -208,14 +208,13 @@ AL_INLINE(fixed, fixsub, (fixed x, fixed
*/
AL_INLINE(fixed, fixmul, (fixed x, fixed y),
{
- fixed edx __attribute__ ((__unused__));
fixed result;
__PRECALCULATE_CONSTANTS(x / 65536.0 * y)
{
__asm__ (
- " movl %2, %%eax ; "
- " imull %3 ; " /* do the multiply */
+ " movl %1, %%eax ; "
+ " imull %2 ; " /* do the multiply */
" shrdl $16, %%edx, %%eax ; "
" sarl $15, %%edx ; " /* check for overflow */
@@ -223,14 +222,14 @@ AL_INLINE(fixed, fixmul, (fixed x, fixed
" cmpl $-1, %%edx ; "
" je 0f ; "
- " movl %5, %%eax ; " /* on overflow, set errno */
- " movl %4, (%%eax) ; "
+ " movl %4, %%eax ; " /* on overflow, set errno */
+ " movl %3, (%%eax) ; "
" movl $0x7FFFFFFF, %%eax ; " /* and return MAXINT */
- " cmpl $0, %2 ; "
+ " cmpl $0, %1 ; "
" jge 1f ; "
" negl %%eax ; "
" 1: "
- " cmpl $0, %3 ; "
+ " cmpl $0, %2 ; "
" jge 0f ; "
" negl %%eax ; "
@@ -238,15 +237,14 @@ AL_INLINE(fixed, fixmul, (fixed x, fixed
" 0: " /* finished */
- : "=&a" (result), /* the result has to go in eax */
- "=&d" (edx) /* reliably reserve edx */
+ : "=&a" (result) /* the result has to go in eax */
: "mr" (x), /* x and y can be regs or mem */
"mr" (y),
"i" (ERANGE),
"m" (allegro_errno)
- : "%cc", "memory" /* clobbers flags and errno */
+ : "%cc", "memory", "edx" /* clobbers flags, errno and edx */
);
return result;