From 09feeca5dffd3d369a8996ef68f66334d4d2c637 Mon Sep 17 00:00:00 2001 From: seyko Date: Tue, 3 Mar 2015 15:29:14 +0300 Subject: [PATCH] a statement expressions with a pointer return type A test program: ////////////// int main() { void *p = ({ 0 ; ((void *)1); }); } ///////////// Porblem is introduced in a commit a80acab: Display error on statement expressions with complex return type This error is exposed when compiling a linux 2.4.26. tcc 0.9.23 can sucessfully compile this version of the linux. --- tccgen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tccgen.c b/tccgen.c index 41cc6da1..5556f85b 100644 --- a/tccgen.c +++ b/tccgen.c @@ -4761,7 +4761,11 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, triggered by gcc.c-torture/execute/20000917-1.c */ Sym *p; switch(vtop->type.t & VT_BTYPE) { - case VT_PTR: + /* case VT_PTR: */ + /* this breaks a compilation of the linux kernel v2.4.26 */ + /* pmd_t *new = ({ __asm__ __volatile__("ud2\n") ; ((pmd_t *)1); }); */ + /* Look a commit a80acab: Display error on statement expressions with complex return type */ + /* A pointer is not a complex return type */ case VT_STRUCT: case VT_ENUM: case VT_FUNC: -- 2.11.4.GIT