This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RS6000] Fix PR 16343


On Mon, Nov 29, 2004 at 04:06:38PM -0800, Richard Henderson wrote:
> On Sat, Nov 27, 2004 at 09:26:21PM +1030, Alan Modra wrote:
> > Instead of the thread-local test here (which is also needed by other
> > targets with small data) we could change default_encode_section_info to
> > 
> >   if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl))
> >     flags |= decl_tls_model (decl) << SYMBOL_FLAG_TLS_SHIFT;
> >   else if (targetm.in_small_data_p (decl))
> >     flags |= SYMBOL_FLAG_SMALL;
> 
> I would approve this change...

	* varasm.c (default_encode_section_info): Don't set SYMBOL_FLAG_SMALL
	on TLS symbols.
	* config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Remove TLS
	check.

I'll commit after bootstrap and regression testing.

--- gcc-virgin/gcc/varasm.c	2004-11-29 22:38:15.000000000 +1030
+++ gcc-current/gcc/varasm.c	2004-11-30 12:05:02.065922255 +1030
@@ -5097,10 +5097,10 @@ default_encode_section_info (tree decl, 
     flags |= SYMBOL_FLAG_FUNCTION;
   if (targetm.binds_local_p (decl))
     flags |= SYMBOL_FLAG_LOCAL;
-  if (targetm.in_small_data_p (decl))
-    flags |= SYMBOL_FLAG_SMALL;
   if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl))
     flags |= decl_tls_model (decl) << SYMBOL_FLAG_TLS_SHIFT;
+  else if (targetm.in_small_data_p (decl))
+    flags |= SYMBOL_FLAG_SMALL;
   /* ??? Why is DECL_EXTERNAL ever set for non-PUBLIC names?  Without
      being PUBLIC, the thing *must* be defined in this translation unit.
      Prevent this buglet from being propagated into rtl code as well.  */

--- gcc-virgin/gcc/config/rs6000/rs6000.c	2004-11-28 15:25:21.000000000 +1030
+++ gcc-current/gcc/config/rs6000/rs6000.c	2004-11-30 11:49:26.026198426 +1030
@@ -17273,10 +17288,6 @@ rs6000_elf_in_small_data_p (tree decl)
   if (TREE_CODE (decl) == FUNCTION_DECL)
     return false;
 
-  /* Thread-local vars can't go in the small data area.  */
-  if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl))
-    return false;
-
   if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl))
     {
       const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]