Change an assignment to an assert in varpool

Bernd Schmidt bernds@codesourcery.com
Fri Jul 11 13:02:00 GMT 2014


I noticed that we set node->definition = true in varpool_assemble_decl. 
The surrounding code suggests that we should only ever get there if 
definition is already true, so I changed it to an assert. The question 
is interesting for some modifications I'm making for ptx (which requires 
declarations for external variables in the assembly).

The only thing that was tripped by the assert was a variable created by 
asan. AFAICT the problem there is that asan calls varpool_assemble_decl 
when it should be calling varpool_finalize_decl.

Bootstrapped and tested on x86_64-linux, ok?


Bernd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: varpool-assert.diff
Type: text/x-patch
Size: 1053 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140711/0cd7ca89/attachment.bin>


More information about the Gcc-patches mailing list