From bf7eefab5fd7d5dd51e175b6770c471762d2ed9e Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 21 Mar 2011 18:19:47 +0000 Subject: [PATCH] re PR bootstrap/48216 (IRIX 6 Ada bootstrap broken: gnu_decl uninitialized in gcc-interface/decl.c:elaborate_expression_1) PR bootstrap/48216 * gcc-interface/decl.c (elaborate_expression_1): Localize GNU_DECL. From-SVN: r171254 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/gcc-interface/decl.c | 21 +++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 3ddcda5ad49..b2d88618040 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2011-03-21 Eric Botcazou + + PR bootstrap/48216 + * gcc-interface/decl.c (elaborate_expression_1): Localize GNU_DECL. + 2011-03-21 Eric Botcazou * gcc-interface/decl.c (components_to_record): Add REORDER parameter, diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index ab571ab7b6c..2f9b2ecec23 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -6006,7 +6006,6 @@ elaborate_expression_1 (tree gnu_expr, Entity_Id gnat_entity, tree gnu_name, { const bool expr_global_p = Is_Public (gnat_entity) || global_bindings_p (); bool expr_variable_p, use_variable; - tree gnu_decl; /* In most cases, we won't see a naked FIELD_DECL because a discriminant reference will have been replaced with a COMPONENT_REF when the type @@ -6071,15 +6070,17 @@ elaborate_expression_1 (tree gnu_expr, Entity_Id gnat_entity, tree gnu_name, /* Now create it, possibly only for debugging purposes. */ if (use_variable || need_debug) - gnu_decl - = create_var_decl (create_concat_name (gnat_entity, - IDENTIFIER_POINTER (gnu_name)), - NULL_TREE, TREE_TYPE (gnu_expr), gnu_expr, - !need_debug, Is_Public (gnat_entity), - !definition, expr_global_p, NULL, gnat_entity); - - if (use_variable) - return gnu_decl; + { + tree gnu_decl + = create_var_decl (create_concat_name (gnat_entity, + IDENTIFIER_POINTER (gnu_name)), + NULL_TREE, TREE_TYPE (gnu_expr), gnu_expr, + !need_debug, Is_Public (gnat_entity), + !definition, expr_global_p, NULL, gnat_entity); + + if (use_variable) + return gnu_decl; + } return expr_variable_p ? gnat_save_expr (gnu_expr) : gnu_expr; } -- 2.30.2