[Bug target/14628] New: ICE on c++ sources

gcc-bugzilla at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Mar 18 06:28:00 GMT 2004


    next command generates ICE (-O2 and -O3 also generates ICE).
	$ m6811-elf-gcc -O1  -m68hc12 -o a.o -c a.cpp

    Here is a compiler message:

	a.cpp: In member function `void Ca::a(void*, unsigned int)':
	a.cpp:16: internal compiler error: in change_address_1, at emit-rtl.c:1886
	Please submit a full bug report,
	with preprocessed source if appropriate.
	See <URL:http://gcc.gnu.org/bugs.html> for instructions.

    And here is a source:

	class Ca {
	public:
	    void a(void *, unsigned int);
	private:
	    void **m_l;
	};
	void
	Ca::a(void *base, unsigned int num)
	{
	    unsigned int i;
	    for (i = 0; i < num; ++i)
		base = (void *) ((unsigned char *) base + 1);
	    *m_l = 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 source with '-O1 -m68hc12'.
------- Additional Comments From namsh at kldp dot org  2004-03-18 06:27 -------
Fix:
	1. use -O0 option.
	2. remove '-m68hc12' option.

-- 
           Summary: ICE on c++ sources
           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=14628



More information about the Gcc-bugs mailing list