diff --git a/libtcc.c b/libtcc.c
index 5fb793e0..f2839d2e 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -1997,7 +1997,11 @@ reparse:
             s->filetype = x | (s->filetype & ~AFF_TYPE_MASK);
             break;
         case TCC_OPTION_O:
-            s->optimize = atoi(optarg);
+            /* Use "-O" as alias for "-O1". */
+            /* Other common used values: "-O0", "-O1", "-O2", "-O3" and "-Os" */
+            /* no failure with unsupported options */
+            x = *optarg;
+            s->optimize = isnum(x) ? atoi(optarg) : (x) ? x : 1;
             break;
         case TCC_OPTION_print_search_dirs:
             x = OPT_PRINT_DIRS;
diff --git a/tccpp.c b/tccpp.c
index 6b828c9d..2ff5d5e9 100644
--- a/tccpp.c
+++ b/tccpp.c
@@ -3733,6 +3733,8 @@ static void tcc_predefs(TCCState *s1, CString *cs, int is_asm)
       putdef(cs, "__CHAR_UNSIGNED__");
     if (s1->optimize > 0)
       putdef(cs, "__OPTIMIZE__");
+    if (s1->optimize == 's')
+          putdef(cs, "__OPTIMIZE_SIZE__");
     if (s1->option_pthread)
       putdef(cs, "_REENTRANT");
     if (s1->leading_underscore)