[Bug fortran/68147] Potential incorrect code generation for string self-assignment
tkoenig at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 16 20:30:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68147
--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Here's a patch:
Index: frontend-passes.c
===================================================================
--- frontend-passes.c (Revision 233410)
+++ frontend-passes.c (Arbeitskopie)
@@ -153,7 +153,7 @@ gfc_run_passes (gfc_namespace *ns)
*/
static int
-realloc_string_callback (gfc_code **c, int *walk_subtrees,
+realloc_string_callback (gfc_code **c, int *walk_subtrees ATTRIBUTE_UNUSED,
void *data ATTRIBUTE_UNUSED)
{
gfc_expr *expr1, *expr2;
@@ -160,7 +160,6 @@ static int
gfc_code *co = *c;
gfc_expr *n;
- *walk_subtrees = 0;
if (co->op != EXEC_ASSIGN)
return 0;
@@ -177,7 +176,7 @@ static int
return 0;
current_code = c;
- n = create_var (expr2, "trim");
+ n = create_var (expr2, "realloc");
co->expr2 = n;
return 0;
}
(The last part is to make the variable name more useful, that's all.)
More information about the Gcc-bugs
mailing list