Commit 2c7b8bf6 by Alan Modra Committed by Alan Modra

varasm.c (get_section): Don't die on !DECL_P decl.

	* varasm.c (get_section): Don't die on !DECL_P decl.  Tidy error
	reporting.
	(get_named_section): Don't NULL !DECL_P decl.

From-SVN: r199949
parent 0372af98
2013-06-11 Alan Modra <amodra@gmail.com>
* varasm.c (get_section): Don't die on !DECL_P decl. Tidy error
reporting.
(get_named_section): Don't NULL !DECL_P decl.
2013-06-11 Igor Zamyatin <igor.zamyatin@intel.com>
* doc/invoke.texi (core-avx2): Document.
......
......@@ -307,19 +307,22 @@ get_section (const char *name, unsigned int flags, tree decl)
return sect;
}
/* Sanity check user variables for flag changes. */
if (decl == 0)
decl = sect->named.decl;
gcc_assert (decl);
if (sect->named.decl == NULL)
error ("%+D causes a section type conflict", decl);
else
if (sect->named.decl != NULL
&& DECL_P (sect->named.decl)
&& decl != sect->named.decl)
{
error ("%+D causes a section type conflict with %D",
decl, sect->named.decl);
if (decl != sect->named.decl)
inform (DECL_SOURCE_LOCATION (sect->named.decl),
"%qD was declared here", sect->named.decl);
if (decl != NULL && DECL_P (decl))
error ("%+D causes a section type conflict with %D",
decl, sect->named.decl);
else
error ("section type conflict with %D", sect->named.decl);
inform (DECL_SOURCE_LOCATION (sect->named.decl),
"%qD was declared here", sect->named.decl);
}
else if (decl != NULL && DECL_P (decl))
error ("%+D causes a section type conflict", decl);
else
error ("section type conflict");
/* Make sure we don't error about one section multiple times. */
sect->common.flags |= SECTION_OVERRIDE;
}
......@@ -409,9 +412,6 @@ get_named_section (tree decl, const char *name, int reloc)
}
flags = targetm.section_type_flags (decl, name, reloc);
if (decl && !DECL_P (decl))
decl = NULL_TREE;
return get_section (name, flags, decl);
}
......
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