1 /* PR middle-end/80020 - gcc confused about aligned_alloc argument order 2 { dg-do compile } 3 { dg-options "-O2 -Wall -fdump-tree-optimized" } */ 4 5 void sink (void*); 6 foo(void)7void foo (void) 8 { 9 enum { 10 Align = 32, 11 Size = 123 12 }; 13 14 void *p = __builtin_aligned_alloc (Align, Size); 15 unsigned n = __builtin_object_size (p, 0); 16 17 if (n != Size) 18 __builtin_abort (); 19 20 __builtin___memset_chk (p, 0, Size, n); 21 22 sink (p); 23 } 24 25 /* { dg-final { scan-tree-dump-not "abort" "optimized" } } 26 { dg-final { scan-tree-dump-not "memset_chk" "optimized" } } */ 27