diff mbox

Fix inconsistent section flags

Message ID 20170722223756.GA14249@britannica.bec.de
State New
Headers show

Commit Message

Joerg Sonnenberger July 22, 2017, 10:37 p.m. UTC
One more patch needed for another edge condition.

Joerg

Comments

Maya Rashish Aug. 22, 2017, 1:34 p.m. UTC | #1
ping
diff mbox

Patch

Index: src/external/gpl3/gcc/dist/gcc/varasm.c
diff -u src/external/gpl3/gcc/dist/gcc/varasm.c:1.2 src/external/gpl3/gcc/dist/gcc/varasm.c:1.3
--- src/external/gpl3/gcc/dist/gcc/varasm.c:1.2	Mon Jul 17 19:53:10 2017
+++ src/external/gpl3/gcc/dist/gcc/varasm.c	Sat Jul 22 20:52:52 2017
@@ -6428,7 +6428,8 @@ 
 	   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;