From 3fe8e8f0689e3196101cd6c7bc5be6c423b41a49 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 6 Nov 2001 19:26:22 +0000 Subject: [PATCH] gcc does optimize writes to non volatile variables away if it didnt know that they were read in between Originally committed as revision 2751 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc --- postproc/postprocess.c | 4 ++-- postproc/postprocess_template.c | 4 ++-- postproc/swscale.c | 8 ++++---- postproc/swscale_template.c | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/postproc/postprocess.c b/postproc/postprocess.c index d466b67ee5..902a6298e5 100644 --- a/postproc/postprocess.c +++ b/postproc/postprocess.c @@ -116,8 +116,8 @@ Notes: #define OPTIONS_ARRAY_SIZE 10 #ifdef HAVE_MMX -static uint64_t __attribute__((aligned(8))) packedYOffset= 0x0000000000000000LL; -static uint64_t __attribute__((aligned(8))) packedYScale= 0x0100010001000100LL; +static volatile uint64_t __attribute__((aligned(8))) packedYOffset= 0x0000000000000000LL; +static volatile uint64_t __attribute__((aligned(8))) packedYScale= 0x0100010001000100LL; static uint64_t __attribute__((aligned(8))) w05= 0x0005000500050005LL; static uint64_t __attribute__((aligned(8))) w20= 0x0020002000200020LL; static uint64_t __attribute__((aligned(8))) w1400= 0x1400140014001400LL; diff --git a/postproc/postprocess_template.c b/postproc/postprocess_template.c index d466b67ee5..902a6298e5 100644 --- a/postproc/postprocess_template.c +++ b/postproc/postprocess_template.c @@ -116,8 +116,8 @@ Notes: #define OPTIONS_ARRAY_SIZE 10 #ifdef HAVE_MMX -static uint64_t __attribute__((aligned(8))) packedYOffset= 0x0000000000000000LL; -static uint64_t __attribute__((aligned(8))) packedYScale= 0x0100010001000100LL; +static volatile uint64_t __attribute__((aligned(8))) packedYOffset= 0x0000000000000000LL; +static volatile uint64_t __attribute__((aligned(8))) packedYScale= 0x0100010001000100LL; static uint64_t __attribute__((aligned(8))) w05= 0x0005000500050005LL; static uint64_t __attribute__((aligned(8))) w20= 0x0020002000200020LL; static uint64_t __attribute__((aligned(8))) w1400= 0x1400140014001400LL; diff --git a/postproc/swscale.c b/postproc/swscale.c index 8ea2396c70..f40eccf207 100644 --- a/postproc/swscale.c +++ b/postproc/swscale.c @@ -71,10 +71,10 @@ static uint64_t __attribute__((aligned(8))) bm00001111=0x00000000FFFFFFFFLL; static uint64_t __attribute__((aligned(8))) bm00000111=0x0000000000FFFFFFLL; static uint64_t __attribute__((aligned(8))) bm11111000=0xFFFFFFFFFF000000LL; -static uint64_t __attribute__((aligned(8))) b5Dither; -static uint64_t __attribute__((aligned(8))) g5Dither; -static uint64_t __attribute__((aligned(8))) g6Dither; -static uint64_t __attribute__((aligned(8))) r5Dither; +static volatile uint64_t __attribute__((aligned(8))) b5Dither; +static volatile uint64_t __attribute__((aligned(8))) g5Dither; +static volatile uint64_t __attribute__((aligned(8))) g6Dither; +static volatile uint64_t __attribute__((aligned(8))) r5Dither; static uint64_t __attribute__((aligned(8))) dither4[2]={ 0x0103010301030103LL, diff --git a/postproc/swscale_template.c b/postproc/swscale_template.c index 8ea2396c70..f40eccf207 100644 --- a/postproc/swscale_template.c +++ b/postproc/swscale_template.c @@ -71,10 +71,10 @@ static uint64_t __attribute__((aligned(8))) bm00001111=0x00000000FFFFFFFFLL; static uint64_t __attribute__((aligned(8))) bm00000111=0x0000000000FFFFFFLL; static uint64_t __attribute__((aligned(8))) bm11111000=0xFFFFFFFFFF000000LL; -static uint64_t __attribute__((aligned(8))) b5Dither; -static uint64_t __attribute__((aligned(8))) g5Dither; -static uint64_t __attribute__((aligned(8))) g6Dither; -static uint64_t __attribute__((aligned(8))) r5Dither; +static volatile uint64_t __attribute__((aligned(8))) b5Dither; +static volatile uint64_t __attribute__((aligned(8))) g5Dither; +static volatile uint64_t __attribute__((aligned(8))) g6Dither; +static volatile uint64_t __attribute__((aligned(8))) r5Dither; static uint64_t __attribute__((aligned(8))) dither4[2]={ 0x0103010301030103LL,