public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/64075] New: [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106
@ 2014-11-25 21:23 d.g.gorbachev at gmail dot com
  2014-11-25 21:25 ` [Bug lto/64075] " d.g.gorbachev at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2014-11-25 21:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64075

            Bug ID: 64075
           Summary: [5 Regression] ICE: in bp_pack_value, at
                    data-streamer.h:106
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: d.g.gorbachev at gmail dot com

Created attachment 34119
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34119&action=edit
Testcase

GCC 5.0.0 20141123 (experimental).

bug.c:4:1: internal compiler error: in bp_pack_value, at data-streamer.h:106
 }
 ^
0x817a447 bp_pack_value
    ../../gcc-5/gcc/data-streamer.h:105
0x893c35a bp_pack_value
    ../../gcc-5/gcc/data-streamer.h:115
0x893e94e pack_ts_function_decl_value_fields
    ../../gcc-5/gcc/tree-streamer-out.c:303
0x893e94e streamer_pack_tree_bitfields(output_block*, bitpack_d*, tree_node*)
    ../../gcc-5/gcc/tree-streamer-out.c:443
0x86045b9 lto_write_tree_1
    ../../gcc-5/gcc/lto-streamer-out.c:370
0x860ea18 lto_write_tree
    ../../gcc-5/gcc/lto-streamer-out.c:404
0x860ea18 lto_output_tree_1
    ../../gcc-5/gcc/lto-streamer-out.c:447
0x860ea18 DFS::DFS_write_tree(output_block*, DFS::sccs*, tree_node*, bool,
bool, bool)
    ../../gcc-5/gcc/lto-streamer-out.c:1448
0x860f20e DFS::DFS(output_block*, tree_node*, bool, bool, bool)
    ../../gcc-5/gcc/lto-streamer-out.c:495
0x860fca2 lto_output_tree(output_block*, tree_node*, bool, bool)
    ../../gcc-5/gcc/lto-streamer-out.c:1552
0x8603c47 write_global_stream
    ../../gcc-5/gcc/lto-streamer-out.c:2339
0x8612480 lto_output_decl_state_streams
    ../../gcc-5/gcc/lto-streamer-out.c:2386
0x8612480 produce_asm_for_decls()
    ../../gcc-5/gcc/lto-streamer-out.c:2666
0x8668ab0 write_lto
    ../../gcc-5/gcc/passes.c:2391
0x866bdd9 ipa_write_summaries_1
    ../../gcc-5/gcc/passes.c:2451
0x866bdd9 ipa_write_summaries(bool)
    ../../gcc-5/gcc/passes.c:2511
0x834d703 ipa_passes
    ../../gcc-5/gcc/cgraphunit.c:2091
0x834d703 symbol_table::compile()
    ../../gcc-5/gcc/cgraphunit.c:2187
0x834f542 symbol_table::finalize_compilation_unit()
    ../../gcc-5/gcc/cgraphunit.c:2340
0x81e0feb c_write_global_declarations()
    ../../gcc-5/gcc/c/c-decl.c:10777
Please submit a full bug report,
with preprocessed source if appropriate.


libgcc


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/64075] [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106
  2014-11-25 21:23 [Bug lto/64075] New: [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106 d.g.gorbachev at gmail dot com
@ 2014-11-25 21:25 ` d.g.gorbachev at gmail dot com
  2014-11-25 21:52 ` hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2014-11-25 21:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64075

Dmitry Gorbachev <d.g.gorbachev at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code, lto
             Target|                            |i686-pc-linux-gnu

--- Comment #1 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> ---
This happens when compiling libgcc with -flto.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/64075] [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106
  2014-11-25 21:23 [Bug lto/64075] New: [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106 d.g.gorbachev at gmail dot com
  2014-11-25 21:25 ` [Bug lto/64075] " d.g.gorbachev at gmail dot com
@ 2014-11-25 21:52 ` hjl.tools at gmail dot com
  2014-11-25 22:29 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2014-11-25 21:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64075

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|i686-pc-linux-gnu           |
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-11-25
   Target Milestone|---                         |5.0
     Ever confirmed|0                           |1

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
It also happens on Linux/x86-64 with just -flto.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/64075] [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106
  2014-11-25 21:23 [Bug lto/64075] New: [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106 d.g.gorbachev at gmail dot com
  2014-11-25 21:25 ` [Bug lto/64075] " d.g.gorbachev at gmail dot com
  2014-11-25 21:52 ` hjl.tools at gmail dot com
@ 2014-11-25 22:29 ` hjl.tools at gmail dot com
  2014-11-26  8:51 ` enkovich.gnu at gmail dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2014-11-25 22:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64075

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |enkovich.gnu at gmail dot com

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
It was caused by r217655.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/64075] [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106
  2014-11-25 21:23 [Bug lto/64075] New: [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106 d.g.gorbachev at gmail dot com
                   ` (2 preceding siblings ...)
  2014-11-25 22:29 ` hjl.tools at gmail dot com
@ 2014-11-26  8:51 ` enkovich.gnu at gmail dot com
  2014-11-26 10:11 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: enkovich.gnu at gmail dot com @ 2014-11-26  8:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64075

--- Comment #4 from Ilya Enkovich <enkovich.gnu at gmail dot com> ---
(In reply to H.J. Lu from comment #3)
> It was caused by r217655.
The problem was introduced earlier when function_code field in
tree_function_decl was extended to 12 bits.  LTO streamers were not fixed
appropriately.  r217655 increased BUILT_IN_COMPLEX_MUL_MIN value and put it out
of 11 bits which revealed the problem.

With this patch compiles OK:

diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c
index 99448dd..eb205ed 100644
--- a/gcc/tree-streamer-in.c
+++ b/gcc/tree-streamer-in.c
@@ -333,7 +333,7 @@ unpack_ts_function_decl_value_fields (struct bitpack_d *bp,
tree expr)
   if (DECL_BUILT_IN_CLASS (expr) != NOT_BUILT_IN)
     {
       DECL_FUNCTION_CODE (expr) = (enum built_in_function) bp_unpack_value
(bp,
-                                                                          
11);
+                                                                          
12);
       if (DECL_BUILT_IN_CLASS (expr) == BUILT_IN_NORMAL
          && DECL_FUNCTION_CODE (expr) >= END_BUILTINS)
        fatal_error ("machine independent builtin code out of range");
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c
index ad58b84..0d87cff 100644
--- a/gcc/tree-streamer-out.c
+++ b/gcc/tree-streamer-out.c
@@ -300,7 +300,7 @@ pack_ts_function_decl_value_fields (struct bitpack_d *bp,
tree expr)
   bp_pack_value (bp, DECL_PURE_P (expr), 1);
   bp_pack_value (bp, DECL_LOOPING_CONST_OR_PURE_P (expr), 1);
   if (DECL_BUILT_IN_CLASS (expr) != NOT_BUILT_IN)
-    bp_pack_value (bp, DECL_FUNCTION_CODE (expr), 11);
+    bp_pack_value (bp, DECL_FUNCTION_CODE (expr), 12);
 }


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/64075] [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106
  2014-11-25 21:23 [Bug lto/64075] New: [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106 d.g.gorbachev at gmail dot com
                   ` (3 preceding siblings ...)
  2014-11-26  8:51 ` enkovich.gnu at gmail dot com
@ 2014-11-26 10:11 ` rguenth at gcc dot gnu.org
  2014-11-26 13:54 ` ienkovich at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-26 10:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64075

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/64075] [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106
  2014-11-25 21:23 [Bug lto/64075] New: [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106 d.g.gorbachev at gmail dot com
                   ` (4 preceding siblings ...)
  2014-11-26 10:11 ` rguenth at gcc dot gnu.org
@ 2014-11-26 13:54 ` ienkovich at gcc dot gnu.org
  2014-11-26 16:28 ` d.g.gorbachev at gmail dot com
  2014-11-26 17:54 ` enkovich.gnu at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: ienkovich at gcc dot gnu.org @ 2014-11-26 13:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64075

--- Comment #5 from ienkovich at gcc dot gnu.org ---
Author: ienkovich
Date: Wed Nov 26 13:53:38 2014
New Revision: 218083

URL: https://gcc.gnu.org/viewcvs?rev=218083&root=gcc&view=rev
Log:
gcc/

    PR lto/64075
    * tree-streamer-in.c (unpack_ts_function_decl_value_fields): Use
    proper size for function_code bitfield.
    (pack_ts_function_decl_value_fields): Likewise.

gcc/testsuite/

    PR lto/64075
    * gcc.dg/pr64075.c: New.


Added:
    trunk/gcc/testsuite/gcc.dg/pr64075.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-streamer-in.c
    trunk/gcc/tree-streamer-out.c


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/64075] [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106
  2014-11-25 21:23 [Bug lto/64075] New: [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106 d.g.gorbachev at gmail dot com
                   ` (5 preceding siblings ...)
  2014-11-26 13:54 ` ienkovich at gcc dot gnu.org
@ 2014-11-26 16:28 ` d.g.gorbachev at gmail dot com
  2014-11-26 17:54 ` enkovich.gnu at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2014-11-26 16:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64075

--- Comment #6 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> ---
The patch works, thanks! But the committed test is incorrect, because the
original, unpatched compiler, does not fail on it. It failed on functions
__mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3, and
__divtc3.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/64075] [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106
  2014-11-25 21:23 [Bug lto/64075] New: [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106 d.g.gorbachev at gmail dot com
                   ` (6 preceding siblings ...)
  2014-11-26 16:28 ` d.g.gorbachev at gmail dot com
@ 2014-11-26 17:54 ` enkovich.gnu at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: enkovich.gnu at gmail dot com @ 2014-11-26 17:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64075

--- Comment #7 from Ilya Enkovich <enkovich.gnu at gmail dot com> ---
(In reply to Dmitry Gorbachev from comment #6)
> The patch works, thanks! But the committed test is incorrect, because the
> original, unpatched compiler, does not fail on it. It failed on functions
> __mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3, and
> __divtc3.

Committed test is what you attached as a reproducer with function renamed to
'test'.  Why shouldn't it work? I used it to reproduce and debug the issue on
today's trunk compiler.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-11-26 17:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-25 21:23 [Bug lto/64075] New: [5 Regression] ICE: in bp_pack_value, at data-streamer.h:106 d.g.gorbachev at gmail dot com
2014-11-25 21:25 ` [Bug lto/64075] " d.g.gorbachev at gmail dot com
2014-11-25 21:52 ` hjl.tools at gmail dot com
2014-11-25 22:29 ` hjl.tools at gmail dot com
2014-11-26  8:51 ` enkovich.gnu at gmail dot com
2014-11-26 10:11 ` rguenth at gcc dot gnu.org
2014-11-26 13:54 ` ienkovich at gcc dot gnu.org
2014-11-26 16:28 ` d.g.gorbachev at gmail dot com
2014-11-26 17:54 ` enkovich.gnu at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).