From 050dcb6ad8de794e46d5eb377083fb8b9acf642e Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 11 Oct 2017 14:30:03 +0200 Subject: [PATCH] Fix use-after-scope error. 2017-10-11 Martin Liska * print-rtl.c (print_insn): Move declaration of idbuf to same scope as name. From-SVN: r253639 --- gcc/ChangeLog | 5 +++++ gcc/print-rtl.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2eecadbc981..61ad754936c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-10-11 Martin Liska + + * print-rtl.c (print_insn): Move declaration of idbuf + to same scope as name. + 2017-10-11 Martin Liska Revert r253637: diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 79ec463df45..28d99862cad 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -1792,11 +1792,11 @@ print_insn (pretty_printer *pp, const rtx_insn *x, int verbose) case DEBUG_INSN: { const char *name = "?"; + char idbuf[32]; if (DECL_P (INSN_VAR_LOCATION_DECL (x))) { tree id = DECL_NAME (INSN_VAR_LOCATION_DECL (x)); - char idbuf[32]; if (id) name = IDENTIFIER_POINTER (id); else if (TREE_CODE (INSN_VAR_LOCATION_DECL (x)) -- 2.30.2