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]

Re: String pools versus ENCODE_SECTION_INFO


On Dec 29, 2000, Richard Henderson <rth@redhat.com> wrote:

> On Mon, Dec 25, 2000 at 06:41:35PM -0200, Alexandre Oliva wrote:
>> If ENCODE_SECTION_INFO modifies the label in a string constant, the
>> hash table won't find a match.  Here's a patch that corrects this, by
>> arranging that we always use the string of the symbol_ref, which is
>> the only thing available when marking the constants.  Ok to install?

> I don't much like how confusing this gets.  Does something like
[this]
> work?

Yep.  Good idea, thanks!

Ok to install this one instead of the two other patches?

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>
	* varasm.c (output_constant_def): Don't ENCODE_SECTION_INFO
	twice.  Update desc->rtl and ->label, in case ENCODE_SECTION_INFO
	modifies them.

2000-12-29  Alexandre Oliva  <aoliva@redhat.com>

Index: gcc/varasm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/varasm.c,v
retrieving revision 1.149
diff -u -p -r1.149 varasm.c
--- gcc/varasm.c 2000/12/28 19:35:56 1.149
+++ gcc/varasm.c 2000/12/29 08:42:40
@@ -3204,7 +3204,14 @@ output_constant_def (exp, defer)
      such as that it is a function name.  If the name is changed, the macro
      ASM_OUTPUT_LABELREF will have to know how to strip this information.  */
 #ifdef ENCODE_SECTION_INFO
-  ENCODE_SECTION_INFO (exp);
+  /* A previously-processed constant would already have section info
+     encoded in it.  */
+  if (! found)
+    {
+      ENCODE_SECTION_INFO (exp);
+      desc->rtl = TREE_CST_RTL (exp);
+      desc->label = XSTR (XEXP (desc->rtl, 0), 0);
+    }
 #endif
 
 #ifdef CONSTANT_AFTER_FUNCTION_P

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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