Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx-pr114190.c

raw
1 /* PR rtl-optimization/114190 */
2 /* { dg-do run { target avx } } */
3 /* { dg-options "-O2 -fno-dce -fharden-compares -mavx --param=max-rtl-if-conversion-unpredictable-cost=136 -mno-avx512f -Wno-psabi" } */
4
5 #include "avx-check.h"
6
7 typedef unsigned char U __attribute__((vector_size (64)));
8 typedef unsigned int V __attribute__((vector_size (64)));
9 U u;
10
11 V
12 foo (V a, V b)
13 {
14 u[0] = __builtin_sub_overflow (0, (int) a[0], &a[b[7] & 5]) ? -u[1] : -b[3];
15 b ^= 0 != b;
16 return (V) u + (V) a + (V) b;
17 }
18
19 static void
20 avx_test (void)
21 {
22 V x = foo ((V) { 1 }, (V) { 0, 0, 0, 1 });
23 if (x[0] != -1U)
24 __builtin_abort ();
25 if (x[3] != -2U)
26 __builtin_abort ();
27 }