aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2016-01-30 17:44:56 +0000
committerPaul Thomas <pault@gcc.gnu.org>2016-01-30 17:44:56 +0000
commite520d5f02a0cfa5d07a48a14f2b67af63884e9ed (patch)
tree66f16fc94949bc0d5590b9fd23904195383e552e /gcc
parent343c05d39f7fcdf55178853884113715bc7bcc2b (diff)
downloadgcc-e520d5f02a0cfa5d07a48a14f2b67af63884e9ed.zip
gcc-e520d5f02a0cfa5d07a48a14f2b67af63884e9ed.tar.gz
gcc-e520d5f02a0cfa5d07a48a14f2b67af63884e9ed.tar.bz2
re PR fortran/69566 ([OOP] Failure of SELECT TYPE with unlimited polymorphic function result)
2016-01-30 Paul Thomas <pault@gcc.gnu.org> PR fortran/69566 * trans-expr.c (gfc_conv_procedure_call): Correct expression for 'ulim_copy', which was missing a test for 'comp'. 2016-01-30 Paul Thomas <pault@gcc.gnu.org> PR fortran/69566 * gfortran.dg/unlimited_polymorphic_25.f03: New test. From-SVN: r233011
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-expr.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/unlimited_polymorphic_25.f0314
4 files changed, 28 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 386bd42..e4401f7 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2016-01-30 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/69566
+ * trans-expr.c (gfc_conv_procedure_call): Correct expression
+ for 'ulim_copy', which was missing a test for 'comp'.
+
2016-01-28 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/62536
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index c5ae4c5..74f519e 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -4723,8 +4723,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
is the third and fourth argument to such a function call a value
denoting the number of elements to copy (i.e., most of the time the
length of a deferred length string). */
- ulim_copy = formal == NULL && UNLIMITED_POLY (sym)
- && strcmp ("_copy", comp->name) == 0;
+ ulim_copy = (formal == NULL)
+ && UNLIMITED_POLY (sym)
+ && comp && (strcmp ("_copy", comp->name) == 0);
/* Evaluate the arguments. */
for (arg = args, argc = 0; arg != NULL;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3bea4af..df468e1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-30 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/69566
+ * gfortran.dg/unlimited_polymorphic_25.f03: New test.
+
2016-01-30 Martin Sebor <msebor@redhat.com>
PR c++/68490
diff --git a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_25.f03 b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_25.f03
new file mode 100644
index 0000000..0eb9c7a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_25.f03
@@ -0,0 +1,14 @@
+! { dg-do compile }
+!
+! Tests the fix for PR69566, in which a boolean expression testing a
+! the component of a pointer did not check the pointer, resulting in
+! the ICE.
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+!
+ print *, associated(return_pointer()) ! ICE
+contains
+ function return_pointer()
+ class(*), pointer :: return_pointer(:)
+ end function
+end