]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
-Olocaltemps -> -Olocal-temps for consistency; added manpage entry; removed leftover...
authorWolfgang Bumiller <blub@speed.at>
Sun, 23 Dec 2012 20:39:04 +0000 (21:39 +0100)
committerWolfgang Bumiller <blub@speed.at>
Sun, 23 Dec 2012 20:39:23 +0000 (21:39 +0100)
doc/gmqcc.1
ir.c
opts.def

index 38b6fe1b99facb124a97953dd1213056a08166fc..474ec518d683782a4db1a202ca34cb66a3ba7fd5 100644 (file)
@@ -244,10 +244,6 @@ token inside the enclosing attribute-brackets. This may change when
 the actual attribute syntax is better defined.
 .SH COMPILE FLAGS
 .TP
 the actual attribute syntax is better defined.
 .SH COMPILE FLAGS
 .TP
-.B -foverlap-locals
-Allow local variables to overlap with each other if they don't
-interfer with each other. (Not implemented right now)
-.TP
 .B -fdarkplaces-string-table-bug
 Add some additional characters to the string table in order to
 compensate for a wrong boundcheck in some specific version of the
 .B -fdarkplaces-string-table-bug
 Add some additional characters to the string table in order to
 compensate for a wrong boundcheck in some specific version of the
@@ -358,6 +354,14 @@ as long as the functions cannot be called in a recursive manner. Since
 it's hard to know whether or not an array is actually fully
 initialized, especially when initializing it via a loop, we assume
 functions with arrays to be too dangerous for this optimization.
 it's hard to know whether or not an array is actually fully
 initialized, especially when initializing it via a loop, we assume
 functions with arrays to be too dangerous for this optimization.
+.TP
+.B -Olocal-temps
+This promotes locally declared variables to "temps". Meaning when a
+temporary result of an operation has to be stored somewhere, a local
+variable which is not 'alive' at that point can be used to keep the
+result. This can reduce the size of the global section.
+This will not have declared variables overlap, even if it was
+possible.
 .SH CONFIG
 The configuration file is similar to regular .ini files. Comments
 start with hashtags or semicolons, sections are written in square
 .SH CONFIG
 The configuration file is similar to regular .ini files. Comments
 start with hashtags or semicolons, sections are written in square
diff --git a/ir.c b/ir.c
index caf84381e315c34ca6bd73c49618af9d359b0680..ce98e6c252c49bf340f261862c5e597f0f2c313c 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -2127,7 +2127,7 @@ bool ir_function_allocate_locals(ir_function *self)
 
     for (i = 0; i < vec_size(self->locals); ++i)
     {
 
     for (i = 0; i < vec_size(self->locals); ++i)
     {
-        if (!OPTS_OPTIMIZATION(OPTIM_LOCALTEMPS))
+        if (!OPTS_OPTIMIZATION(OPTIM_LOCAL_TEMPS))
             self->locals[i]->unique_life = true;
         if (!function_allocator_alloc(&alloc, self->locals[i]))
             goto error;
             self->locals[i]->unique_life = true;
         if (!function_allocator_alloc(&alloc, self->locals[i]))
             goto error;
index c1532408eb167454422b68dce621594b3cabf67b..e8d41cb8bac265e55e450fcec30e5e80f68ace2b 100644 (file)
--- a/opts.def
+++ b/opts.def
@@ -79,7 +79,7 @@
 
 #ifdef GMQCC_TYPE_OPTIMIZATIONS
     GMQCC_DEFINE_FLAG(PEEPHOLE,       1)
 
 #ifdef GMQCC_TYPE_OPTIMIZATIONS
     GMQCC_DEFINE_FLAG(PEEPHOLE,       1)
-    GMQCC_DEFINE_FLAG(LOCALTEMPS,     1)
+    GMQCC_DEFINE_FLAG(LOCAL_TEMPS,    3)
     GMQCC_DEFINE_FLAG(TAIL_RECURSION, 1)
     GMQCC_DEFINE_FLAG(TAIL_CALLS,     2)
     GMQCC_DEFINE_FLAG(OVERLAP_LOCALS, 3)
     GMQCC_DEFINE_FLAG(TAIL_RECURSION, 1)
     GMQCC_DEFINE_FLAG(TAIL_CALLS,     2)
     GMQCC_DEFINE_FLAG(OVERLAP_LOCALS, 3)