This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/70040] [6 Regression] ICE in gimplify.c with deferred-length strings
- 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: Sun, 20 Mar 2016 13:29:44 +0000
- Subject: [Bug fortran/70040] [6 Regression] ICE in gimplify.c with deferred-length strings
- Auto-submitted: auto-generated
- References: <bug-70040-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70040
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pault at gcc dot gnu.org
--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
I've been giving this a look, and I have not been able
(in the time that I can currently spend on this) to
get rid of the gimplification error.
There are two possibilities:
a) Revert r233797. I'd hate to do this, because it removes
(IMHO) a major piece of usability.
b) Fix things some other way. One possibility would be to still do
the analysis in the front-end pass and mark the expression as needing
a string temporary, with something like this:
Index: frontend-passes.c
===================================================================
--- frontend-passes.c (Revision 233797)
+++ frontend-passes.c (Arbeitskopie)
@@ -158,7 +158,6 @@ realloc_string_callback (gfc_code **c, int *walk_s
{
gfc_expr *expr1, *expr2;
gfc_code *co = *c;
- gfc_expr *n;
if (co->op != EXEC_ASSIGN)
return 0;
@@ -174,10 +173,9 @@ realloc_string_callback (gfc_code **c, int *walk_s
if (!gfc_check_dependency (expr1, expr2, true))
return 0;
-
- current_code = c;
- n = create_var (expr2, "trim");
- co->expr2 = n;
+
+ co->expr2->needs_string_temp = 1;
+
return 0;
}
Index: gfortran.h
===================================================================
--- gfortran.h (Revision 233587)
+++ gfortran.h (Arbeitskopie)
@@ -2020,6 +2020,9 @@ typedef struct gfc_expr
/* Will require finalization after use. */
unsigned int must_finalize : 1;
+ /* This needs a string temporary. */
+ unsigned int needs_string_temp;
+
/* If an expression comes from a Hollerith constant or compile-time
evaluation of a transfer statement, it may have a prescribed target-
memory representation, and these cannot always be backformed from
... and then handle the string generation in gfc_conv_substring_expr.
Problem is, I don't really know how to do the second part. I can try
to copy some code from gfc_conv_concat_op, but I have never been
comfortable with this part of the compiler.
Paul, maybe you could help?