From 5c862a08b49e36447f4689b2df1ac9648118a1d6 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Thu, 31 Jan 2019 00:37:49 +0100 Subject: [PATCH] suppress code after continue as well fix an oversight in code suppression --- tccgen.c | 2 +- tests/tcctest.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tccgen.c b/tccgen.c index 20f85d5..1a75aba 100644 --- a/tccgen.c +++ b/tccgen.c @@ -6275,6 +6275,7 @@ static void block(int *bsym, int *csym, int is_expr) *csym = gjmp(*csym); next(); skip(';'); + nocode_wanted |= 0x20000000; } else if (tok == TOK_FOR) { int e; int saved_nocode_wanted; @@ -7670,7 +7671,6 @@ found: } next(); } - ad.a.aligned = 0; } } return 0; diff --git a/tests/tcctest.c b/tests/tcctest.c index 3dc9f1d..940e7d0 100644 --- a/tests/tcctest.c +++ b/tests/tcctest.c @@ -1374,6 +1374,12 @@ void optimize_out(void) printf("ool6:%d\n", defined_function()); goto breakhere; } + j = 1; + while (j) { + j--; + continue; + printf("ool7:%d\n", undefined_function()); + } /* Test that constants in logical && are optimized: */ i = 0 && undefined_function();