Commit 7b201a88 by Thomas Koenig

re PR fortran/68147 (Potential incorrect code generation for string self-assignment)

2016-02-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/68147
	PR fortran/47674
	* frontend-passes.c (realloc_string_callback): Don't set
	walk_subtrees.

2016-02-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/68147
	PR fortran/47674
	* gfortran.dg/realloc_on_assign_26.f90:  New test case.

From-SVN: r233797
parent 3070e826
2016-02-28 Thomas Koenig <tkoenig@gcc.gnu.org> 2016-02-28 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/68147
PR fortran/47674
* frontend-passes.c (realloc_string_callback): Don't set
walk_subtrees.
2016-02-28 Thomas Koenig <tkoenig@gcc.gnu.org>
* dump-parse-tree.c (show_code_node): Print association * dump-parse-tree.c (show_code_node): Print association
list of a block if present. Handle EXEC_END_BLOCK. list of a block if present. Handle EXEC_END_BLOCK.
......
...@@ -153,14 +153,13 @@ gfc_run_passes (gfc_namespace *ns) ...@@ -153,14 +153,13 @@ gfc_run_passes (gfc_namespace *ns)
*/ */
static int 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) void *data ATTRIBUTE_UNUSED)
{ {
gfc_expr *expr1, *expr2; gfc_expr *expr1, *expr2;
gfc_code *co = *c; gfc_code *co = *c;
gfc_expr *n; gfc_expr *n;
*walk_subtrees = 0;
if (co->op != EXEC_ASSIGN) if (co->op != EXEC_ASSIGN)
return 0; return 0;
......
2016-02-28 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/68147
PR fortran/47674
* gfortran.dg/realloc_on_assign_26.f90: New test case.
2016-02-28 Harald Anlauf <anlauf@gmx.de> 2016-02-28 Harald Anlauf <anlauf@gmx.de>
Jerry DeLisle <jvdelisle@gcc.gnu.org> Jerry DeLisle <jvdelisle@gcc.gnu.org>
......
! { dg-do run }
! PR 68147 - no temprorary within the IF statement.
! Original test case by Martin Reinecke.
program test
implicit none
character(len=:),allocatable ::name
name="./a.out"
if (index(name,"/") /= 0) THEN
name=name(3:)
if (name .ne. "a.out") call abort
endif
end program
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment