This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

target/10413: SH ICE 3.3 branch


>Number:         10413
>Category:       target
>Synopsis:       SH ICE 3.3 branch
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 15 12:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     dhananjayd at kpitcummins dot com
>Release:        3.2, 3.3 branch
>Organization:
>Environment:
Linux X SH
>Description:
The source code below if compiled with sh-elf-gcc -S -m2 -O2 -mhitachi gives Internal Compiler error.

[dhananjayd at Linuxsrv5 gnu]$ ~/sh2e-elf/bin/sh-elf-gcc -S -m2  -O2 -mhitachi bug.c  
bug.c: In function `func1':
bug.c:39: error: insn does not satisfy its constraints:
(insn:HI 29 28 160 0 0x4015b980 (set (reg/v:SI 148 mach [166])
        (reg:SI 149 macl)) 122 {movsi_i} (insn_list 28 (nil))
    (expr_list:REG_EQUAL (mult:SI (reg:SI 0 r0 [172])
            (reg/v:SI 11 r11 [163]))
        (nil)))
bug.c:39: internal compiler error: in reload_cse_simplify_operands, at reload1.c
:8335
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

-----------------------------------------------------------
int func0 (unsigned long  address,
    unsigned long  stride,
    char*          p_buffer,
    unsigned long  count,
    unsigned short chk);

int func1 (unsigned short type,
    unsigned long  count,
    unsigned long  address,
    unsigned long  stride,
    void*          buffer)
{
  unsigned long  remainder = count;
  unsigned long  block_size;
  unsigned short chk;
  char*          p_buffer = buffer;
  int            err      = 0;

  block_size = 0x3ff0/8/stride * stride;

  while (remainder)
    {
      if (type == 0)
        {
          while (1)
            {
              count = (remainder < block_size) ? remainder : block_size;
              err   = func0 (address, stride, p_buffer, count, chk = 0);
              if (err) break;
            }
          count     = (count < 2) ? count : count - 1;
          p_buffer += count;
        }
      remainder -= count;
      address   += count * stride;
    }
  return err;
}

-----------------------------------------------------------

It is trying to load macl into mach but no such instruction exists. The problem disappears in mainline but could appear with different test case with more register pressure.
>How-To-Repeat:
Try compiling above test case with sh-elf-gcc -S -m2  -O2 -mhitachi bug.c  
>Fix:
Remove -mhitachi option.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bug.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug.c"

DQppbnQgZnVuYzAgKHVuc2lnbmVkIGxvbmcgIGFkZHJlc3MsDQogICAgdW5zaWduZWQgbG9uZyAg
c3RyaWRlLA0KICAgIGNoYXIqICAgICAgICAgIHBfYnVmZmVyLA0KICAgIHVuc2lnbmVkIGxvbmcg
IGNvdW50LA0KICAgIHVuc2lnbmVkIHNob3J0IGNoayk7DQoNCmludCBmdW5jMSAodW5zaWduZWQg
c2hvcnQgdHlwZSwNCiAgICB1bnNpZ25lZCBsb25nICBjb3VudCwNCiAgICB1bnNpZ25lZCBsb25n
ICBhZGRyZXNzLA0KICAgIHVuc2lnbmVkIGxvbmcgIHN0cmlkZSwNCiAgICB2b2lkKiAgICAgICAg
ICBidWZmZXIpDQp7DQogIHVuc2lnbmVkIGxvbmcgIHJlbWFpbmRlciA9IGNvdW50Ow0KICB1bnNp
Z25lZCBsb25nICBibG9ja19zaXplOw0KICB1bnNpZ25lZCBzaG9ydCBjaGs7DQogIGNoYXIqICAg
ICAgICAgIHBfYnVmZmVyID0gYnVmZmVyOw0KICBpbnQgICAgICAgICAgICBlcnIgICAgICA9IDA7
DQoNCiAgYmxvY2tfc2l6ZSA9IDB4M2ZmMC84L3N0cmlkZSAqIHN0cmlkZTsNCg0KICB3aGlsZSAo
cmVtYWluZGVyKQ0KICAgIHsNCiAgICAgIGlmICh0eXBlID09IDApDQogICAgICAgIHsNCiAgICAg
ICAgICB3aGlsZSAoMSkNCiAgICAgICAgICAgIHsNCiAgICAgICAgICAgICAgY291bnQgPSAocmVt
YWluZGVyIDwgYmxvY2tfc2l6ZSkgPyByZW1haW5kZXIgOiBibG9ja19zaXplOw0KICAgICAgICAg
ICAgICBlcnIgICA9IGZ1bmMwIChhZGRyZXNzLCBzdHJpZGUsIHBfYnVmZmVyLCBjb3VudCwgY2hr
ID0gMCk7DQogICAgICAgICAgICAgIGlmIChlcnIpIGJyZWFrOw0KICAgICAgICAgICAgfQ0KICAg
ICAgICAgIGNvdW50ICAgICA9IChjb3VudCA8IDIpID8gY291bnQgOiBjb3VudCAtIDE7DQogICAg
ICAgICAgcF9idWZmZXIgKz0gY291bnQ7DQogICAgICAgIH0NCiAgICAgIHJlbWFpbmRlciAtPSBj
b3VudDsNCiAgICAgIGFkZHJlc3MgICArPSBjb3VudCAqIHN0cmlkZTsNCiAgICB9DQogIHJldHVy
biBlcnI7DQp9DQoNCg==


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]