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]

fix -fcompare-debug regression in free_lang_data


The free_lang_data pass, called when not emitting debug info, introduces
new alias sets for select data types that hadn't had been assigned an
alias set yet.  This gets alias set numbers out of sync.  I don't know
of any codegen differences that follow from this, but -fcompare-debug
fails because of the different alias set numbers in MEMs.

This patch arranges for free_lang_data() to not depend on whether or not
we're emitting debug information, removing an extraneous reference to
flag_gtoggle while at that.  flag_gtoggle is only to be used when
processing command-line options, and it takes effect by changing the
debug âverbosityâ level.  I can't think of any legitimate reason to
check its value elsewhere.

Ok to install?

for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* tree.c (gate_free_lang_data): Don't depend on debug info level.

Index: gcc/tree.c
===================================================================
--- gcc/tree.c.orig	2009-10-16 04:09:35.000000000 -0300
+++ gcc/tree.c	2009-10-16 04:12:06.000000000 -0300
@@ -4977,10 +4977,11 @@ free_lang_data (void)
 static bool
 gate_free_lang_data (void)
 {
-  /* FIXME.  Remove after save_debug_info is working.  */
-  return (flag_generate_lto
-	  || (!in_lto_p
-	      && !flag_gtoggle && debug_info_level <= DINFO_LEVEL_TERSE));
+  /* FIXME.  Remove after save_debug_info is working.  Don't depend on
+     debug level, it breaks -fcompare-debug because it changes the
+     numbering of alias sets calling get_alias_set within
+     free_lang_data_in_type().  */
+  return flag_generate_lto;
 }
 
 

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

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