From 50be0c99cf97257a274fe9e8a745acd6572654a5 Mon Sep 17 00:00:00 2001 From: beveloper Date: Sat, 21 Jun 2003 02:08:03 +0000 Subject: [PATCH] GCC is way too smart or buggy and will (at least in this case) remove (optimize away) non __volatile__ asm statements :( git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3591 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/media/media-add-ons/mixer/ByteSwap.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/add-ons/media/media-add-ons/mixer/ByteSwap.cpp b/src/add-ons/media/media-add-ons/mixer/ByteSwap.cpp index 3b1b8d08f3..f2c7abe4e2 100644 --- a/src/add-ons/media/media-add-ons/mixer/ByteSwap.cpp +++ b/src/add-ons/media/media-add-ons/mixer/ByteSwap.cpp @@ -65,7 +65,9 @@ swap_int16(void *buffer, size_t bytecount) // output operand outputting to an unused dummy variable. uint32 dummy1; uint32 dummy2; - asm ( + // GCC is way too smart and will remove the complete asm statement + // if we do not specify it as __volatile__. Don't remove that! + __asm__ __volatile__ ( "pushl %%ebx \n\t" "movl %%eax, %%ebx \n\t" "movl %%edx, %%eax \n\t"