Commit f012c1ab by Trevor Saunders Committed by Trevor Saunders

remove broken and redundant diagnostic in i386_pe_section_type_flags

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
parent 3fd269db
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> 2014-06-27 Richard Biener <rguenther@suse.de>
* tree-ssa-math-opts.c (bswap_replace): Fix * tree-ssa-math-opts.c (bswap_replace): Fix
......
...@@ -469,19 +469,12 @@ i386_pe_reloc_rw_mask (void) ...@@ -469,19 +469,12 @@ i386_pe_reloc_rw_mask (void)
unsigned int unsigned int
i386_pe_section_type_flags (tree decl, const char *name, int reloc) 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 flags;
unsigned int **slot;
/* Ignore RELOC, if we are allowed to put relocated /* Ignore RELOC, if we are allowed to put relocated
const data into read-only section. */ const data into read-only section. */
if (!flag_writable_rel_rdata) if (!flag_writable_rel_rdata)
reloc = 0; 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) if (decl && TREE_CODE (decl) == FUNCTION_DECL)
flags = SECTION_CODE; flags = SECTION_CODE;
...@@ -499,19 +492,6 @@ i386_pe_section_type_flags (tree decl, const char *name, int reloc) ...@@ -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)) if (decl && DECL_P (decl) && DECL_ONE_ONLY (decl))
flags |= SECTION_LINKONCE; 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; return flags;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment