Commit ffe5d708 by Steven Bosscher

varasm.c (assemble_external): Assert this function is only called during or after expanding to RTL.

	* varasm.c (assemble_external): Assert this function is only called
	during or after expanding to RTL.

From-SVN: r185812
parent 0a7d0933
2012-03-26 Steven Bosscher <steven@gcc.gnu.org>
* varasm.c (assemble_external): Assert this function is only called
during or after expanding to RTL.
2012-03-26 Martin Jambor <mjambor@suse.cz> 2012-03-26 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/50052 PR tree-optimization/50052
......
...@@ -2166,12 +2166,18 @@ static GTY(()) tree weak_decls; ...@@ -2166,12 +2166,18 @@ static GTY(()) tree weak_decls;
void void
assemble_external (tree decl ATTRIBUTE_UNUSED) assemble_external (tree decl ATTRIBUTE_UNUSED)
{ {
/* Because most platforms do not define ASM_OUTPUT_EXTERNAL, the /* Make sure that the ASM_OUT_FILE is open.
main body of this code is only rarely exercised. To provide some If it's not, we should not be calling this function. */
testing, on all platforms, we make sure that the ASM_OUT_FILE is
open. If it's not, we should not be calling this function. */
gcc_assert (asm_out_file); gcc_assert (asm_out_file);
/* This function should only be called if we are expanding, or have
expanded, to RTL.
Ideally, only final.c would be calling this function, but it is
not clear whether that would break things somehow. See PR 17982
for further discussion. */
gcc_assert (cgraph_state == CGRAPH_STATE_EXPANSION
|| cgraph_state == CGRAPH_STATE_FINISHED);
if (!DECL_P (decl) || !DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl)) if (!DECL_P (decl) || !DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl))
return; return;
......
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