From: Wolfgang Bumiller Date: Sat, 12 Jan 2013 13:02:45 +0000 (+0100) Subject: mask -Olocal-temps by IR_FLAG_MASK_NO_LOCAL_TEMPS which now equals IR_FLAG_MASK_NO_OV... X-Git-Tag: before-library~289 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e8b5ad66251e2bd0e141a1a233a98570224c6ffb;p=xonotic%2Fgmqcc.git 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 --- diff --git a/ir.c b/ir.c index bd8f12f..0de1510 100644 --- a/ir.c +++ b/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; } diff --git a/ir.h b/ir.h index c2c94a1..a15607c 100644 --- a/ir.h +++ b/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*);