One more missing check for DECL_INITIAL being non-NULL.

This commit is contained in:
joerg 2017-07-22 20:52:52 +00:00
parent d2806feea4
commit fc278ede3a

View File

@ -6428,7 +6428,8 @@ categorize_decl_for_section (const_tree decl, int reloc)
location. -fmerge-all-constants allows even that (at the
expense of not conforming). */
ret = SECCAT_RODATA;
else if (TREE_CODE (DECL_INITIAL (decl)) == STRING_CST)
else if (DECL_INITIAL (decl) != NULL
&& TREE_CODE (DECL_INITIAL (decl)) == STRING_CST)
ret = SECCAT_RODATA_MERGE_STR_INIT;
else
ret = SECCAT_RODATA_MERGE_CONST;