aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2015-07-22 15:26:52 +0000
committerMikael Morin <mikael@gcc.gnu.org>2015-07-22 15:26:52 +0000
commit252207bd03e4e0ba784aa60cdaa9f646ddcb3796 (patch)
tree6feb089ab741f2c76774c419e18c74b1122c02aa /gcc/testsuite
parentbf976c5824620c9d581cebe75fee980d863bca15 (diff)
downloadgcc-252207bd03e4e0ba784aa60cdaa9f646ddcb3796.zip
gcc-252207bd03e4e0ba784aa60cdaa9f646ddcb3796.tar.gz
gcc-252207bd03e4e0ba784aa60cdaa9f646ddcb3796.tar.bz2
Fix r225926's iso_varying_string ICE regression
PR fortran/61831 PR fortran/66929 gcc/fortran/ * trans-array.c (gfc_get_proc_ifc_for_expr): Use esym as procedure symbol if available. gcc/testsuite/ * gfortran.dg/generic_30.f90: New. From-SVN: r226074
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gfortran.dg/generic_30.f9041
2 files changed, 47 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f4eb4c9..fef069d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2015-07-22 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/61831
+ PR fortran/66929
+ * gfortran.dg/generic_30.f90: New.
+
2015-07-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/66952
diff --git a/gcc/testsuite/gfortran.dg/generic_30.f90 b/gcc/testsuite/gfortran.dg/generic_30.f90
new file mode 100644
index 0000000..5f82373
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/generic_30.f90
@@ -0,0 +1,41 @@
+! { dg-do compile }
+!
+! PR fortran/66929
+! Generic procedures as actual argument used to lead to
+! a NULL pointer dereference in gfc_get_proc_ifc_for_expr
+! because the generic symbol was used as procedure symbol,
+! instead of the specific one.
+
+module iso_varying_string
+ type, public :: varying_string
+ character(LEN=1), dimension(:), allocatable :: chars
+ end type varying_string
+ interface operator(/=)
+ module procedure op_ne_VS_CH
+ end interface operator (/=)
+ interface trim
+ module procedure trim_
+ end interface
+contains
+ elemental function op_ne_VS_CH (string_a, string_b) result (op_ne)
+ type(varying_string), intent(in) :: string_a
+ character(LEN=*), intent(in) :: string_b
+ logical :: op_ne
+ op_ne = .true.
+ end function op_ne_VS_CH
+ elemental function trim_ (string) result (trim_string)
+ type(varying_string), intent(in) :: string
+ type(varying_string) :: trim_string
+ trim_string = varying_string(["t", "r", "i", "m", "m", "e", "d"])
+ end function trim_
+end module iso_varying_string
+module syntax_rules
+ use iso_varying_string, string_t => varying_string
+contains
+ subroutine set_rule_type_and_key
+ type(string_t) :: key
+ if (trim (key) /= "") then
+ print *, "non-empty"
+ end if
+ end subroutine set_rule_type_and_key
+end module syntax_rules