Some headers and source code change macros and implementation, when __OPTIMIZE_SIZE__ is defined. This does not change our generated code.
Unified · Split
| @@ -1997,7 +1997,11 @@ reparse: · 1996 unmodified lines | |||
| 1997 | s->filetype = x | (s->filetype & ~AFF_TYPE_MASK); | 1997 | s->filetype = x | (s->filetype & ~AFF_TYPE_MASK); |
| 1998 | break; | 1998 | break; |
| 1999 | case TCC_OPTION_O: | 1999 | case TCC_OPTION_O: |
| 2000 | s->optimize = atoi(optarg); | 2000 | /* Use "-O" as alias for "-O1". */ |
| 2001 | /* Other common used values: "-O0", "-O1", "-O2", "-O3" and "-Os" */ | ||
| 2002 | /* no failure with unsupported options */ | ||
| 2003 | x = *optarg; | ||
| 2004 | s->optimize = isnum(x) ? atoi(optarg) : (x) ? x : 1; | ||
| 2001 | break; | 2005 | break; |
| 2002 | case TCC_OPTION_print_search_dirs: | 2006 | case TCC_OPTION_print_search_dirs: |
| 2003 | x = OPT_PRINT_DIRS; | 2007 | x = OPT_PRINT_DIRS; |
| @@ -3733,6 +3733,8 @@ static void tcc_predefs(TCCState *s1, CString *cs, int is_asm) · 3732 unmodified lines | |||
| 3733 | putdef(cs, "__CHAR_UNSIGNED__"); | 3733 | putdef(cs, "__CHAR_UNSIGNED__"); |
| 3734 | if (s1->optimize > 0) | 3734 | if (s1->optimize > 0) |
| 3735 | putdef(cs, "__OPTIMIZE__"); | 3735 | putdef(cs, "__OPTIMIZE__"); |
| 3736 | if (s1->optimize == 's') | ||
| 3737 | putdef(cs, "__OPTIMIZE_SIZE__"); | ||
| 3736 | if (s1->option_pthread) | 3738 | if (s1->option_pthread) |
| 3737 | putdef(cs, "_REENTRANT"); | 3739 | putdef(cs, "_REENTRANT"); |
| 3738 | if (s1->leading_underscore) | 3740 | if (s1->leading_underscore) |