This is a fix for what looks like a thinko.
The other patches don't depend on it, so it can well wait for 4.9 if
that is preferred.
2013-02-15 Mikael Morin <[email protected]>
PR fortran/54730
* symbol.c (restore_old_symbol): Fix thinko.
diff --git a/symbol.c b/symbol.c
index 4f1752d..e4dbb41 100644
--- a/symbol.c
+++ b/symbol.c
@@ -2895,7 +2895,8 @@ restore_old_symbol (gfc_symbol *p)
if (p->value != old->value)
{
- gfc_free_expr (old->value);
+ gcc_checking_assert (old->value == NULL);
+ gfc_free_expr (p->value);
p->value = NULL;
}