diff options
author | Richard Henderson <rth@redhat.com> | 2005-01-27 01:28:45 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2005-01-27 01:28:45 -0800 |
commit | dad2a933ba0fe99918377dc328ce87325365fb91 (patch) | |
tree | b06cc8f8944057cfd57dcd5faf93040dd75dae74 /gcc/tree-sra.c | |
parent | 17c21957198083a5787308566dff7526d1307bc5 (diff) | |
download | gcc-dad2a933ba0fe99918377dc328ce87325365fb91.zip gcc-dad2a933ba0fe99918377dc328ce87325365fb91.tar.gz gcc-dad2a933ba0fe99918377dc328ce87325365fb91.tar.bz2 |
re PR c++/14329 ([4.1 only] badly formatted warnings for SRA replacements used uninitialized)
PR tree-opt/14329
* tree.h (struct tree_decl): Add debug_expr_is_from.
(DECL_DEBUG_EXPR_IS_FROM): New.
(DECL_DEBUG_EXPR): Rename from DECL_DEBUG_ALIAS_OF.
* dwarf2out.c (dwarf2out_var_location): Update to match.
* tree-outof-ssa.c (create_temp): Likewise.
* var-tracking.c (track_expr_p): Likewise.
* tree-sra.c (instantiate_element): Set DECL_DEBUG_EXPR.
* c-objc-common.c (c_tree_printer) <'D'>: Handle DECL_DEBUG_EXPR.
* toplev.c (default_tree_printer): Likewise.
From-SVN: r94317
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r-- | gcc/tree-sra.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 1ac0ec0..01bf53c 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -144,6 +144,8 @@ static struct obstack sra_obstack; static void dump_sra_elt_name (FILE *, struct sra_elt *); extern void debug_sra_elt_name (struct sra_elt *); +/* Forward declarations. */ +static tree generate_element_ref (struct sra_elt *); /* Return true if DECL is an SRA candidate. */ @@ -1112,15 +1114,25 @@ instantiate_element (struct sra_elt *elt) elt->replacement = var = make_rename_temp (elt->type, "SR"); DECL_SOURCE_LOCATION (var) = DECL_SOURCE_LOCATION (base); - TREE_NO_WARNING (var) = TREE_NO_WARNING (base); - DECL_ARTIFICIAL (var) = DECL_ARTIFICIAL (base); - DECL_IGNORED_P (var) = DECL_IGNORED_P (base); + DECL_ARTIFICIAL (var) = 1; if (DECL_NAME (base) && !DECL_IGNORED_P (base)) { char *pretty_name = build_element_name (elt); DECL_NAME (var) = get_identifier (pretty_name); obstack_free (&sra_obstack, pretty_name); + + DECL_DEBUG_EXPR (var) = generate_element_ref (elt); + DECL_DEBUG_EXPR_IS_FROM (var) = 1; + + DECL_IGNORED_P (var) = 0; + TREE_NO_WARNING (var) = TREE_NO_WARNING (base); + } + else + { + DECL_IGNORED_P (var) = 1; + /* ??? We can't generate any warning that would be meaningful. */ + TREE_NO_WARNING (var) = 1; } if (dump_file) |