The incr_offset offset code was not working with bounds checking. So I reverted part of tccgen.c. See new test code 132. Also added some debugging code that prints location of bounds checking calls. Needed this to find the problem. See lib/bcheck.c, lib/bt-dll.c, lib/bt-exe.c, lib/bt-log.c, tccrun.c
Showing the changes to tests (2 of 8 files). Show all
Unified · Split
| @@ -0,0 +1,29 @@ | ||
| 1 | +#include <stdio.h> | |
| 2 | +#include <float.h> | |
| 3 | + | |
| 4 | +union ieee_double_extract | |
| 5 | +{ | |
| 6 | + struct { | |
| 7 | + unsigned int manl:32; | |
| 8 | + unsigned int manh:20; | |
| 9 | + unsigned int exp:11; | |
| 10 | + unsigned int sig:1; | |
| 11 | + } s; | |
| 12 | + double d; | |
| 13 | +}; | |
| 14 | + | |
| 15 | +double scale(double d) | |
| 16 | +{ | |
| 17 | + union ieee_double_extract x; | |
| 18 | + | |
| 19 | + x.d = d; | |
| 20 | + x.d *= 1000; | |
| 21 | + return x.d; | |
| 22 | +} | |
| 23 | + | |
| 24 | +int | |
| 25 | +main(void) | |
| 26 | +{ | |
| 27 | + printf("%g\n", scale(42)); | |
| 28 | + return 0; | |
| 29 | +} | |
| @@ -0,0 +1 @@ | ||
| 1 | +42000 | |