https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64641

            Bug ID: 64641
           Summary: ICE in get_polymorphic_call_info with C-cast to
                    (polymorphic) object-reference
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: meisenmann....@fh-salzburg.ac.at

Hi!

I've analyzed some (IMHO) malicious/mallformed cast(s) to a reference-type by
using a C-cast. I've determined a sample, which results in an ICE message on
GCC (release 4.9.2). I've used a (private) build of an GCC Cross-compiler
(target=i386-elf, host=mingw32), but the Mingw-W64 build of GCC 4.9.2 *) shows
the same result.

*) Downloaded from
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.2/threads-posix/dwarf/
(package i686-4.9.2-release-posix-dwarf-rt_v3-rev1.7z)

Following (minimal) sample:
/*-----*/
class A
{
public:
    virtual int get() const { return m_val; }
protected:
    int m_val;
};

int Test2(int* arg)
{
    A& ref = (A&) arg;
    return ref.get();
}
/*-----*/

and "gcc -c test.cpp" will show:

test.cpp: In function 'int Test2(int*)':
test.cpp:14:1: internal compiler error: in get_polymorphic_call_info, at
ipa-dev
irt.c:1223
 }
 ^

Prior GCC releases (like 4.8.3 or 4.6.4) or the MS-VS2010 compiler does not
show a similar issue or compiler-warning/error.

Best regards from Salzburg,
Markus

Reply via email to