diff options
author | Andrew Haley <aph@cygnus.com> | 2000-05-02 13:50:25 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2000-05-02 13:50:25 +0000 |
commit | 32adf8e62665b2aa43759a52a6f4294d6732df67 (patch) | |
tree | f8c421a8d25e49c0698bd09fbe180cb5ac803679 /gcc | |
parent | 2b84225632bc28bd72c0a2bbd30a3cf21716f3b2 (diff) | |
download | gcc-32adf8e62665b2aa43759a52a6f4294d6732df67.zip gcc-32adf8e62665b2aa43759a52a6f4294d6732df67.tar.gz gcc-32adf8e62665b2aa43759a52a6f4294d6732df67.tar.bz2 |
ia64.c (ia64_encode_section_info): Handle the case where this function is called for the second time on a decl...
2000-05-02 Andrew Haley <aph@cygnus.com>
* config/ia64/ia64.c (ia64_encode_section_info): Handle the case
where this function is called for the second time on a decl that
has had its section info changed in such a way as to move it out
of small data/bss.
* config/ia64/ia64.h (REDO_SECTION_INFO_P): New definition.
From-SVN: r33609
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.c | 19 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.h | 9 |
3 files changed, 35 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b56fa62..369e058 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2000-05-02 Andrew Haley <aph@cygnus.com> + + * config/ia64/ia64.c (ia64_encode_section_info): Handle the case + where this function is called for the second time on a decl that + has had its section info changed in such a way as to move it out + of small data/bss. + * config/ia64/ia64.h (REDO_SECTION_INFO_P): New definition. + 2000-05-01 Richard Henderson <rth@cygnus.com> * ifcvt.c (dead_or_predicable): Set merge_bb->end to the insn before diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index dbc89d7..f5af654 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -2786,6 +2786,7 @@ ia64_encode_section_info (decl) else if (! TARGET_NO_SDATA && TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl) + && ! (DECL_ONE_ONLY (decl) || DECL_WEAK (decl)) && ! (TREE_PUBLIC (decl) && (flag_pic || (DECL_COMMON (decl) @@ -2813,7 +2814,8 @@ ia64_encode_section_info (decl) /* If this is an incomplete type with size 0, then we can't put it in sdata because it might be too big when completed. */ - else if (size > 0 && size <= ia64_section_threshold) + else if (size > 0 && size <= ia64_section_threshold + && str[0] != SDATA_NAME_FLAG_CHAR) { int len = strlen (str); char *newstr = obstack_alloc (saveable_obstack, len + 2); @@ -2822,6 +2824,21 @@ ia64_encode_section_info (decl) *newstr = SDATA_NAME_FLAG_CHAR; XSTR (XEXP (DECL_RTL (decl), 0), 0) = newstr; } + } + /* This decl is marked as being in small data/bss but it shouldn't + be; one likely explanation for this is that the decl has been + moved into a different section from the one it was in when + ENCODE_SECTION_INFO was first called. Remove the '@'.*/ + else if (TREE_CODE (decl) == VAR_DECL + && (XSTR (XEXP (DECL_RTL (decl), 0), 0)[0] + == SDATA_NAME_FLAG_CHAR)) + { + char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0); + int len = strlen (str); + char *newstr = obstack_alloc (saveable_obstack, len); + + strcpy (newstr, str + 1); + XSTR (XEXP (DECL_RTL (decl), 0), 0) = newstr; } } diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index be921f9..163f983 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -1978,6 +1978,15 @@ do { \ #define ENCODE_SECTION_INFO(DECL) ia64_encode_section_info (DECL) +/* If a variable is weakened, made one only or moved into a different + section, it may be necessary to redo the section info to move the + variable out of sdata. */ + +#define REDO_SECTION_INFO_P(DECL) \ + ((TREE_CODE (DECL) == VAR_DECL) \ + && (DECL_ONE_ONLY (decl) || DECL_WEAK (decl) || DECL_COMMON (decl) \ + || DECL_SECTION_NAME (decl) != 0)) + #define SDATA_NAME_FLAG_CHAR '@' #define IA64_DEFAULT_GVALUE 8 |