]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
remove broken and redundant diagnostic in i386_pe_section_type_flags
authorTrevor Saunders <tsaunders@mozilla.com>
Fri, 27 Jun 2014 10:53:38 +0000 (10:53 +0000)
committerTrevor Saunders <tbsaunde@gcc.gnu.org>
Fri, 27 Jun 2014 10:53:38 +0000 (10:53 +0000)
varasm.c is the only caller of this target hook, and it correctly uses a
htab to check if the flags returned by the hook are the same as the
flags it has for the section, and emit a error if not.

gccc/

* config/i386/winnt.c (i386_pe_section_type_flags): Remove
redundant diagnostic machinary.

From-SVN: r212069

gcc/ChangeLog
gcc/config/i386/winnt.c

index 2ea692b8bb874d04eb4797ef7bd3fb21837e671d..a7096a5cb1d0b01b4e9288398fff305ab42cd3e1 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-27  trevor Saunders  <tsaunders@mozilla.com>
+
+       * config/i386/winnt.c (i386_pe_section_type_flags): Remove
+       redundant diagnostic machinary.
+
 2014-06-27  Richard Biener  <rguenther@suse.de>
 
        * tree-ssa-math-opts.c (bswap_replace): Fix
index 56cd1b25711b59feb16f0b24c4ab0d1b182b4477..8a5d9822b70f33ad54f890db4c089baeddedca9b 100644 (file)
@@ -469,19 +469,12 @@ i386_pe_reloc_rw_mask (void)
 unsigned int
 i386_pe_section_type_flags (tree decl, const char *name, int reloc)
 {
-  static hash_table<pointer_hash<unsigned int> > *htab = NULL;
   unsigned int flags;
-  unsigned int **slot;
 
   /* Ignore RELOC, if we are allowed to put relocated
      const data into read-only section.  */
   if (!flag_writable_rel_rdata)
     reloc = 0;
-  /* The names we put in the hashtable will always be the unique
-     versions given to us by the stringtable, so we can just use
-     their addresses as the keys.  */
-  if (!htab)
-    htab = new hash_table<pointer_hash<unsigned int> > (31);
 
   if (decl && TREE_CODE (decl) == FUNCTION_DECL)
     flags = SECTION_CODE;
@@ -499,19 +492,6 @@ i386_pe_section_type_flags (tree decl, const char *name, int reloc)
   if (decl && DECL_P (decl) && DECL_ONE_ONLY (decl))
     flags |= SECTION_LINKONCE;
 
-  /* See if we already have an entry for this section.  */
-  slot = htab->find_slot ((unsigned int *)name, INSERT);
-  if (!*slot)
-    {
-      *slot = (unsigned int *) xmalloc (sizeof (unsigned int));
-      **slot = flags;
-    }
-  else
-    {
-      if (decl && **slot != flags)
-       error ("%q+D causes a section type conflict", decl);
-    }
-
   return flags;
 }