From: Dale Weiler Date: Mon, 25 Feb 2013 08:52:17 +0000 (+0000) Subject: Push definitions when -O0 X-Git-Tag: before-library~109 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=aebab8b68a52d4beec4fa802c91c45a1648f4ed4;p=xonotic%2Fgmqcc.git Push definitions when -O0 --- diff --git a/gmqcc.h b/gmqcc.h index 206688f..2cc0864 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -1192,6 +1192,7 @@ typedef struct { uint32_t warn_backup [1 + (COUNT_WARNINGS / 32)]; uint32_t werror_backup[1 + (COUNT_WARNINGS / 32)]; uint32_t optimization [1 + (COUNT_OPTIMIZATIONS / 32)]; + bool optimizeoff; /* True when -O0 */ } opts_cmd_t; extern opts_cmd_t opts; diff --git a/ir.c b/ir.c index 5010010..088d70e 100644 --- a/ir.c +++ b/ir.c @@ -3327,7 +3327,9 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc size_t i; int32_t *iptr; prog_section_def def; - bool pushdef = false; + bool pushdef = opts.optimizeoff; + + printf("STATUS: %s\n", (pushdef) ? "OFF" : "ON"); def.type = global->vtype; def.offset = vec_size(code_globals); diff --git a/opts.c b/opts.c index aa923bd..4b76568 100644 --- a/opts.c +++ b/opts.c @@ -142,6 +142,9 @@ void opts_setoptimlevel(unsigned int level) { size_t i; for (i = 0; i < COUNT_OPTIMIZATIONS; ++i) opts_set(opts.optimization, i, level >= opts_opt_oflag[i]); + + if (!level) + opts.optimizeoff = true; } /*