public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/14629] New: ICE on c++ source
@ 2004-03-18 11:49 gcc-bugzilla at gcc dot gnu dot org
  2004-03-18 12:37 ` [Bug target/14629] " namsh at kldp dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2004-03-18 11:49 UTC (permalink / raw)
  To: gcc-bugs

    ICE occurs if I do
    ===================
	$ m6811-elf-gcc -c -o a.o a.cpp -m68hc12 -mshort -fomit-frame-pointer -O1
    or
	$ m6811-elf-gcc -c -o a.o a.cpp -m68hc12 -mshort -fomit-frame-pointer -O2 -msoft-reg-count=32

    Here is a ICE msg:
    ===================
	a.cpp: In member function `unsigned char CFrame::OnRxChar(unsigned char)':
	a.cpp:47: error: unable to find a register to spill in class `A_OR_SP_REGS'
	a.cpp:47: error: this is the insn:
	(insn:HI 98 96 99 11 a.cpp:40 (set (reg/f:HI 68)
		(plus:HI (mem/s:HI (reg/v/u/f:HI 54 [ this ]) [4 <variable>.m_rxBuf+0 S2 A8])
		    (reg:HI 1 d [orig:65 <variable>.m_rxCnt ] [65]))) 50 {*addhi3_68hc12} (insn_list 93 (nil))
	    (nil))
	a.cpp:47: confused by earlier errors, bailing out


    Here is a 'a.cpp':
    ===================
	extern void Hex2Ascii(unsigned char,unsigned char*);
	extern void cputch(char);
	class CFrame {
	protected:
	    unsigned char *m_rxBuf;
	    unsigned int m_frameLen;
	    unsigned char OnRxChar(unsigned char __c);
	private:
	    unsigned int m_rxCnt;
	    unsigned char m_state;
	};

	unsigned char
	CFrame::OnRxChar(unsigned char c)
	{
	    switch (m_state)
	    {
		case 0:
		    m_rxCnt = 0;
		    m_state = 1;

		case 1:
		    if (c == 0x5a)
		    {
			++m_rxCnt;
			if (m_rxCnt == 2)
			    m_state = 2;
		    }
		    else
		    {
			char buf[2];
			Hex2Ascii(c, (unsigned char*)buf);
			cputch(buf[0]);
			cputch(buf[1]);
			m_rxCnt = 0;
		    }
		    break;

		case 2:
		    m_rxBuf[m_rxCnt++] = c;
		    if (m_rxCnt == (unsigned int) 7)
			m_frameLen = *(unsigned short*)(&m_rxBuf[4]);
		    break;
	    }

	    return 0;
	}

Environment:
System: Linux namsh 2.6.5-rc1 #67 Wed Mar 17 12:40:07 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 --disable-nls --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

How-To-Repeat:
    Compile the a.cpp with given compiler option.
------- Additional Comments From namsh at kldp dot org  2004-03-18 11:48 -------
Fix:
    Change the compiler option. for example,
    1.	Use -O0
    2.	Do not use -fomit-frame-pointer

-- 
           Summary: ICE on c++ source
           Product: gcc
           Version: 3.4
            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=14629


^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <bug-14629-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2011-03-22 20:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-18 11:49 [Bug target/14629] New: ICE on c++ source gcc-bugzilla at gcc dot gnu dot org
2004-03-18 12:37 ` [Bug target/14629] " namsh at kldp dot org
2004-03-19  6:45 ` kazu at cs dot umass dot edu
2004-03-19  6:56 ` pinskia at gcc dot gnu dot org
2004-06-06  9:51 ` ciceron at gcc dot gnu dot org
2004-12-22 13:31 ` namsh at kldp dot org
     [not found] <bug-14629-4@http.gcc.gnu.org/bugzilla/>
2011-03-22 20:31 ` jsm28 at gcc dot gnu.org

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).