This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Fix PR41126
- From: Michael Matz <matz at suse dot de>
- To: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Thu, 20 Aug 2009 16:17:35 +0200 (CEST)
- Subject: Fix PR41126
Hi,
some fallout of different "equal" integer types with different alias
sets. I chose to relax the assert instead of removing it alltogether.
Tested by building frontend and libgfortran and check-fortran on
x86_64-linux. No regressions and testcase is fixed. Okay for trunk?
Ciao,
Michael.
--
fortran/
* trans-expr.c (gfc_conv_string_tmp): Check type compatibility
instead of equality.
testsuite/
* gfortran.dg/pr41126.f90: New test.
Index: fortran/trans-expr.c
===================================================================
--- fortran/trans-expr.c (revision 150934)
+++ fortran/trans-expr.c (working copy)
@@ -1104,7 +1104,7 @@ gfc_conv_string_tmp (gfc_se * se, tree t
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: testsuite/gfortran.dg/pr41126.f90
===================================================================
--- testsuite/gfortran.dg/pr41126.f90 (revision 0)
+++ testsuite/gfortran.dg/pr41126.f90 (revision 0)
@@ -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