Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gcc/dist/gcc revert these two changes which ca...



details:   https://anonhg.NetBSD.org/src/rev/99e117bc086e
branches:  trunk
changeset: 996410:99e117bc086e
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Jan 31 08:53:07 2019 +0000

description:
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 :-)

diffstat:

 external/gpl3/gcc/dist/gcc/varasm.c |  14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diffs (49 lines):

diff -r d63d53a3b62f -r 99e117bc086e external/gpl3/gcc/dist/gcc/varasm.c
--- a/external/gpl3/gcc/dist/gcc/varasm.c       Thu Jan 31 08:44:14 2019 +0000
+++ b/external/gpl3/gcc/dist/gcc/varasm.c       Thu Jan 31 08:53:07 2019 +0000
@@ -969,17 +969,11 @@
 }
 
 
-/*
- * 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 @@
        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 @@
           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 @@
         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



Home | Main Index | Thread Index | Old Index