]> git.sur5r.net Git - cc65/blobdiff - src/cc65/compile.c
Make the -O and --codesize options stackable.
[cc65] / src / cc65 / compile.c
index 7edd3ae1786df2d5ca7212a4329af3af498adfab..1870b9a1c33ccc2b46cb1c48472faca70eb8a2bd 100644 (file)
@@ -295,10 +295,11 @@ void Compile (const char* FileName)
      * IS_Get functions access the values in effect now, regardless of any
      * changes using #pragma later.
      */
-    if (Optimize) {
+    if (IS_Get (&Optimize)) {  
+        long CodeSize = IS_Get (&CodeSizeFactor);
        DefineNumericMacro ("__OPT__", 1);
-       if (FavourSize == 0) {
-           DefineNumericMacro ("__OPT_i__", 1);
+               if (CodeSize > 100) {
+           DefineNumericMacro ("__OPT_i__", CodeSize);
        }
        if (IS_Get (&EnableRegVars)) {
            DefineNumericMacro ("__OPT_r__", 1);