Summary: | All type parameters shall be identical in a POINTER assignment | ||
---|---|---|---|
Product: | gcc | Reporter: | Joost VandeVondele <Joost.VandeVondele> |
Component: | fortran | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs, tobi |
Priority: | P2 | Keywords: | accepts-invalid |
Version: | 4.1.0 | ||
Target Milestone: | 4.1.0 | ||
Host: | Target: | i686-pc-linux-gnu | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2006-01-08 06:11:54 | |
Bug Depends on: | |||
Bug Blocks: | 19276 |
Description
Joost VandeVondele
2005-04-08 16:04:27 UTC
I don't think so, I'm sure this code is valid, but I believe you know the standard well enough to justify your statement. Well, don't know the standard reference, but the Sun compiler does error out on this code. I am going to go out on a limb and say this is invalid so confirmed. Length is a type parameter. All type parameters shall be identical in a POINTER assignment. Hence the example is illegal. This means that bound checking should reject the following for i /= 5: character*5, pointer :: p character*10, target :: t p => t(1:i) Subject: Bug 20895 Author: pault Date: Sun Jan 29 06:08:07 2006 New Revision: 110365 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110365 Log: 2006-01-28 Paul Thomas <pault@gcc.gnu.org> PR fortran/17911 * expr.c (gfc_check_assign, gfc_check_pointer_assign): Emit error if the lvalue is a use associated procedure. PR fortran/20895 PR fortran/25030 * expr.c (gfc_check_pointer_assign): Emit error if lvalue and rvalue character lengths are not the same. Use gfc_dep_compare_expr for the comparison. * gfortran.h: Add prototype for gfc_dep_compare_expr. * dependency.h: Remove prototype for gfc_dep_compare_expr. 2006-01-29 Paul Thomas <pault@gcc.gnu.org> PR fortran/17911 * gfortran.dg/procedure_lvalue.f90: New test. PR fortran/20895 PR fortran/25030 * gfortran.dg/char_pointer_assign_2.f90: New test. * gfortran.dg/char_result_1.f90: Correct unequal charlen pointer assignment to be consistent with standard. * gfortran.dg/char_result_2.f90: The same. * gfortran.dg/char_result_8.f90: The same. Added: trunk/gcc/testsuite/gfortran.dg/char_pointer_assign_2.f90 trunk/gcc/testsuite/gfortran.dg/procedure_lvalue.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/dependency.h trunk/gcc/fortran/expr.c trunk/gcc/fortran/gfortran.h trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/char_result_1.f90 trunk/gcc/testsuite/gfortran.dg/char_result_2.f90 trunk/gcc/testsuite/gfortran.dg/char_result_8.f90 Subject: Bug 20895 Author: pault Date: Mon Jan 30 05:45:06 2006 New Revision: 110394 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110394 Log: 2006-01-30 Paul Thomas <pault@gcc.gnu.org> PR fortran/18578 PR fortran/18579 PR fortran/20857 PR fortran/20885 * interface.c (compare_actual_formal): Error for INTENT(OUT or INOUT) if actual argument is not a variable. PR fortran/17911 * expr.c (gfc_check_assign, gfc_check_pointer_assign): Emit error if the lvalue is a use associated procedure. PR fortran/20895 PR fortran/25030 * expr.c (gfc_check_pointer_assign): Emit error if lvalue and rvalue character lengths are not the same. Use gfc_dep_compare_expr for the comparison. * gfortran.h: Add prototype for gfc_dep_compare_expr. * dependency.h: Remove prototype for gfc_dep_compare_expr. 2006-01-30 Paul Thomas <pault@gcc.gnu.org> PR fortran/18578 PR fortran/18579 PR fortran/20857 PR fortran/20885 * gfortran.dg/intent_out_1.f90: New test. PR fortran/17911 * gfortran.dg/procedure_lvalue.f90: New test. PR fortran/20895 PR fortran/25030 * gfortran.dg/char_pointer_assign_2.f90: New test. * gfortran.dg/char_result_1.f90: Correct unequal charlen pointer assignment to be consistent with standard. * gfortran.dg/char_result_2.f90: The same. * gfortran.dg/char_result_8.f90: The same. Added: branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/char_pointer_assign_2.f90 branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/intent_out_1.f90 branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/procedure_lvalue.f90 Modified: branches/gcc-4_1-branch/gcc/fortran/ChangeLog branches/gcc-4_1-branch/gcc/fortran/dependency.h branches/gcc-4_1-branch/gcc/fortran/expr.c branches/gcc-4_1-branch/gcc/fortran/gfortran.h branches/gcc-4_1-branch/gcc/fortran/interface.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/char_result_1.f90 branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/char_result_2.f90 branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/char_result_8.f90 Fixed on trunk and 4.1. Paul |