aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2004-06-29 22:04:38 -0700
committerPer Bothner <bothner@gcc.gnu.org>2004-06-29 22:04:38 -0700
commitce7f2acdd9357d1baf558a8fd08a3f139eb50648 (patch)
tree90dc9931e97d11f9a0953b896af59c8872979b38
parent8319dc87090b91a1e892a62850c70a141f57a5e0 (diff)
downloadgcc-ce7f2acdd9357d1baf558a8fd08a3f139eb50648.zip
gcc-ce7f2acdd9357d1baf558a8fd08a3f139eb50648.tar.gz
gcc-ce7f2acdd9357d1baf558a8fd08a3f139eb50648.tar.bz2
winnt.c (i386_pe_encode_section_info): Smash rtlname's XSTR in place, so we don't lose SYMBOL_REF_DECL info.
* config/i386/winnt.c (i386_pe_encode_section_info): Smash rtlname's XSTR in place, so we don't lose SYMBOL_REF_DECL info. From-SVN: r83893
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/i386/winnt.c18
2 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a02c1e0..4be6f6b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-06-29 Per Bothner <per@bothner.com>
+
+ * config/i386/winnt.c (i386_pe_encode_section_info): Smash rtlname's
+ XSTR in place, so we don't lose SYMBOL_REF_DECL info.
+
2004-06-29 Zack Weinberg <zack@codesourcery.com>
* config/ia64/hpux.h: Target does too support thread-local storage.
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index cf80087..f0b1aec 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -488,16 +488,16 @@ i386_pe_encode_section_info (tree decl, rtx rtl, int first)
{
default_encode_section_info (decl, rtl, first);
- if (TREE_CODE (decl) == FUNCTION_DECL)
+ if (first && TREE_CODE (decl) == FUNCTION_DECL)
{
- if (lookup_attribute ("stdcall",
- TYPE_ATTRIBUTES (TREE_TYPE (decl))))
- XEXP (DECL_RTL (decl), 0) =
- gen_rtx_SYMBOL_REF (Pmode, gen_stdcall_suffix (decl));
- else if (lookup_attribute ("fastcall",
- TYPE_ATTRIBUTES (TREE_TYPE (decl))))
- XEXP (DECL_RTL (decl), 0) =
- gen_rtx_SYMBOL_REF (Pmode, gen_fastcall_suffix (decl));
+ tree type_attributes = TYPE_ATTRIBUTES (TREE_TYPE (decl));
+ rtx rtlname = XEXP (rtl, 0);
+ if (GET_CODE (rtlname) == MEM)
+ rtlname = XEXP (rtlname, 0);
+ if (lookup_attribute ("stdcall", type_attributes))
+ XSTR (rtlname, 0) = gen_stdcall_suffix (decl);
+ else if (lookup_attribute ("fastcall", type_attributes))
+ XSTR (rtlname, 0) = gen_fastcall_suffix (decl);
}
/* Mark the decl so we can tell from the rtl whether the object is