This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/34980] [4.3 Regression] Segfault in shape given a scalar
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jan 2008 09:00:32 -0000
- Subject: [Bug libfortran/34980] [4.3 Regression] Segfault in shape given a scalar
- References: <bug-34980-10743@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from jvdelisle at gcc dot gnu dot org 2008-01-26 09:00 -------
Index: libgfortran/generated/shape_i4.c
===================================================================
--- libgfortran/generated/shape_i4.c (revision 131856)
+++ libgfortran/generated/shape_i4.c (working copy)
@@ -46,6 +46,8 @@ shape_4 (gfc_array_i4 * const restrict r
int n;
index_type stride;
+ if (ret->data == NULL)
+ return;
stride = ret->dim[0].stride;
for (n = 0; n < GFC_DESCRIPTOR_RANK (array); n++)
Something like the above fixes this. Since this is generated, some m4 magic is
needed. Also it seems that this could be simplified quite a bit in the
frontend and not make the call at all.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34980