diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2007-02-04 22:33:10 +0100 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-02-04 21:33:10 +0000 |
commit | a14fb6faeb27b26cdacea6f4c5f3d121ae540d7e (patch) | |
tree | fd54893bee97669ebd4effe1e61628b8994d390c /libgfortran | |
parent | 8135cfa844ab2f7a33fc300eff2917f6fbb51e8c (diff) | |
download | gcc-a14fb6faeb27b26cdacea6f4c5f3d121ae540d7e.zip gcc-a14fb6faeb27b26cdacea6f4c5f3d121ae540d7e.tar.gz gcc-a14fb6faeb27b26cdacea6f4c5f3d121ae540d7e.tar.bz2 |
re PR fortran/30611 ([4.1 only] Confusing error message for negative ncopies in REPEAT)
PR fortran/30611
* trans-intrinsic.c (gfc_conv_intrinsic_repeat): Evaluate
arguments only once. Generate check that NCOPIES argument is not
negative.
* intrinsics/string_intrinsics.c (string_repeat): Don't check
if ncopies is negative.
* gcc/testsuite/gfortran.dg/repeat_1.f90: New test.
From-SVN: r121581
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/intrinsics/string_intrinsics.c | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 48b7e94..428d49a4 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,5 +1,11 @@ 2007-02-04 Francois-Xavier Coudert <coudert@clipper.ens.fr> + PR fortran/30611 + * intrinsics/string_intrinsics.c (string_repeat): Don't check + if ncopies is negative. + +2007-02-04 Francois-Xavier Coudert <coudert@clipper.ens.fr> + PR libfortran/30007 * libgfortran.h: Do not prefix symbol name with __USER_LABEL_PREFIX__ when used in __attribute__((__alias__(...))). diff --git a/libgfortran/intrinsics/string_intrinsics.c b/libgfortran/intrinsics/string_intrinsics.c index e432987..86ef9d4 100644 --- a/libgfortran/intrinsics/string_intrinsics.c +++ b/libgfortran/intrinsics/string_intrinsics.c @@ -362,14 +362,8 @@ string_repeat (char * dest, GFC_INTEGER_4 slen, { int i; - /* See if ncopies is valid. */ - if (ncopies < 0) - { - /* The error is already reported. */ - runtime_error ("Augument NCOPIES is negative."); - } - - /* Copy characters. */ + /* We don't need to check that ncopies is non-negative here, because + the front-end already generates code for that check. */ for (i = 0; i < ncopies; i++) { memmove (dest + (i * slen), src, slen); |