diff options
| author | Quentin Carbonneaux <[email protected]> | 2022-12-18 17:35:19 +0100 |
|---|---|---|
| committer | Quentin Carbonneaux <[email protected]> | 2022-12-25 16:37:33 +0100 |
| commit | 5e9726946dcb9248dbd34ded1bdd4f7af8dc2d31 (patch) | |
| tree | 9842f9837784911e386357af18b08a2ca1b69896 /all.h | |
| parent | c5cd65261e05029889450ca27050785504164853 (diff) | |
new UNDEF Ref
Crashing loads of uninitialized memory
proved to be a problem when implementing
unions using qbe. This patch introduces
a new UNDEF Ref to represent data that is
known to be uninitialized. Optimization
passes can make use of it to eliminate
some code. In the last compilation stages,
UNDEF is treated as the constant 0xdeaddead.
Diffstat (limited to 'all.h')
| -rw-r--r-- | all.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -90,10 +90,11 @@ enum { RMem, }; -#define R (Ref){0, 0} +#define R (Ref){RTmp, 0} +#define UNDEF (Ref){RCon, 0} /* represents uninitialized data */ +#define CON_Z (Ref){RCon, 1} #define TMP(x) (Ref){RTmp, x} #define CON(x) (Ref){RCon, x} -#define CON_Z CON(0) /* reserved zero constant */ #define SLOT(x) (Ref){RSlot, (x)&0x1fffffff} #define TYPE(x) (Ref){RType, x} #define CALL(x) (Ref){RCall, x} |
