mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-31 03:50:36 +00:00
mask -Olocal-temps by IR_FLAG_MASK_NO_LOCAL_TEMPS which now equals IR_FLAG_MASK_NO_OVERLAP - though HAS_ARRAYS usually suffices, but not for code which _depends_ on uninitialized variables
This commit is contained in:
parent
2a4ea74a97
commit
e8b5ad6625
2 changed files with 3 additions and 2 deletions
2
ir.c
2
ir.c
|
@ -2204,7 +2204,7 @@ bool ir_function_allocate_locals(ir_function *self)
|
|||
for (i = 0; i < vec_size(self->locals); ++i)
|
||||
{
|
||||
v = self->locals[i];
|
||||
if (!OPTS_OPTIMIZATION(OPTIM_LOCAL_TEMPS)) {
|
||||
if ((self->flags & IR_FLAG_MASK_NO_LOCAL_TEMPS) || !OPTS_OPTIMIZATION(OPTIM_LOCAL_TEMPS)) {
|
||||
v->locked = true;
|
||||
v->unique_life = true;
|
||||
}
|
||||
|
|
3
ir.h
3
ir.h
|
@ -281,7 +281,8 @@ typedef struct ir_function_s
|
|||
#define IR_FLAG_HAS_UNINITIALIZED (1<<2)
|
||||
#define IR_FLAG_HAS_GOTO (1<<3)
|
||||
#define IR_FLAG_INCLUDE_DEF (1<<4)
|
||||
#define IR_FLAG_MASK_NO_OVERLAP (IR_FLAG_HAS_ARRAYS | IR_FLAG_HAS_UNINITIALIZED)
|
||||
#define IR_FLAG_MASK_NO_OVERLAP (IR_FLAG_HAS_ARRAYS | IR_FLAG_HAS_UNINITIALIZED)
|
||||
#define IR_FLAG_MASK_NO_LOCAL_TEMPS (IR_FLAG_HAS_ARRAYS | IR_FLAG_HAS_UNINITIALIZED)
|
||||
|
||||
ir_function* ir_function_new(struct ir_builder_s *owner, int returntype);
|
||||
void ir_function_delete(ir_function*);
|
||||
|
|
Loading…
Reference in a new issue