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

            Bug ID: 60099
           Summary: internal compiler error: Segmentation fault
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nheghathivhistha at gmail dot com

I can't build Seamonkey with rev.

x86_64-pc-linux-gnu-g++ -DMOZ_GLUE_IN_PROGRAM -DMOZILLA_INTERNAL_API
-DIMPL_LIBXUL  -DSTATIC_EXPORTABLE_JS_API -DNO_NSPR_10_SUPPORT -fPIC  
-DMOZILLA_CLIENT -ggdb -pipe -march=native -mtune=native -mno-avx
-fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno
-std=gnu++0x -pthread -DNDEBUG -DTRIMMED -Os -freorder-blocks 
-fomit-frame-pointer -c testcase.ii


C-reduced testcase:

typedef enum
{ }
nsresult;
struct nsID
{
};
typedef nsID nsCID;
typedef nsID nsIID;
class nsISupports
{
};
class nsCOMPtr_helper
{
public:
    virtual nsresult operator     () (const nsIID &, void **) const;
};
template < class T > class nsRefPtr
{
public:
    T element_type;
    nsRefPtr & operator= (const nsCOMPtr_helper & helper)
    {
        helper (T::template COMTypeInfo < int >::kIID, 0);
    }
};

class nsIURI:nsISupports
{
public:
    template < class > struct COMTypeInfo
    {
        static nsIID kIID;
    };
};
extern "C"
{
#pragma GCC visibility push(default)
}
class nsCreateInstanceByCID:public nsCOMPtr_helper
{
public:
    nsCreateInstanceByCID (nsCID & aCID, nsISupports *, nsresult *):mCID
(aCID),
        mErrorPtr ()
    {
    } nsresult operator     () (const nsIID &, void **) const;
    nsCID & mCID;
    nsresult *mErrorPtr;
};

nsCID kSimpleURICID;
inline nsCreateInstanceByCID
do_CreateInstance (nsCID & aCID, nsresult *)
{
    return nsCreateInstanceByCID (aCID, 0, 0);
}

void
nsDataHandlerNewURI ()
{
    nsRefPtr < nsIURI > uri;
    uri = do_CreateInstance (kSimpleURICID, 0);
}

Reply via email to