Bug 17119

Summary: [m32r] ICE at switch case 0x8000
Product: gcc Reporter: inaoka.kazuhiro
Component: targetAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs
Priority: P2    
Version: 3.4.2   
Target Milestone: 3.4.2   
Host: Target: m32r-elf m32r-linux
Build: Known to work:
Known to fail: Last reconfirmed:

Description inaoka.kazuhiro 2004-08-20 09:27:24 UTC
--- ice_cbit.c ---
void
_mesa_DrawPixels( int width, int height,
                  unsigned int format , unsigned int type,
                  const void *pixels )
{
  switch (format) {
  case 0x1900:
    func1();
    break;
  case 0x1907:
  case 0x80E0:
  case 0x1908:
  case 0x80E1:
  case 0x8000:
    func2();
    break;
  }
}

m32r-elf-gcc -c -O0 ice_cbit.c
ice_cbit.c: In function `_mesa_DrawPixels':
ice_cbit.c:18: error: unrecognizable insn:
(insn 45 62 46 5 ice_cbit.c:8 (set (reg:CC 17 cbit)
        (ltu:CC (reg:SI 25 [ format ])
            (const_int 32768 [0x8000]))) -1 (nil)
    (nil))
ice_cbit.c:18: internal compiler error: in extract_insn, at recog.c:2083

Test Version:
Reading specs from /usr/local/m32r-elf/lib/gcc/m32r-elf/3.4.2/specs
Configured with: /home3/FSF/org_src/gcc-3.4/gcc/configure --target=m32r-elf
--prefix=/usr/local/m32r-elf --srcdir=/home3/FSF/org_src/gcc-3.4/gcc
--enable-languages=c,c++ --with-newlib
Thread model: single
gcc version 3.4.2 20040819 (prerelease)
Comment 1 GCC Commits 2004-08-26 13:00:22 UTC
Subject: Bug 17119

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	nickc@gcc.gnu.org	2004-08-26 13:00:15

Modified files:
	gcc            : ChangeLog 
	gcc/config/m32r: m32r.c 

Log message:
	PR target/17119.
	* config/m32r.c (gen_compare): Use reg_or_int16_operand when checking for a
	valid constant, regardless of sign.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.599&r2=2.2326.2.600
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m32r/m32r.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.80.4.3&r2=1.80.4.4

Comment 2 GCC Commits 2004-08-26 13:03:06 UTC
Subject: Bug 17119

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	nickc@gcc.gnu.org	2004-08-26 13:03:03

Modified files:
	gcc            : ChangeLog 
	gcc/testsuite  : ChangeLog 
	gcc/config/m32r: m32r.c 
Added files:
	gcc/testsuite/gcc.c-torture/compile: pr17119.c 

Log message:
	PR target/17119.
	config/m32r.c (gen_compare): Use reg_or_int16_operand when checking for a
	valid constant, regardless of sign.
	testsuite/gcc.c-torture/compile/pr17119.c: New test (for this failure)

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5103&r2=2.5104
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4199&r2=1.4200
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/pr17119.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m32r/m32r.c.diff?cvsroot=gcc&r1=1.105&r2=1.106

Comment 3 Andrew Pinski 2004-08-26 14:14:24 UTC
Fixed.