gcc/analyzer/ChangeLog:
PR analyzer/97668
* svalue.cc (cmp_cst): Handle COMPLEX_CST.
gcc/testsuite/ChangeLog:
PR analyzer/97668
* gcc.dg/analyzer/pr97668.c: New test.
* gfortran.dg/analyzer/pr97668.f: New test.
return memcmp (TREE_REAL_CST_PTR (cst1),
TREE_REAL_CST_PTR (cst2),
sizeof (real_value));
+ case COMPLEX_CST:
+ if (int cmp_real = cmp_cst (TREE_REALPART (cst1), TREE_REALPART (cst2)))
+ return cmp_real;
+ return cmp_cst (TREE_IMAGPART (cst1), TREE_IMAGPART (cst2));
case VECTOR_CST:
if (int cmp_log2_npatterns
= ((int)VECTOR_CST_LOG2_NPATTERNS (cst1)
--- /dev/null
+/* { dg-additional-options "-O1" } */
+
+void
+wb (_Complex double jh)
+{
+ _Complex double af = 0.0;
+
+ do
+ {
+ af += jh;
+ }
+ while (af != 0.0);
+}
+
+_Complex double
+o6 (void)
+{
+ _Complex double ba = 0.0;
+
+ for (;;)
+ {
+ wb (ba);
+ ba = 1.0;
+ }
+
+ return ba;
+}
--- /dev/null
+c { dg-additional-options "-std=legacy" }
+
+ SUBROUTINE PPADD (A, C, BH)
+
+ COMPLEX DD, FP, FPP, R1, R2
+ DIMENSION A(*), C(*), BH(*)
+
+ DO 136 IG=IS,1
+ FP = (0.,0.)
+ FPP = (0.,0.)
+
+ DO 121 J=1,1
+ DD = 1./2
+ FP = DD
+ FPP = DD+1
+ 121 CONTINUE
+
+ R2 = -FP
+ IF (ABS(R1)-ABS(R2)) 129,129,133
+ 129 R1 = R2/FPP
+ 133 IT = IT+1
+
+ 136 CONTINUE
+
+ RETURN
+ END