2 bug-2320.c z80 codegen / regalloc interaction issue overwriting register h
7 #pragma disable_warning 85
8 #pragma disable_warning 283
10 void as(char *c1
, const char *c2
, unsigned int i
)
15 extern void p(char *c
,...)
20 #define a(x) ((x) == 0 ? as(#x, __FILE__, __LINE__):(void)0)
22 #define BACKING_STORAGE_SIZE 8192
24 #define buffer_size (BACKING_STORAGE_SIZE-2)
25 unsigned buffer_p
, buffer_len
;
28 void buffer_invariants()
30 a(buffer_len
<= buffer_size
);
31 a(buffer_p
<= buffer_len
);
33 if (buffer_gap
!= buffer
+ buffer_size
- buffer_len
+ buffer_p
) {
34 p("%04x + %04x - %04x + %04x = %04x, not %04x\n",
35 buffer
, buffer_size
, buffer_len
, buffer_p
,
36 buffer
+ buffer_size
- buffer_len
+ buffer_p
,
38 a(buffer_gap
== buffer
+ buffer_size
- buffer_len
+ buffer_p
);
44 buffer
= (unsigned char __xdata
*)(0xa5a5);
47 buffer_gap
= buffer
+ buffer_size
- buffer_len
+ buffer_p
;