diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-07-02 00:15:29 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-07-02 00:15:29 +0000 |
commit | d97623df01d491b77480c502a7237285ec218697 (patch) | |
tree | 5ca40d35c6ae83de47bf385081fad8ce92d1bb6e /gcc/integrate.c | |
parent | d855e3283969bec2fd75004ca9b99a1d50b24300 (diff) | |
download | gcc-d97623df01d491b77480c502a7237285ec218697.tar.gz |
(integrate_decl_tree): Set DECL_ABTRACT_ORIGIN before pushdecl call
for local variables.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@10102 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/integrate.c')
-rw-r--r-- | gcc/integrate.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c index 525977aceca..dfc33f960bc 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -1991,14 +1991,23 @@ integrate_decl_tree (let, level, map) if (DECL_LANG_SPECIFIC (d)) copy_lang_decl (d); + /* Must set DECL_ABSTRACT_ORIGIN here for local variables, to ensure + that we don't get -Wshadow warnings. But don't set it here if + pushdecl might return a duplicate decl, as that will result in + incorrect DWARF debug info. */ + if (! DECL_EXTERNAL (d) || ! TREE_PUBLIC (d)) + /* Prevent warning for shadowing with these. */ + DECL_ABSTRACT_ORIGIN (d) = t; + newd = pushdecl (d); - /* If the decl we get back is the copy of 't' that we started with, + /* If we didn't set DECL_ABSTRACT_ORIGIN above, then set it now. + Simpler to just set it always rather than checking. + If the decl we get back is the copy of 't' that we started with, then set the DECL_ABSTRACT_ORIGIN. Otherwise, we must have a duplicate decl, and we got the older one back. In that case, setting DECL_ABSTRACT_ORIGIN is not appropriate. */ if (newd == d) - /* Prevent warning for shadowing with these. */ DECL_ABSTRACT_ORIGIN (d) = t; } |