On Thu, 5 Feb 2026, Richard Biener wrote:

> On Thu, 5 Feb 2026, Josef Melcr wrote:
> 
> > Hi,
> > 
> > I cvise'd the reproducer from the PR, would this be acceptable as a 
> > testcase?
> > Not sure if it's placed correctly.
> 
> Sure, if you have sth reasonably small I can also try to sanitize
> it to be "proper" fortran.

Ah, I missed the attachment.  The testcase looks fine, I've adjusted
the testsuite boilerplate to

+! { dg-additional-options "-Ofast -mavx512f" { target avx512f } }

to make it not fail on other archs and pushed it as below.

Thanks,
Richard.

>From 218d6309c22b470cb3844f347f483567c3d542d4 Mon Sep 17 00:00:00 2001
From: Richard Biener <[email protected]>
Date: Thu, 5 Feb 2026 15:21:00 +0100
Subject: [PATCH] testsuite: Add testcase for PR123986
To: [email protected]

From: Josef Melcr <[email protected]>

This patch add a missing testcase cvise-reduced
testcase for PR123986.

        PR tree-optimization/123986

gcc/testsuite/ChangeLog:

        * gfortran.dg/vect/pr123986.f90: New test.

Signed-off-by: Josef Melcr <[email protected]>
---
 gcc/testsuite/gfortran.dg/vect/pr123986.f90 | 36 +++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 gcc/testsuite/gfortran.dg/vect/pr123986.f90

diff --git a/gcc/testsuite/gfortran.dg/vect/pr123986.f90 
b/gcc/testsuite/gfortran.dg/vect/pr123986.f90
new file mode 100644
index 00000000000..1d0000ab9b8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/vect/pr123986.f90
@@ -0,0 +1,36 @@
+! { dg-do compile }
+! { dg-additional-options "-Ofast -mavx512f" { target avx512f } }
+
+MODULE bulk_cloud_model_mod
+  INTEGER, PARAMETER ::  wp  = KIND(1.0D0)
+  INTEGER, PARAMETER ::  nzt = 1
+  REAL, PARAMETER ::  df_crit  = 100.0E-6
+  TYPE cloud_coefficients
+     REAL(wp) a
+     REAL(wp) b
+  END TYPE 
+  TYPE cloud_species_def
+     TYPE(cloud_coefficients) cloud
+     TYPE(cloud_coefficients) graupel
+  END TYPE 
+  TYPE(cloud_species_def) cloud_species
+CONTAINS
+  SUBROUTINE riming_graupel_cloud
+    REAL(wp) dc
+    REAL(wp) dg
+    REAL(wp) xc
+    REAL(wp) xg
+    DO  k = 1, nzt
+       dg = mean_diameter( cloud_species%graupel,  xg )
+       dc = mean_diameter( cloud_species%cloud,    xc )
+       IF ( dc > dc_crit  .AND.  dg > df_crit )  THEN
+          riming_rate_n =   nc_c ( rime_graupel_cloud_delta_n_aa * dg**2 + dg 
* dc * dc**2 )                                    
+       ENDIF
+    ENDDO
+  END  
+  FUNCTION mean_diameter( specie, particle_mean_mass )
+    CLASS(cloud_coefficients)   specie
+    REAL(wp)   particle_mean_mass
+    mean_diameter = specie%a * particle_mean_mass**specie%b
+  END  
+END 
-- 
2.51.0

Reply via email to