Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/Walloca-4.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
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; | |
145 | 10 _Bool use_alloca = (((rear_ptr - w) * sizeof (char)) < 4096U); |
11 if (use_alloca) | |
111 | 12 src = (char *) __builtin_alloca ((rear_ptr - w) * sizeof (char)); |
13 else | |
14 src = (char *) __builtin_malloc ((rear_ptr - w) * sizeof (char)); | |
15 return src; | |
16 } | |
145 | 17 |
18 /* { dg-prune-output "-Wreturn-local-addr" } */ |