This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/33298] Wrong code for SPREAD on zero-sized arrays
- From: "toon at moene dot indiv dot nluug dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Sep 2007 08:56:43 -0000
- Subject: [Bug libfortran/33298] Wrong code for SPREAD on zero-sized arrays
- References: <bug-33298-109@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from toon at moene dot indiv dot nluug dot nl 2007-09-06 08:56 -------
Wouldn't it be an option to simply bail out early (i.e., after the error
checks) in case of size == 0 ?
E.g., like this:
62
63 rrank = srank + 1;
64 if (rrank > GFC_MAX_DIMENSIONS)
65 runtime_error ("return rank too large in spread()");
66
67 if (*along > rrank)
68 runtime_error ("dim outside of rank in spread()");
if (size == 0)
return
Or do we actually have to set something on return ?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33298