Module Name: src
Committed By: mrg
Date: Thu Jan 31 08:53:07 UTC 2019
Modified Files:
src/external/gpl3/gcc/dist/gcc: varasm.c
Log Message:
revert these two changes which cause various parts of libstdc++ to fail
to build with GCC7:
revision 1.3
date: 2017-07-22 13:52:52 -0700; author: joerg; state: Exp; lines: +2 -1;
commitid: gesFYL8PorhYCg0A;
One more missing check for DECL_INITIAL being non-NULL.
revision 1.2
date: 2017-07-17 12:53:10 -0700; author: joerg; state: Exp; lines: +2149
-1573; commitid: fxGaJg3EuIcnsCZz;
branches: 1.2.2;
A const declaration with explicit section attribute should create a
read-only section, whether it is initialized or not.
XXX: i may have merged them wrongly into gcc7, but AFAICT, they're
expecting to use named BSS sections, so this seems wrong now anyway.
joerg, please feel free to check :-)
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/dist/gcc/varasm.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/gpl3/gcc/dist/gcc/varasm.c
diff -u src/external/gpl3/gcc/dist/gcc/varasm.c:1.6 src/external/gpl3/gcc/dist/gcc/varasm.c:1.7
--- src/external/gpl3/gcc/dist/gcc/varasm.c:1.6 Sat Jan 19 12:10:04 2019
+++ src/external/gpl3/gcc/dist/gcc/varasm.c Thu Jan 31 08:53:07 2019
@@ -969,17 +969,11 @@ decode_reg_name (const char *name)
}
-/*
- * Return true if DECL's initializer is suitable for a BSS section.
- * If there is an explicit section name attribute, assume that it is not
- * for a BSS section, independent of the name.
- */
+/* Return true if DECL's initializer is suitable for a BSS section. */
bool
bss_initializer_p (const_tree decl)
{
- if (DECL_SECTION_NAME (decl) != NULL)
- return false;
return (DECL_INITIAL (decl) == NULL
/* In LTO we have no errors in program; error_mark_node is used
to mark offlined constructors. */
@@ -6471,7 +6465,7 @@ categorize_decl_for_section (const_tree
ret = SECCAT_BSS;
else if (! TREE_READONLY (decl)
|| TREE_SIDE_EFFECTS (decl)
- || (DECL_INITIAL(decl) != NULL && ! TREE_CONSTANT (DECL_INITIAL (decl))))
+ || ! TREE_CONSTANT (DECL_INITIAL (decl)))
{
/* Here the reloc_rw_mask is not testing whether the section should
be read-only or not, but whether the dynamic link will have to
@@ -6491,8 +6485,7 @@ categorize_decl_for_section (const_tree
location. -fmerge-all-constants allows even that (at the
expense of not conforming). */
ret = SECCAT_RODATA;
- else if (DECL_INITIAL (decl) != NULL
- && TREE_CODE (DECL_INITIAL (decl)) == STRING_CST)
+ else if (TREE_CODE (DECL_INITIAL (decl)) == STRING_CST)
ret = SECCAT_RODATA_MERGE_STR_INIT;
else
ret = SECCAT_RODATA_MERGE_CONST;
@@ -6516,7 +6509,6 @@ categorize_decl_for_section (const_tree
no concept of a read-only thread-local-data section. */
if (ret == SECCAT_BSS
|| (flag_zero_initialized_in_bss
- && DECL_INITIAL(decl) != NULL
&& initializer_zerop (DECL_INITIAL (decl))))
ret = SECCAT_TBSS;
else