revision 1198:407659e01ef0
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 1198:407659e01ef0 |
parent | 1197:904fba59a705 |
child | 1199:62d0a21fac1c |
author | Nathan Keynes <nkeynes@lxdream.org> |
date | Fri Dec 16 10:08:45 2011 +1000 (12 years ago) |
Add volatile qualifier to return-address frobbing - works around optimizer
bug in GCC versions after 4.2
bug in GCC versions after 4.2
acinclude.m4 | view | annotate | diff | log | ||
configure | view | annotate | diff | log | ||
src/sh4/mmu.c | view | annotate | diff | log | ||
src/sh4/sh4x86.in | view | annotate | diff | log | ||
src/sh4/shadow.c | view | annotate | diff | log |
1.1 --- a/acinclude.m4 Wed Dec 14 23:23:32 2011 +10001.2 +++ b/acinclude.m4 Fri Dec 16 10:08:45 2011 +10001.3 @@ -51,7 +51,7 @@1.4 int __attribute__((noinline)) foo( int arg, void *exc )1.5 {1.6 if( arg < 2 ) {1.7 - *(((void **)__builtin_frame_address(0))+1) = exc;1.8 + *(((void * volatile *)__builtin_frame_address(0))+1) = exc;1.9 }1.10 return 0;1.11 }
2.1 --- a/configure Wed Dec 14 23:23:32 2011 +10002.2 +++ b/configure Fri Dec 16 10:08:45 2011 +10002.3 @@ -8203,7 +8203,7 @@2.4 int __attribute__((noinline)) foo( int arg, void *exc )2.5 {2.6 if( arg < 2 ) {2.7 - *(((void **)__builtin_frame_address(0))+1) = exc;2.8 + *(((void * volatile *)__builtin_frame_address(0))+1) = exc;2.9 }2.10 return 0;2.11 }
3.1 --- a/src/sh4/mmu.c Wed Dec 14 23:23:32 2011 +10003.2 +++ b/src/sh4/mmu.c Fri Dec 16 10:08:45 2011 +10003.3 @@ -1199,7 +1199,7 @@3.5 /********************** TLB Direct-Access Regions ***************************/3.6 #ifdef HAVE_FRAME_ADDRESS3.7 -#define EXCEPTION_EXIT() do{ *(((void **)__builtin_frame_address(0))+1) = exc; } while(0)3.8 +#define EXCEPTION_EXIT() do{ *(((void * volatile *)__builtin_frame_address(0))+1) = exc; } while(0)3.9 #else3.10 #define EXCEPTION_EXIT() sh4_core_exit(CORE_EXIT_EXCEPTION)3.11 #endif
4.1 --- a/src/sh4/sh4x86.in Wed Dec 14 23:23:32 2011 +10004.2 +++ b/src/sh4/sh4x86.in Fri Dec 16 10:08:45 2011 +10004.3 @@ -604,7 +604,7 @@4.4 *(void **)(backpatch+5) = XLAT_BLOCK_FOR_CODE(target)->use_list;4.5 XLAT_BLOCK_FOR_CODE(target)->use_list = backpatch;4.7 - uint8_t **retptr = ((uint8_t **)__builtin_frame_address(0))+1;4.8 + uint8_t * volatile *retptr = ((uint8_t * volatile *)__builtin_frame_address(0))+1;4.9 assert( *retptr == ((uint8_t *)__builtin_return_address(0)) );4.10 *retptr = backpatch;4.11 }
5.1 --- a/src/sh4/shadow.c Wed Dec 14 23:23:32 2011 +10005.2 +++ b/src/sh4/shadow.c Fri Dec 16 10:08:45 2011 +10005.3 @@ -31,7 +31,7 @@5.4 #ifdef HAVE_FRAME_ADDRESS5.5 static FASTCALL __attribute__((noinline)) void *__first_arg(void *a, void *b) { return a; }5.6 #define INIT_EXCEPTIONS(label) goto *__first_arg(&&fnstart,&&label); fnstart:5.7 -#define EXCEPTION_EXIT(exc) do{ *(((void **)__builtin_frame_address(0))+1) = exc; } while(0)5.8 +#define EXCEPTION_EXIT(exc) do{ *(((void * volatile *)__builtin_frame_address(0))+1) = exc; } while(0)5.9 #else5.10 #define INIT_EXCEPTIONS(label)5.11 #define EXCEPTION_EXIT() sh4_core_exit(CORE_EXIT_EXCEPTION)
.