trans-expr.c (gfc_conv_string_tmp): Check type compatibility instead of equality.
authorMichael Matz <matz@suse.de>
Thu, 20 Aug 2009 14:25:36 +0000 (14:25 +0000)
committerMichael Matz <matz@gcc.gnu.org>
Thu, 20 Aug 2009 14:25:36 +0000 (14:25 +0000)
fortran/
        * trans-expr.c (gfc_conv_string_tmp): Check type compatibility
        instead of equality.

testsuite/
        * gfortran.dg/pr41126.f90: New test.

From-SVN: r150964

gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr41126.f90 [new file with mode: 0644]

index 9ba0989..3a8dd03 100644 (file)
@@ -1,3 +1,9 @@
+2009-08-20  Michael Matz  <matz@suse.de>
+
+       PR fortran/41126
+       * trans-expr.c (gfc_conv_string_tmp): Check type compatibility
+       instead of equality.
+
 2009-08-20  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/41121
index 7672f0b..c2c1f0f 100644 (file)
@@ -1104,7 +1104,7 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len)
   tree var;
   tree tmp;
 
-  gcc_assert (TREE_TYPE (len) == gfc_charlen_type_node);
+  gcc_assert (types_compatible_p (TREE_TYPE (len), gfc_charlen_type_node));
 
   if (gfc_can_put_var_on_stack (len))
     {
index cf6d2e5..d5957e7 100644 (file)
@@ -1,3 +1,8 @@
+2009-08-20  Michael Matz  <matz@suse.de>
+
+       PR fortran/41126
+       * gfortran.dg/pr41126.f90: New test.
+
 2009-08-20  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/dynamic_bound.adb: New test.
diff --git a/gcc/testsuite/gfortran.dg/pr41126.f90 b/gcc/testsuite/gfortran.dg/pr41126.f90
new file mode 100644 (file)
index 0000000..a43758e
--- /dev/null
@@ -0,0 +1,6 @@
+! { dg-do compile }
+SUBROUTINE write_cputime( checkpoint  )
+  CHARACTER(LEN=*), INTENT(IN)             :: checkpoint
+  CHARACTER(LEN=LEN_TRIM(checkpoint)+7)    :: string1
+    string1 = ADJUSTL(string1)
+END SUBROUTINE write_cputime