Launchpad has imported 12 comments from the remote bug at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81924.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://documentation.ubuntu.com/launchpad/user/reference/bugs/multi-project-bugs/about-multi-project-bugs/#bugs-in-external-trackers.

------------------------------------------------------------------------
On 2017-08-22T10:52:10+00:00 Doko-v wrote:

seen with the gcc-5 branch on  powerpc64le-linux-gnu, works on 4.8, 6
and 7, worked around with -O1:

$ gcc-5 -c -g -O2 foo.cfoo.c: In function ‘fn1’:
foo.c:19:1: internal compiler error: in simplify_binary_operation_1, at 
simplify-rtx.c:3678
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.

(gdb) bt
#0  0x0000000010d12b64 in fancy_abort(char const*, int, char const*) ()
#1  0x000000001066d4dc in ?? ()
#2  0x00000000102c2048 in ?? ()
#3  0x00000000102c2f70 in cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, 
int, rtx_def* (*)(rtx_def*, bitmap_head*, int, void*), void*) ()
#4  0x0000000010913938 in ?? ()
#5  0x00000000102c1ef4 in ?? ()
#6  0x00000000102c1bb8 in ?? ()
#7  0x00000000102c2f70 in cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, 
int, rtx_def* (*)(rtx_def*, bitmap_head*, int, void*), void*) ()
#8  0x0000000010913938 in ?? ()
#9  0x00000000102c1ef4 in ?? ()
#10 0x00000000102c2f70 in cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, 
int, rtx_def* (*)(rtx_def*, bitmap_head*, int, void*), void*) ()
#11 0x0000000010912508 in emit_note_insn_var_location(variable_def**, 
emit_note_data_def*) ()
#12 0x0000000010914654 in ?? ()
#13 0x0000000010919428 in ?? ()
#14 0x000000001091bbd8 in ?? ()
#15 0x00000000105b5c10 in execute_one_pass(opt_pass*) ()
#16 0x00000000105b6124 in ?? ()
#17 0x00000000105b613c in ?? ()
#18 0x00000000105b613c in ?? ()
#19 0x00000000105b61c4 in execute_pass_list(function*, opt_pass*) ()
#20 0x00000000102b0bac in cgraph_node::expand() ()
#21 0x00000000102b25d8 in ?? ()
#22 0x00000000102b40a8 in symbol_table::finalize_compilation_unit() ()
#23 0x0000000010176be8 in c_write_global_declarations() ()
#24 0x00000000106903fc in ?? ()
#25 0x00000000101588d8 in toplev::main(int, char**) ()
#26 0x0000000010159348 in main ()

$ cat foo.c
typedef __uint128_t vint128_t __attribute__((vector_size(16)));
vint128_t z;
int x, y;

void fn2(void);

void fn1(void)
{
        vint128_t c;
        y = 1000;
        for (; y; y--) {
                c = c ^ x;
                z -= c;
                z ^= x;
                c = c ^ x;
        }

        fn2();
}

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1673434/comments/5

------------------------------------------------------------------------
On 2017-08-23T01:20:47+00:00 Pinskia wrote:

Maybe related to PR 68805.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1673434/comments/6

------------------------------------------------------------------------
On 2017-10-11T11:44:01+00:00 Jakub-gcc wrote:

We don't ICE anymore on this starting with r229173, but that IMHO just makes 
the bug latent rather than being a real fix.
The bug I see is that the powerpc backend splits
(insn 75 74 76 2 (set (mem/c:V1TI (reg:DI 8 8) [0  S16 A128])
        (reg:V1TI 10 10)) 662 {*vsx_movv1ti}
     (nil))
(insn 76 75 15 2 (set (reg:V1TI 77 0)
        (mem/c:V1TI (reg:DI 8 8) [0  S16 A128])) 634 {*vsx_le_perm_load_v1ti}
     (nil))
into:
(insn 111 74 112 2 (set (mem/c:DI (reg:DI 8 8) [0  S8 A128])
        (reg:DI 10 10)) 417 {*movdi_internal64}
     (nil))
(insn 112 111 113 2 (set (mem/c:DI (plus:DI (reg:DI 8 8)
                (const_int 8 [0x8])) [0  S8 A64])
        (reg:DI 11 11 [+8 ])) 417 {*movdi_internal64}
     (nil))
(insn 113 112 114 2 (set (reg:V1TI 77 0)
        (vec_select:V1TI (mem/c:V1TI (reg:DI 8 8) [0  S16 A128])
            (parallel [
                    (const_int 1 [0x1])
                    (const_int 0 [0])
                ]))) 797 {*vsx_lxvd2x2_le_v1ti}
     (nil))
(insn 114 113 15 2 (set (reg:V1TI 77 0)
        (vec_select:V1TI (reg:V1TI 77 0)
            (parallel [
                    (const_int 1 [0x1])
                    (const_int 0 [0])
                ]))) 789 {*vsx_xxpermdi2_le_v1ti}
     (nil))

That is obviously invalid RTL, V1TImode has only one element, so you
can't select part 1 of it, only part 0.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1673434/comments/7

------------------------------------------------------------------------
On 2017-10-11T11:52:48+00:00 Jakub-gcc wrote:

Actually, it seems like this has been already fixed in 7+ in r246015.
So it is only latent in GCC 6.x.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1673434/comments/8

------------------------------------------------------------------------
On 2017-10-13T01:23:04+00:00 Segher-8 wrote:

Bill, do you want to backport that?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1673434/comments/9

------------------------------------------------------------------------
On 2017-10-19T20:12:36+00:00 Bill-schmidt wrote:

Yeah, that looks like a backporting oversight.

I'll have a look after I recover from the post-vacation email slog.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1673434/comments/10

------------------------------------------------------------------------
On 2017-10-20T20:48:38+00:00 Bill-schmidt wrote:

The patch applies cleanly to gcc-6-branch, and I can certainly commit
that (although I can't show a case where it can happen with present
behavior, it should be cleaned up).

For gcc-5-branch, the patch doesn't apply cleanly, and there would be a
lot of work to establish prerequisites for it to do so.  I was hoping to
be able to offer Matthias a small patch despite GCC 5 being closed, but
that doesn't look feasible.  The problem is that the patch relies on
TImode being hostable in VSX registers, which was not introduced until
GCC 6; prior to that it only resides in a pair of GPRs.

But that means that the problem in GCC 5 is probably different from the
V1TI splitting that Jakub referenced; that code just isn't there.  I'll
see if I can understand this better.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1673434/comments/11

------------------------------------------------------------------------
On 2017-10-20T21:49:37+00:00 Bill-schmidt wrote:

Patch backported to 6 here:  https://gcc.gnu.org/ml/gcc-
patches/2017-10/msg01388.html

Confirmed the GCC 5 issue.  The problem is something happening during
var-tracking:

pr81924.c: In function 'fn1':
pr81924.c:19:1: internal compiler error: in simplify_binary_operation_1, at 
simplify-rtx.c:3634
 }
 ^
0x1065892f simplify_binary_operation_1
        /home/wschmidt/gcc/gcc-5-base/gcc/simplify-rtx.c:3634
0x102af647 cselib_expand_value_rtx_1
        /home/wschmidt/gcc/gcc-5-base/gcc/cselib.c:1853
0x102b056f cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def* 
(*)(rtx_def*, bitmap_head*, int, void*), void*)
        /home/wschmidt/gcc/gcc-5-base/gcc/cselib.c:1561
0x108fd06b vt_expand_var_loc_chain
        /home/wschmidt/gcc/gcc-5-base/gcc/var-tracking.c:8311
0x108fd06b vt_expand_loc_callback
        /home/wschmidt/gcc/gcc-5-base/gcc/var-tracking.c:8473
0x102af4f3 cselib_expand_value_rtx_1
        /home/wschmidt/gcc/gcc-5-base/gcc/cselib.c:1714
0x102af1c7 cselib_expand_value_rtx_1
        /home/wschmidt/gcc/gcc-5-base/gcc/cselib.c:1752
0x102b056f cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def* 
(*)(rtx_def*, bitmap_head*, int, void*), void*)
        /home/wschmidt/gcc/gcc-5-base/gcc/cselib.c:1561
0x108fd06b vt_expand_var_loc_chain
        /home/wschmidt/gcc/gcc-5-base/gcc/var-tracking.c:8311
0x108fd06b vt_expand_loc_callback
        /home/wschmidt/gcc/gcc-5-base/gcc/var-tracking.c:8473
0x102af4f3 cselib_expand_value_rtx_1
        /home/wschmidt/gcc/gcc-5-base/gcc/cselib.c:1714
0x102b056f cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def* 
(*)(rtx_def*, bitmap_head*, int, void*), void*)
        /home/wschmidt/gcc/gcc-5-base/gcc/cselib.c:1561
0x108fbcbb vt_expand_var_loc_chain
        /home/wschmidt/gcc/gcc-5-base/gcc/var-tracking.c:8311
0x108fbcbb vt_expand_1pvar
        /home/wschmidt/gcc/gcc-5-base/gcc/var-tracking.c:8586
0x108fbcbb emit_note_insn_var_location(variable_def**, emit_note_data_def*)
        /home/wschmidt/gcc/gcc-5-base/gcc/var-tracking.c:8641
0x108fdd73 void hash_table<variable_hasher, xcallocator, 
false>::traverse_noresize<emit_note_data_def*, 
&(emit_note_insn_var_location(variable_def**, 
emit_note_data_def*))>(emit_note_data_def*)
        /home/wschmidt/gcc/gcc-5-base/gcc/hash-table.h:1057
0x108fdd73 void hash_table<variable_hasher, xcallocator, 
false>::traverse<emit_note_data_def*, 
&(emit_note_insn_var_location(variable_def**, 
emit_note_data_def*))>(emit_note_data_def*)
        /home/wschmidt/gcc/gcc-5-base/gcc/hash-table.h:1079
0x108fdd73 emit_notes_for_changes
        /home/wschmidt/gcc/gcc-5-base/gcc/var-tracking.c:9001
0x10902bf7 emit_notes_in_bb
        /home/wschmidt/gcc/gcc-5-base/gcc/var-tracking.c:9151
0x10902bf7 vt_emit_notes
        /home/wschmidt/gcc/gcc-5-base/gcc/var-tracking.c:9496
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

...and hm, we do still seem to misuse V1TImode in the same way Jakub
reported.

#1  0x0000000020b89e68 in simplify_binary_operation_1 (code=VEC_SELECT, 
    mode=V1TImode, op0=0x3fffb5da87d8, op1=0x3fffb5b66dd0, 
    trueop0=0x3fffb5da87d8, trueop1=0x3fffb5b66dd0)
    at /home/wschmidt/gcc/gcc-5-base/gcc/simplify-rtx.c:3634
3634              gcc_assert (XVECLEN (trueop1, 0) == GET_MODE_NUNITS (mode));
(gdb) p mode
$1 = V1TImode
(gdb) pr trueop1
(parallel [
        (const_int 1 [0x1])
        (const_int 0 [0])
    ])

Ah, yes, V1TImode is included in VSX_LE, which doesn't work, but all of
the patterns for using rotates instead of vec_select (parallel (...))
aren't present yet, so we can't easily patch this as was done for 6 and
7.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1673434/comments/12

------------------------------------------------------------------------
On 2017-10-20T22:01:38+00:00 Bill-schmidt wrote:

Matthias, the following appears to fix this problem for gcc-5-branch.
Obviously the branch is closed to further development, but if you want
to consider carrying this patch, let me know and I will give it a full
regstrap test.

With the patch, we subreg the V1TImode as a V2DImode so that the RTL is
legitimate:

(insn 19 18 4 2 (set (subreg:V2DI (reg:V1TI 161 [ D.2389 ]) 0)
        (vec_select:V2DI (reg:V2DI 174 [ D.2389 ])
            (parallel [
                    (const_int 1 [0x1])
                    (const_int 0 [0])
                ]))) 956 {*vsx_xxpermdi2_le_v2di}
     (nil))

Here's the simple patch:

(insn 19 18 4 2 (set (subreg:V2DI (reg:V1TI 161 [ D.2389 ]) 0)
        (vec_select:V2DI (reg:V2DI 174 [ D.2389 ])
            (parallel [
                    (const_int 1 [0x1])
                    (const_int 0 [0])
                ]))) 956 {*vsx_xxpermdi2_le_v2di}
     (nil))

Again, this needs full testing before I would recommend using it.

Suggest we close this bug as there will be no upstream resolution for
GCC 5.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1673434/comments/13

------------------------------------------------------------------------
On 2017-10-20T22:04:46+00:00 Bill-schmidt wrote:

Er, HERE is the simple patch:

Index: gcc/config/rs6000/vsx.md
===================================================================
--- gcc/config/rs6000/vsx.md    (revision 253957)
+++ gcc/config/rs6000/vsx.md    (working copy)
@@ -27,9 +27,7 @@
 ;; Iterator for the 2 64-bit vector types + 128-bit types that are loaded with
 ;; lxvd2x to properly handle swapping words on little endian
 (define_mode_iterator VSX_LE [V2DF
-                             V2DI
-                             V1TI
-                             (TI       "VECTOR_MEM_VSX_P (TImode)")])
+                             V2DI])
 
 ;; Iterator for the 2 32-bit vector types
 (define_mode_iterator VSX_W [V4SF V4SI])

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1673434/comments/14

------------------------------------------------------------------------
On 2017-10-22T08:07:46+00:00 Doko-v wrote:

hmm, can't remember anymore where the test case comes from ... :-/  Need
to get more consistent to add downstream bug numbers.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1673434/comments/15

------------------------------------------------------------------------
On 2017-10-23T14:35:01+00:00 Bill-schmidt wrote:

I've backported the fix for the latent bug here:

https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01388.html

I'm going to go ahead and close this since GCC 5 is no longer in
service, and all known related issues for later releases are resolved.
Matthias, feel free to work with me offline if you want to investigate
anything further for 5 out of tree.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1673434/comments/16

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1673434

Title:
  gcc 5.4.0-6ubuntu1~16.04.4  internal compiler error: in
  simplify_binary_operation_1, at simplify-rtx.c:3619

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/1673434/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to