mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-12 16:30:44 +00:00
Hack around over-optimized labels-as-values extension from GCC.
This commit is contained in:
parent
e08bb16edf
commit
a56e4b9be0
@ -2394,13 +2394,25 @@ int main(void)
|
||||
b_region = &&L_b_region1;
|
||||
e_region = &&L_e_region1;
|
||||
#endif
|
||||
/* This is a really awful hack but otherwise gcc is smart enough
|
||||
* (or bug'ous enough?) to optimize the labels and place them
|
||||
* e.g. at the "main" entry point, which is wrong.
|
||||
*/
|
||||
volatile int label_hack = 1;
|
||||
switch (label_hack) {
|
||||
case 1:
|
||||
L_b_region1:
|
||||
page[REF_INDEX] = REF_VALUE;
|
||||
if (page[REF_INDEX] != REF_VALUE)
|
||||
exit(20);
|
||||
page[REF_INDEX] = REF_VALUE;
|
||||
BARRIER();
|
||||
// fall-through
|
||||
case 2:
|
||||
L_e_region1:
|
||||
BARRIER();
|
||||
break;
|
||||
}
|
||||
|
||||
if (handler_called != 1)
|
||||
return 5;
|
||||
@ -2431,6 +2443,8 @@ int main(void)
|
||||
b_region = &&L_b_region2;
|
||||
e_region = &&L_e_region2;
|
||||
#endif
|
||||
switch (label_hack) {
|
||||
case 1:
|
||||
L_b_region2:
|
||||
TEST_SKIP_INSTRUCTION(unsigned char);
|
||||
TEST_SKIP_INSTRUCTION(unsigned short);
|
||||
@ -2441,8 +2455,12 @@ int main(void)
|
||||
TEST_SKIP_INSTRUCTION(signed int);
|
||||
TEST_SKIP_INSTRUCTION(signed long);
|
||||
BARRIER();
|
||||
// fall-through
|
||||
case 2:
|
||||
L_e_region2:
|
||||
|
||||
BARRIER();
|
||||
break;
|
||||
}
|
||||
if (!arch_insn_skipper_tests())
|
||||
return 20;
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user