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

            Bug ID: 78222
           Summary: target-tilegx: Incorrect bundle: let addli in y pipe
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gang.chen.5i5j at gmail dot com
  Target Milestone: ---
              Host: chroot ubuntu 15.10 under Android 5.1 x86_64
            Target: tilegx
             Build: Just building, use the latest version

1. Version:

COLLECT_GCC=/upstream/build-gcc/./gcc/xgcc
COLLECT_LTO_WRAPPER=/upstream/build-gcc/./gcc/lto-wrapper
Target: tilegx-gchen-linux
Configured with: ../gcc/configure --target=tilegx-gchen-linux --disable-nls
--enable-languages=c --disable-threads --disable-shared --disable-libssp
--disable-libquadmath --disable-libgomp --disable-libatomic
--prefix=/upstream/release-tile --disable-multilib
--with-headers=/upstream/release-tile/include
Thread model: single
gcc version 7.0.0 20161105 (experimental) (GCC)


2. Contents of test.c:

typedef int DItype __attribute__ ((mode (DI)));
typedef unsigned int UTItype __attribute__ ((mode (TI)));

UTItype test (UTItype *rp)
{
  union
  {
    DItype low;
    UTItype ll;
  } uu, nn, dd, rr;

  UTItype w, r;
  DItype c1, c2, d0 = dd.low, n1 = nn.low;

  if (uu.low < 0)
    c1 = ~c1, c2 = ~c2, uu.ll = -uu.ll;

  rr.low = n1 % d0;
  w = rr.ll;

  if (c1)
    r = -r;
  if (c2)
    r = -r;
  *rp = r;
  return w;
}


3. Compiling issue:

/upstream/build-gcc/./gcc/xgcc -B/upstream/build-gcc/./gcc/
-B/upstream/release-tile/tilegx-gchen-linux/bin/
-B/upstream/release-tile/tilegx-gchen-linux/lib/ -O2 -c test.c
-fnon-call-exceptions -save-temps

test.s: Assembler messages:
test.s:84: Error: Invalid combination of instructions for bundle.


4. Contents of output (test.s):

  1         .file   "test.c"
  2 .global __moddi3
  3         .text
  4         .align 8
  5 .global test
  6         .type   test, @function
  7 test:
  8 .LFB0:
  9         .cfi_startproc
 10         {
 11         st      sp, lr
 12         .cfi_offset 55, 0
 13         move    r29, sp
 14         addi    r28, sp, -120
 15         }
 16         addi    sp, sp, -128
 17         .cfi_def_cfa_offset 128
 18         {
 19         st      r28, r29
 20         addi    r27, sp, 120
 21         addi    r26, sp, 112
 22         }
 23         {
 24         st      r27, r34
 25         .cfi_offset 34, -8
 26         addi    r25, sp, 104
 27         addi    r10, sp, 16
 28         }
 29         {
 30         st      r26, r33
 31         .cfi_offset 33, -16
 32         addi    r24, sp, 96
 33         addi    r11, sp, 48
 34         }
 35         {
 36         st      r25, r32
 37         .cfi_offset 32, -24
 38         addi    r27, r27, -32
 39         }
 40         ld      r10, r10
 41         st      r24, r31
 42         .cfi_offset 31, -32
 43         {
 44         ld      r1, r11
 45         addi    r11, sp, 32
 46         cmpltsi r12, r10, 0
 47         }
 48         {
 49         st      r27, r30
 50         .cfi_offset 30, -40
 51         move    r30, r0
 52         }
 53         {
 54         ld      r0, r11
 55         movei   r11, -1
 56         }
 57         cmovnez r33, r12, r11
 58         {
 59         cmovnez r34, r12, r11
 60         jal     __moddi3
 61         }
 62         {
 63         addi    r10, sp, 72
 64         mz      r31, r33, r31
 65         }
 66         {
 67         ld      r1, r10
 68         mz      r32, r33, r32
 69         }
 70         beqz    r34, .L4
 71         {
 72         sub     r31, zero, r31
 73         sub     r32, zero, r32
 74         }
 75         cmpne   r10, r31, zero
 76         sub     r32, r32, r10
 77 .L4:
 78         move    r10, r30
 79         st_add  r10, r31, 8
 80         {
 81         st      r10, r32
 82         addi    r28, sp, 120
 83         addli   r29, sp, 128
 84         }
 85         {
 86         ld      r34, r28
 87         addi    r27, sp, 112
 88         addi    r26, sp, 104
 89         }
 90         {
 91         addi    r25, sp, 96
 92         addi    r28, r28, -32
 93         ld      lr, r29
 94         }
 95         ld      r33, r27
 96         ld      r32, r26
 97         ld      r31, r25
 98         ld      r30, r28
 99         {
100         addli   sp, sp, 128
101         .cfi_restore 54
102         .cfi_restore 30
103         .cfi_restore 31
104         .cfi_restore 32
105         .cfi_restore 33
106         .cfi_restore 34
107         .cfi_restore 55
108         .cfi_def_cfa_offset 0
109         jrp     lr
110         }
111         .cfi_endproc
112 .LFE0:
113         .size   test, .-test
114         .ident  "GCC: (GNU) 7.0.0 20161105 (experimental)"
115         .section        .note.GNU-stack,"",@progbits

Reply via email to