Patch: (frv port) small data fix
Anthony Green
green@redhat.com
Fri Jan 10 14:51:00 GMT 2003
This is the last of three patches for the frv port.
This patch fixes small data handling in the frv port. frv_in_small_data_p
had to handle STRING_CST as well as decls (it used to give an ICE).
It also had to obey the programmer when they force something into a
small data section. This patch lets libjava build for frv -
a good measure of health. Ok for trunk and branch?
AG
2002-1-10 Anthony Green <green@redhat.com>
* config/frv/frv.c (frv_in_small_data_p): Don't put small strings
in the small data section.
(frv_in_small_data_p): Force items already destined for small data
section into one.
Index: config/frv/frv.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/frv/frv.c,v
retrieving revision 1.14
diff -2 -c -r1.14 frv.c
*** config/frv/frv.c 22 Oct 2002 23:05:15 -0000 1.14
--- config/frv/frv.c 10 Jan 2003 14:36:39 -0000
***************
*** 9779,9788 ****
static bool
! frv_in_small_data_p (decl)
! tree decl;
{
! HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (decl));
! return symbol_ref_small_data_p (XEXP (DECL_RTL (decl), 0))
! && size > 0 && size <= g_switch_value;
}
--- 9836,9865 ----
static bool
! frv_in_small_data_p (exp)
! tree exp;
{
! /* We want to merge strings, so we never consider them small data. */
! if (TREE_CODE (exp) == STRING_CST)
! return false;
!
! if (TREE_CODE (exp) == VAR_DECL)
! {
! if (DECL_SECTION_NAME (exp))
! {
! const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp));
! if (strcmp (section, ".sdata") == 0
! || strcmp (section, ".sbss") == 0)
! return true;
! }
! else
! {
! HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (exp));
!
! return symbol_ref_small_data_p (XEXP (DECL_RTL (exp), 0))
! && size > 0 && size <= g_switch_value;
! }
! }
! return false;
}
More information about the Gcc-patches
mailing list