aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr119131-1.c
blob: c62f702f98c16de4ffdc244abfaaea751b28efeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* { dg-do compile } */
/* { dg-require-effective-target dfp } */
/* PR target/119131 */

typedef __attribute__((__vector_size__ (64))) char C;
typedef __attribute__((__vector_size__ (64))) _Decimal32 D;
int a, b;
_Decimal32 f;
C e;
C c;

void
foo (D d)
{
  d -= *(_Decimal32 *) __builtin_memset (&f, 0, 4);
  b += a;
  if (a)
    b /= 0; /* { dg-warning "division by zero" } */
  c = (C) d + e;
}

void
foo1 (D d)
{
  __builtin_memset (&f, 0, 4);
  d -= *(_Decimal32 *)&f;
  b += a;
  if (a)
    b /= 0;/* { dg-warning "division by zero" } */
  c = (C) d + e;
}