This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/68147] Potential incorrect code generation for string self-assignment
- 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: Tue, 16 Feb 2016 20:29:56 +0000
- Subject: [Bug fortran/68147] Potential incorrect code generation for string self-assignment
- Auto-submitted: auto-generated
- References: <bug-68147-4 at http dot gcc dot gnu dot org/bugzilla/>
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.)