From ed9984a03070a1be7c5b3815e410e6269ab721e4 Mon Sep 17 00:00:00 2001 From: Cesar Philippidis Date: Mon, 8 Oct 2018 07:04:45 -0700 Subject: [Fortran] Disable "Assignment to contiguous pointer from non-contiguous target" error gcc/fortran/ * expr.c (gfc_check_pointer_assign): Demote "Assignment to contiguous pointer from non-contiguous target" to a warning. gcc/testsuite/ * gfortran.dg/contiguous_4.f90: Adjust. * gfortran.dg/contiguous_4.f90: New test. From-SVN: r264928 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/expr.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c4c14f8..6fc3857 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2018-10-08 Cesar Philippidis + + * expr.c (gfc_check_pointer_assign): Demote "Assignment to + contiguous pointer from non-contiguous target" to a warning. + 2018-10-08 Paul Thomas PR fortran/86372 diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 3315bb8..1cfda5f 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -3957,13 +3957,13 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) } } - /* Error for assignments of contiguous pointers to targets which is not + /* Warn for assignments of contiguous pointers to targets which is not contiguous. Be lenient in the definition of what counts as contiguous. */ if (lhs_attr.contiguous && !gfc_is_simply_contiguous (rvalue, false, true)) - gfc_error ("Assignment to contiguous pointer from non-contiguous " - "target at %L", &rvalue->where); + gfc_warning (OPT_Wextra, "Assignment to contiguous pointer from " + "non-contiguous target at %L", &rvalue->where); /* Warn if it is the LHS pointer may lives longer than the RHS target. */ if (warn_target_lifetime -- cgit v1.1