aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-18 09:27:11 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-18 09:27:11 +0000
commit67e5d6aa8b18609a5de8540314a3a942426fd724 (patch)
tree56b09670bcf1cc459e61163773c40f30bcbdfdcb
parentec3f1e8bda4058e815111011ac81aec5decfcfd6 (diff)
PR libfortran/51828
* intrinsics/unpack_generic.c (unpack_internal): Let the compiler know that dim > 0 to avoid warnings. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204940 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/intrinsics/unpack_generic.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index c18391f106f..fcbc5483472 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-18 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR libfortran/51828
+ * intrinsics/unpack_generic.c (unpack_internal): Let the compiler
+ know that dim > 0 to avoid warnings.
+
2013-11-15 Janne Blomqvist <jb@gcc.gnu.org>
Jerry DeLisle <jvdelisle@gcc.gnu.org>
diff --git a/libgfortran/intrinsics/unpack_generic.c b/libgfortran/intrinsics/unpack_generic.c
index d06e0a99e27..c57914f06cf 100644
--- a/libgfortran/intrinsics/unpack_generic.c
+++ b/libgfortran/intrinsics/unpack_generic.c
@@ -144,6 +144,9 @@ unpack_internal (gfc_array_char *ret, const gfc_array_char *vector,
if (empty)
return;
+ /* This assert makes sure GCC knows we can access *stride[0] later. */
+ assert (dim > 0);
+
vstride0 = GFC_DESCRIPTOR_STRIDE_BYTES(vector,0);
rstride0 = rstride[0];
fstride0 = fstride[0];