This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/48066] [4.3/4.4/4.5/4.6 Regression] Segfault with SUM of zero-sized array
- From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 12 Mar 2011 10:16:04 +0000
- Subject: [Bug fortran/48066] [4.3/4.4/4.5/4.6 Regression] Segfault with SUM of zero-sized array
- Auto-submitted: auto-generated
- References: <bug-48066-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48066
--- Comment #8 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-03-12 10:15:59 UTC ---
(In reply to comment #7)
> --- m4/ifunction_logical.m4 (Revision 170320)
> +++ m4/ifunction_logical.m4 (Arbeitskopie)
> @@ -49,8 +49,8 @@
> src_kind = GFC_DESCRIPTOR_SIZE (array);
>
> len = GFC_DESCRIPTOR_EXTENT(array,dim);
> - if (len < 0)
> - len = 0;
> + if (len <= 0)
> + return;
... probably would not work for printing empty arrays.