Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/Walloca-4.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
rev | line source |
---|---|
111 | 1 /* { dg-do compile } */ |
2 /* { dg-require-effective-target alloca } */ | |
3 /* { dg-options "-Walloca-larger-than=5000 -O2" } */ | |
4 | |
5 char * | |
6 _i18n_number_rewrite (char *w, char *rear_ptr) | |
7 { | |
8 | |
9 char *src; | |
10 _Bool | |
11 use_alloca = (((rear_ptr - w) * sizeof (char)) < 4096U); | |
12 if (use_alloca) | |
13 src = (char *) __builtin_alloca ((rear_ptr - w) * sizeof (char)); | |
14 else | |
15 src = (char *) __builtin_malloc ((rear_ptr - w) * sizeof (char)); | |
16 return src; | |
17 } |