From 4ba108994cf227ca1df1c8404ef0322eb0e69b98 Mon Sep 17 00:00:00 2001 From: plagman Date: Mon, 26 Apr 2010 04:55:42 +0000 Subject: [PATCH] %esi gets modified by swapchar2 but isn't listed as an output operand for the GCC extended assembly version. This causes the compiler to fail to restore it after swapchar2 executes, causing crashes if used in a loop. This change fixes the security camera crash when using GCC 4.4.x or 4.5.0. git-svn-id: https://svn.eduke32.com/eduke32@1624 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/pragmas.h | 2 +- polymer/eduke32/build/src/engine.c | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/polymer/eduke32/build/include/pragmas.h b/polymer/eduke32/build/include/pragmas.h index 12eca41d6..6625401c7 100644 --- a/polymer/eduke32/build/include/pragmas.h +++ b/polymer/eduke32/build/include/pragmas.h @@ -1067,7 +1067,7 @@ void copybufreverse(void *S, void *D, int32_t c); __asm__ __volatile__ ("addl %%ebx, %%esi; movw (%%eax), %%cx; movb (%%ebx), %%dl; " \ "movb %%cl, (%%ebx); movb (%%esi), %%dh; movb %%ch, (%%esi); " \ "movw %%dx, (%%eax)" \ - : : "a" (__a), "b" (__b), "S" (__S) : "ecx", "edx", "memory", "cc"); \ + : "=S" (__S) : "a" (__a), "b" (__b), "S" (__S) : "ecx", "edx", "memory", "cc"); \ 0; }) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 3ecad98fe..0643dfbff 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -10284,12 +10284,6 @@ void setviewback(void) // // squarerotatetile // -#ifdef __GNUC__ -#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -#if (GCC_VERSION >= 40400) -#pragma GCC optimize("0") -#endif -#endif void squarerotatetile(int16_t tilenume) { int32_t siz; @@ -10308,13 +10302,6 @@ void squarerotatetile(int16_t tilenume) } } } -#ifdef __GNUC__ -#if (GCC_VERSION >= 40400) -#pragma GCC reset_options -#endif -#undef GCC_VERSION -#endif - // // preparemirror