diff options
author | Cesar Philippidis <cesar@codesourcery.com> | 2018-10-08 07:04:45 -0700 |
---|---|---|
committer | Cesar Philippidis <cesar@gcc.gnu.org> | 2018-10-08 07:04:45 -0700 |
commit | ed9984a03070a1be7c5b3815e410e6269ab721e4 (patch) | |
tree | 515d6e71de92b43e587a9721bf2602a68d770d96 /gcc/fortran/expr.c | |
parent | 49108562af2b2c0b96090ed0c6b4abbabb3f9080 (diff) | |
download | gcc-ed9984a03070a1be7c5b3815e410e6269ab721e4.zip gcc-ed9984a03070a1be7c5b3815e410e6269ab721e4.tar.gz gcc-ed9984a03070a1be7c5b3815e410e6269ab721e4.tar.bz2 |
[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
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 |