From b785f485ecfa4a4685e30b3385b701159726f4a3 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 25 Jul 2004 01:10:28 -0700 Subject: [PATCH] c-decl.c (start_function): Set DECL_ARTIFICIAL and DECL_IGNORED_P on the RESULT_DECL. * c-decl.c (start_function): Set DECL_ARTIFICIAL and DECL_IGNORED_P on the RESULT_DECL. * cgraphunit.c (cgraph_build_static_cdtor): Likewise. * integrate.c (copy_decl_for_inlining): Copy DECL_ARTIFICIAL and DECL_IGNORED_P to new decl. ada/ * utils.c (create_subprog_decl): Set DECL_ARTIFICIAL and DECL_IGNORED_P on RESULT_DECL. cp/ * decl.c (start_preparsed_function): Set DECL_ARTIFICIAL and DECL_IGNORED_P on RESULT_DECL. * semantics.c (finalize_nrv): Copy them too. fortran/ * trans-decl.c (gfc_build_function_decl): Set DECL_ARTIFICIAL and DECL_IGNORED_P on RESULT_DECL. (gfc_generate_constructors): Likewise. java/ * decl.c (build_result_decl): Set DECL_ARTIFICIAL and DECL_IGNORED_P. From-SVN: r85145 --- gcc/ChangeLog | 8 ++++++++ gcc/ada/ChangeLog | 5 +++++ gcc/ada/utils.c | 2 ++ gcc/c-decl.c | 9 ++++++--- gcc/cgraphunit.c | 8 ++++++-- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/decl.c | 12 ++++++++---- gcc/cp/semantics.c | 2 ++ gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/trans-decl.c | 4 ++++ gcc/integrate.c | 5 +++++ gcc/java/ChangeLog | 4 ++++ gcc/java/decl.c | 2 ++ 13 files changed, 64 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2af48d1dec3..a6719d35b02 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2004-07-25 Richard Henderson + + * c-decl.c (start_function): Set DECL_ARTIFICIAL and DECL_IGNORED_P + on the RESULT_DECL. + * cgraphunit.c (cgraph_build_static_cdtor): Likewise. + * integrate.c (copy_decl_for_inlining): Copy DECL_ARTIFICIAL and + DECL_IGNORED_P to new decl. + 2004-07-24 Zack Weinberg * config/ia64/ia64.c (general_xfmode_operand) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 28445a82c8f..651ff90c188 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2004-07-25 Richard Henderson + + * utils.c (create_subprog_decl): Set DECL_ARTIFICIAL and + DECL_IGNORED_P on RESULT_DECL. + 2004-07-20 Olivier Hainque * a-elchha.adb (Last_Chance_Handler): Remove the bogus buffer dynamic diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index 3d525a07b7c..e307def7e80 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -1687,6 +1687,8 @@ create_subprog_decl (tree subprog_name, tree asm_name, TREE_SIDE_EFFECTS (subprog_decl) = TYPE_VOLATILE (subprog_type); DECL_ARGUMENTS (subprog_decl) = param_decl_list; DECL_RESULT (subprog_decl) = build_decl (RESULT_DECL, 0, return_type); + DECL_ARTIFICIAL (DECL_RESULT (subprog_decl)) = 1; + DECL_IGNORED_P (DECL_RESULT (subprog_decl)) = 1; if (inline_flag) DECL_DECLARED_INLINE_P (subprog_decl) = 1; diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 41e7df0c01a..62a464ee305 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -5661,7 +5661,7 @@ int start_function (tree declspecs, tree declarator, tree attributes) { tree decl1, old_decl; - tree restype; + tree restype, resdecl; current_function_returns_value = 0; /* Assume, until we see it does. */ current_function_returns_null = 0; @@ -5857,8 +5857,11 @@ start_function (tree declspecs, tree declarator, tree attributes) else restype = integer_type_node; } - DECL_RESULT (current_function_decl) - = build_decl (RESULT_DECL, NULL_TREE, restype); + + resdecl = build_decl (RESULT_DECL, NULL_TREE, restype); + DECL_ARTIFICIAL (resdecl) = 1; + DECL_IGNORED_P (resdecl) = 1; + DECL_RESULT (current_function_decl) = resdecl; start_fname_decls (); diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 79d5553aa9c..2d962b8c839 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1796,7 +1796,7 @@ cgraph_build_static_cdtor (char which, tree body, int priority) { static int counter = 0; char which_buf[16]; - tree decl, name; + tree decl, name, resdecl; sprintf (which_buf, "%c_%d", which, counter++); name = get_file_function_name_long (which_buf); @@ -1805,7 +1805,11 @@ cgraph_build_static_cdtor (char which, tree body, int priority) build_function_type (void_type_node, void_list_node)); current_function_decl = decl; - DECL_RESULT (decl) = build_decl (RESULT_DECL, NULL_TREE, void_type_node); + resdecl = build_decl (RESULT_DECL, NULL_TREE, void_type_node); + DECL_ARTIFICIAL (resdecl) = 1; + DECL_IGNORED_P (resdecl) = 1; + DECL_RESULT (decl) = resdecl; + allocate_struct_function (decl); TREE_STATIC (decl) = 1; diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0d65baeaade..6512f4e4637 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-07-25 Richard Henderson + + * decl.c (start_preparsed_function): Set DECL_ARTIFICIAL and + DECL_IGNORED_P on RESULT_DECL. + * semantics.c (finalize_nrv): Copy them too. + 2004-07-23 Nathan Sidwell * search.c (lookup_conversion_operator): Avoid two loops. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index e39ceb10c1b..64217cf98f0 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9689,10 +9689,14 @@ start_preparsed_function (tree decl1, tree attrs, int flags) restype = type_promotes_to (restype); if (DECL_RESULT (decl1) == NULL_TREE) { - DECL_RESULT (decl1) - = build_decl (RESULT_DECL, 0, TYPE_MAIN_VARIANT (restype)); - c_apply_type_quals_to_decl (cp_type_quals (restype), - DECL_RESULT (decl1)); + tree resdecl; + + resdecl = build_decl (RESULT_DECL, 0, TYPE_MAIN_VARIANT (restype)); + DECL_ARTIFICIAL (resdecl) = 1; + DECL_IGNORED_P (resdecl) = 1; + DECL_RESULT (decl1) = resdecl; + + c_apply_type_quals_to_decl (cp_type_quals (restype), resdecl); } /* Initialize RTL machinery. We cannot do this until diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 3d8c6435853..f6f71759478 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -3050,6 +3050,8 @@ finalize_nrv (tree *tp, tree var, tree result) /* Copy debugging information from VAR to RESULT. */ DECL_NAME (result) = DECL_NAME (var); + DECL_ARTIFICIAL (result) = DECL_ARTIFICIAL (var); + DECL_IGNORED_P (result) = DECL_IGNORED_P (var); DECL_SOURCE_LOCATION (result) = DECL_SOURCE_LOCATION (var); DECL_ABSTRACT_ORIGIN (result) = DECL_ABSTRACT_ORIGIN (var); /* Don't forget that we take its address. */ diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 01cedd8f1af..1e0d825cf68 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2004-07-25 Richard Henderson + + * trans-decl.c (gfc_build_function_decl): Set DECL_ARTIFICIAL + and DECL_IGNORED_P on RESULT_DECL. + (gfc_generate_constructors): Likewise. + 2004-07-18 Tobias Schlueter PR fortran/16465 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 655c48b1ee6..7883bdea2d8 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1030,6 +1030,8 @@ gfc_build_function_decl (gfc_symbol * sym) } result_decl = build_decl (RESULT_DECL, result_decl, type); + DECL_ARTIFICIAL (result_decl) = 1; + DECL_IGNORED_P (result_decl) = 1; DECL_CONTEXT (result_decl) = fndecl; DECL_RESULT (fndecl) = result_decl; @@ -2124,6 +2126,8 @@ gfc_generate_constructors (void) TREE_PUBLIC (fndecl) = 1; decl = build_decl (RESULT_DECL, NULL_TREE, void_type_node); + DECL_ARTIFICIAL (decl) = 1; + DECL_IGNORED_P (decl) = 1; DECL_CONTEXT (decl) = fndecl; DECL_RESULT (fndecl) = decl; diff --git a/gcc/integrate.c b/gcc/integrate.c index 2fa5164bec5..d9e66f340fb 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -141,6 +141,11 @@ copy_decl_for_inlining (tree decl, tree from_fn, tree to_fn) } } + /* Don't generate debug information for the copy if we wouldn't have + generated it for the copy either. */ + DECL_ARTIFICIAL (copy) = DECL_ARTIFICIAL (decl); + DECL_IGNORED_P (copy) = DECL_IGNORED_P (decl); + /* Set the DECL_ABSTRACT_ORIGIN so the debugging routines know what declaration inspired this copy. */ DECL_ABSTRACT_ORIGIN (copy) = DECL_ORIGIN (decl); diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index dc1ae7e19e2..b8e6eec6dcb 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2004-07-25 Richard Henderson + + * decl.c (build_result_decl): Set DECL_ARTIFICIAL and DECL_IGNORED_P. + 2004-07-23 Mike Stump * boehm.c (set_bit): Improve type safety wrt unsignedness. diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 33708bdc629..c61d42653f7 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -1804,6 +1804,8 @@ build_result_decl (tree fndecl) && TYPE_PRECISION (restype) < TYPE_PRECISION (integer_type_node)) restype = integer_type_node; result = build_decl (RESULT_DECL, NULL_TREE, restype); + DECL_ARTIFICIAL (result) = 1; + DECL_IGNORED_P (result) = 1; DECL_CONTEXT (result) = fndecl; DECL_RESULT (fndecl) = result; } -- 2.30.2