This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34248] ICE on assumed length character function
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Nov 2007 22:09:45 -0000
- Subject: [Bug fortran/34248] ICE on assumed length character function
- References: <bug-34248-15407@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from burnus at gcc dot gnu dot org 2007-11-27 22:09 -------
No regression. Valgrind shows:
==21714== Invalid read of size 4
==21714== at 0x49C077: generate_local_decl (trans-decl.c:2980)
==21714== by 0x471026: traverse_ns (symbol.c:2951)
==21714== by 0x499FFD: gfc_generate_function_code (trans-decl.c:3081)
==21714== by 0x4558AB: gfc_parse_file (parse.c:3399)
==21714== by 0x47DA34: gfc_be_parse_file (f95-lang.c:258)
==21714== by 0x6EDC54: toplev_main (toplev.c:1042)
==21714== by 0x52CBB29: (below main) (in /lib64/libc-2.6.1.so)
> Note that the F77 version works OK:
Well, it works without RESULT. Using the following also crashes:
character(*) FUNCTION ctbgt() RESULT(ctab)
END
The following patch fixes it. Or is it only a stupid workaround?
In the following, "sym->ts.cl->length" == NULL
Index: trans-decl.c
===================================================================
--- trans-decl.c (revision 130466)
+++ trans-decl.c (working copy)
@@ -2978,7 +2978,9 @@
int i;
if (sym->ts.type == BT_CHARACTER
- && sym->ts.cl->length->expr_type != EXPR_CONSTANT)
+ && sym->ts.cl
+ && sym->ts.cl->length
+ && sym->ts.cl->length->expr_type != EXPR_CONSTANT)
generate_expr_decls (sym, sym->ts.cl->length);
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
Keywords| |ice-on-valid-code
Known to fail| |4.1.3 4.2.2 4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34248