PR tree-optimization/33562
[official-gcc.git] / gcc / testsuite / gcc.dg / Walloca-4.c
bloba559534acaa7b908090d8448f0c23f2a3435eb5e
1 /* { dg-do compile } */
2 /* { dg-options "-Walloca-larger-than=5000 -O2" } */
4 char *
5 _i18n_number_rewrite (char *w, char *rear_ptr)
8 char *src;
9 _Bool
10 use_alloca = (((rear_ptr - w) * sizeof (char)) < 4096U);
11 if (use_alloca)
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;