[PATCH, testsuite]: Add fortran testcase for PR 36680

Uros Bizjak ubizjak@gmail.com
Sun Sep 2 08:09:00 GMT 2012


Hello!

The testcase failed to compile with 4.4 with spill failure, but
compiles OK with 4.6+. Attached patch adds the test to gcc testsuite,
so the bug can be closed.

2012-09-02  Dominique Dhumieres  <dominiq@lps.ens.fr>
	    Uros Bizjak  <ubizjak@gmail.com>

	PR target/36680
	* gfortran.dg/pr36680.f90: New test.

Tested on x86_64-pc-linux-gnu {,-m32} and committed to mainline SVN.

Uros.
-------------- next part --------------
Index: gfortran.dg/pr36680.f90
===================================================================
--- gfortran.dg/pr36680.f90	(revision 0)
+++ gfortran.dg/pr36680.f90	(working copy)
@@ -0,0 +1,43 @@
+! PR target/36680
+! { dg-do compile { target i?86-*-* x86_64-*-* } }
+! { dg-options "-O1 -fschedule-insns" }
+
+MODULE class_dummy_atom_kdtree_types
+  TYPE dummy_atom_kdtree_data
+    INTEGER :: dummy
+  END TYPE
+
+  TYPE :: dummy_atom_kdtree_node
+    TYPE(dummy_atom_kdtree_node_private), POINTER :: p
+  END TYPE
+
+  TYPE :: dummy_atom_kdtree_node_private
+    TYPE(dummy_atom_kdtree_data)                  :: data
+  END TYPE
+
+  TYPE :: dummy_atom_kdtree
+    TYPE(dummy_atom_kdtree_node) :: root
+  END TYPE
+END MODULE
+
+FUNCTION dummy_atom_kdtree_insert(this, item)
+  USE class_dummy_atom_kdtree_types
+
+  TYPE(dummy_atom_kdtree), INTENT(inout)   :: this
+  TYPE(dummy_atom_kdtree_data), INTENT(in) :: item
+
+  TYPE(dummy_atom_kdtree_node) :: parent, current
+  INTEGER :: cmp, level, discriminator
+
+  parent        = dummy_atom_kdtree_node(null())
+  current       = this%root
+  level         = 1
+  discriminator = 1
+
+  DO WHILE (ASSOCIATED( current%p ))
+    discriminator = MODULO(level-1, 3) + 1
+    cmp = dummy_atom_kdtree_data_compare(item, current%p%data, discriminator)
+    level   = level + 1
+  END DO
+
+END FUNCTION


More information about the Fortran mailing list