public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/19051] New: m6811-elf-gcc ICE
Date: Fri, 17 Dec 2004 08:34:00 -0000	[thread overview]
Message-ID: <20041217083436.19051.namsh@kldp.org> (raw)


gcc ICE when I did:
===================
$ m6811-elf-g++ -Os -mshort -msoft-reg-count=32 -m68hc12 -c n.cpp

The ICE message is:
===================
n.cpp: In function 'void getNewTableEntry()':
n.cpp:49: error: unable to find a register to spill in class 'D_REGS'
n.cpp:49: error: this is the insn:
(insn:HI 60 59 62 9 (set (reg:HI 59 [ D.1552 ])
        (mult:HI (sign_extend:HI (reg:QI 63))
            (sign_extend:HI (reg/v:QI 14 *_.d1 [orig:55 newIdx ] [55])))) 70 {mulqihi3} (insn_list:REG_DEP_TRUE 59 (nil))
    (expr_list:REG_DEAD (reg/v:QI 14 *_.d1 [orig:55 newIdx ] [55])
        (expr_list:REG_DEAD (reg:QI 63)
            (expr_list:REG_EQUAL (mult:HI (sign_extend:HI (reg/v:QI 14 *_.d1 [orig:55 newIdx ] [55]))
                    (const_int 6 [0x6]))
                (nil)))))
n.cpp:49: internal compiler error: in spill_failure, at reload1.c:1873
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


The m6811-elf-g++ 3.4.4 also generates same ICE.
$ ./m6811-elf-g++ --version
m6811-elf-g++ (GCC) 3.4.4 20041108 (prerelease)

Environment:
System: Linux namsh 2.6.10-rc3n2 #6 Tue Dec 14 15:50:33 KST 2004 i686 athlon i386 GNU/Linux
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: m6811-unknown-none
configured with: ../configure --target=m6811-elf --prefix=/usr/GNUHCS --program-prefix=m6811-elf- --with-gnu-ld --with-gnu-as --disable-shared --enable-languages=c,c++ --without-headers --with-newlib --disable-nls --disable-threads

How-To-Repeat:
Compile the code below with compiler option I described:

// n.cpp
extern signed char g_oldVal, g_newVal;
extern signed char g_base;
extern unsigned char tableA[], tableB[];
extern unsigned char g_AAval, g_APval;
extern unsigned char g_BAval, g_BPval;
extern unsigned int g_ARval, g_ABval;
extern unsigned int g_BRval, g_BBval;

typedef struct {
    unsigned int r;
    unsigned int b;
    unsigned char a;
    unsigned char p;
} TABLEENTRY;

void getNewTableEntry()
{
    signed char oldIdx = g_oldVal, newIdx = g_newVal;
    const signed char maxVal = ((44 * 2) + 6 * 2);

    oldIdx += g_base;
    newIdx += g_base;

    if (oldIdx < 0)
	oldIdx = 0;
    else if (oldIdx > maxVal)
	oldIdx = maxVal;
    if (newIdx < 0)
	newIdx = 0;
    else if (newIdx > maxVal)
	newIdx = maxVal;

    if (oldIdx != newIdx)
    {
	TABLEENTRY *tablePtr;

	tablePtr = (TABLEENTRY *) tableA + newIdx;
	g_ARval = tablePtr->r;
	g_ABval = tablePtr->b;
	g_AAval = tablePtr->a;
	g_APval = tablePtr->p;

	tablePtr = (TABLEENTRY *) tableB + newIdx;
	g_BRval = tablePtr->r;
	g_BBval = tablePtr->b;
	g_BAval = tablePtr->a;
	g_BPval = tablePtr->p;
    }
}
------- Additional Comments From namsh at kldp dot org  2004-12-17 08:34 -------
Fix:
The work-around is:
1. Remove one of the compiler options: -Os or -msoft-reg-count=32
2. Use 'int' instead of 'signed char' for oldIdx/newIdx.

-- 
           Summary: m6811-elf-gcc ICE
           Product: gcc
           Version: 0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: namsh at kldp dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: m6811-unknown-none


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19051


             reply	other threads:[~2004-12-17  8:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-17  8:34 gcc-bugzilla at gcc dot gnu dot org [this message]
2004-12-17 11:04 ` [Bug target/19051] " namsh at kldp dot org
2004-12-17 12:42 ` pinskia at gcc dot gnu dot org
2004-12-18  3:51 ` pinskia at gcc dot gnu dot org
2005-05-08 17:03 ` ciceron at gcc dot gnu dot org
2005-05-08 17:42 ` cvs-commit at gcc dot gnu dot org
2005-05-08 17:48 ` cvs-commit at gcc dot gnu dot org
2005-05-08 17:52 ` cvs-commit at gcc dot gnu dot org
2005-05-08 17:53 ` ciceron at gcc dot gnu dot org
2005-05-08 17:59 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041217083436.19051.namsh@kldp.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).