[Bug target/83100] [8 Regression] powerpc: internal compiler error: in get_variable_section, at varasm.c:1150 with -fdata-sections

2017-11-29 Thread ian at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83100

--- Comment #10 from ian at gcc dot gnu.org  ---
Author: ian
Date: Thu Nov 30 05:03:29 2017
New Revision: 255266

URL: https://gcc.gnu.org/viewcvs?rev=255266=gcc=rev
Log:
compiler: don't make map zero value constant

The map zero value is a common symbol, and it doesn't really make
sense to have a constant common symbol. Current GCC has started to
reject this case, probably as part of the fix for PR 83100.

Reviewed-on: https://go-review.googlesource.com/80877

Modified:
trunk/gcc/go/gofrontend/MERGE
trunk/gcc/go/gofrontend/types.cc

[Bug target/83100] [8 Regression] powerpc: internal compiler error: in get_variable_section, at varasm.c:1150 with -fdata-sections

2017-11-27 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83100

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Jakub Jelinek  ---
Fixed.

[Bug target/83100] [8 Regression] powerpc: internal compiler error: in get_variable_section, at varasm.c:1150 with -fdata-sections

2017-11-27 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83100

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Mon Nov 27 08:34:50 2017
New Revision: 255160

URL: https://gcc.gnu.org/viewcvs?rev=255160=gcc=rev
Log:
PR target/83100
* varasm.c (bss_initializer_p): Return true for DECL_COMMON
TREE_READONLY decls.

* gcc.dg/pr83100-1.c: New test.
* gcc.dg/pr83100-2.c: New test.
* gcc.dg/pr83100-3.c: New test.
* gcc.dg/pr83100-4.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr83100-1.c
trunk/gcc/testsuite/gcc.dg/pr83100-2.c
trunk/gcc/testsuite/gcc.dg/pr83100-3.c
trunk/gcc/testsuite/gcc.dg/pr83100-4.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/varasm.c

[Bug target/83100] [8 Regression] powerpc: internal compiler error: in get_variable_section, at varasm.c:1150 with -fdata-sections

2017-11-24 Thread jrtc27 at jrtc27 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83100

--- Comment #7 from James Clarke  ---
(In reply to Jakub Jelinek from comment #4)
> That change looks wrong to me.
> Previously the variable was common and thus if you e.g. mixed it with some
> other TU that has const int a = 5; then you could link the two together and
> the value of the variable would be 5.  But with the changes, that is no
> longer the case (if it doesn't ICE), the variable is put into .rodata
> section.

Yes, and in fact I saw this behaviour and got pointed at that commit about a
week ago, as I was seeing duplicate symbol errors when linking another piece of
software. As it happens, the declaration in the header in that case should have
been extern, but the change in GCC's behaviour still made me uneasy.

[Bug target/83100] [8 Regression] powerpc: internal compiler error: in get_variable_section, at varasm.c:1150 with -fdata-sections

2017-11-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83100

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-11-24
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #6 from Jakub Jelinek  ---
Created attachment 42715
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42715=edit
gcc8-pr83100.patch

Complete untested patch, will bootstrap/regtest it now on x86_64/i686 and
powerpc64{,le}-linux.

[Bug target/83100] [8 Regression] powerpc: internal compiler error: in get_variable_section, at varasm.c:1150 with -fdata-sections

2017-11-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83100

--- Comment #5 from Jakub Jelinek  ---
I'll test:
--- gcc/varasm.c.jj 2017-11-21 20:23:02.0 +0100
+++ gcc/varasm.c2017-11-24 21:43:55.616951823 +0100
@@ -986,9 +986,9 @@ decode_reg_name (const char *name)
 bool
 bss_initializer_p (const_tree decl)
 {
-  /* Do not put constants into the .bss section, they belong in a readonly
- section.  */
-  return (!TREE_READONLY (decl)
+  /* Do not put non-common constants into the .bss section, they belong in
+ a readonly section.  */
+  return ((!TREE_READONLY (decl) || DECL_COMMON (decl))
  && (DECL_INITIAL (decl) == NULL
  /* In LTO we have no errors in program; error_mark_node is used
 to mark offlined constructors.  */
after cooking up a testcase.

[Bug target/83100] [8 Regression] powerpc: internal compiler error: in get_variable_section, at varasm.c:1150 with -fdata-sections

2017-11-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83100

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||law at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek  ---
That change looks wrong to me.
Previously the variable was common and thus if you e.g. mixed it with some
other TU that has const int a = 5; then you could link the two together and the
value of the variable would be 5.  But with the changes, that is no longer the
case (if it doesn't ICE), the variable is put into .rodata section.

[Bug target/83100] [8 Regression] powerpc: internal compiler error: in get_variable_section, at varasm.c:1150 with -fdata-sections

2017-11-22 Thread jrtc27 at jrtc27 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83100

--- Comment #3 from James Clarke  ---
With the same example, I can reproduce on aarch64, armel, powerpc, ppc64 and
ppc64el.

[Bug target/83100] [8 Regression] powerpc: internal compiler error: in get_variable_section, at varasm.c:1150 with -fdata-sections

2017-11-22 Thread helmut at subdivi dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83100

--- Comment #2 from Helmut Grohne  ---
affects armel https://jenkins.debian.net/job/rebootstrap_armel_gcc8/2/console

[Bug target/83100] [8 Regression] powerpc: internal compiler error: in get_variable_section, at varasm.c:1150 with -fdata-sections

2017-11-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83100

Richard Biener  changed:

   What|Removed |Added

 Target||powerpc
  Component|c   |target
   Target Milestone|--- |8.0