This reverts commit e3e5d4ad7a475e30ea13ad1ba9f23e6210d5d431.
Unified · Split
| @@ -3162,21 +3162,17 @@ static void post_type(CType *type, AttributeDef *ad) · 3161 unmodified lines | ||
| 3162 | 3162 | n = -1; |
| 3163 | 3163 | if (tok != ']') { |
| 3164 | 3164 | gexpr(); |
| 3165 | −#ifdef TOK_alloca | |
| 3166 | 3165 | if ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST) { |
| 3167 | −#endif | |
| 3168 | 3166 | n = vtop->c.i; |
| 3169 | 3167 | last_vtop = vtop; |
| 3170 | 3168 | if (n < 0) |
| 3171 | 3169 | error("invalid array size"); |
| 3172 | −#ifdef TOK_alloca | |
| 3173 | 3170 | } else { |
| 3174 | 3171 | if (!is_integer_btype(vtop->type.t & VT_BTYPE)) |
| 3175 | 3172 | error("size of variable length array should be an integer"); |
| 3176 | 3173 | type->t |= VT_VLA; |
| 3177 | 3174 | last_vtop = vtop; |
| 3178 | 3175 | } |
| 3179 | −#endif | |
| 3180 | 3176 | } |
| 3181 | 3177 | skip(']'); |
| 3182 | 3178 | /* parse next post type */ |
| @@ -4868,11 +4864,7 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, · 1685 unmodified lines | ||
| 4868 | 4864 | int a; |
| 4869 | 4865 | CValue retcval; |
| 4870 | 4866 | |
| 4871 | −/* No need to coment all the block as it will never be called without | |
| 4872 | − TOK_alloca defined (See ifdef TOK_alloca stanza in post_type */ | |
| 4873 | −#ifdef TOK_alloca | |
| 4874 | 4867 | vpush_global_sym(&func_old_type, TOK_alloca); |
| 4875 | −#endif | |
| 4876 | 4868 | vla_runtime_type_size(type, &a); |
| 4877 | 4869 | gfunc_call(1); |
| 4878 | 4870 | |
| @@ -2010,7 +2010,7 @@ void old_style_function(void) · 2009 unmodified lines | ||
| 2010 | 2010 | |
| 2011 | 2011 | void alloca_test() |
| 2012 | 2012 | { |
| 2013 | −#ifdef TOK_alloca | |
| 2013 | +#if defined __i386__ || defined __x86_64__ | |
| 2014 | 2014 | char *p = alloca(16); |
| 2015 | 2015 | strcpy(p,"123456789012345"); |
| 2016 | 2016 | printf("alloca: p is %s\n", p); |
| @@ -2022,7 +2022,7 @@ void alloca_test() · 5 unmodified lines | ||
| 2022 | 2022 | |
| 2023 | 2023 | void c99_vla_test(int size1, int size2) |
| 2024 | 2024 | { |
| 2025 | −#ifdef TOK_alloca | |
| 2025 | +#if defined __i386__ || defined __x86_64__ | |
| 2026 | 2026 | int tab1[size1 * size2][2], tab2[10][2]; |
| 2027 | 2027 | void *tab1_ptr, *tab2_ptr; |
| 2028 | 2028 | |