Bug 31596 - Internal compiler error (Segmentation fault)
Summary: Internal compiler error (Segmentation fault)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-17 08:17 UTC by Wolfgang Roehrl
Modified: 2007-04-19 20:08 UTC (History)
2 users (show)

See Also:
Host: i386-pc-mingw32
Target: powerpc-wrs-vxworks
Build: sparc-sun-solaris2.5.1
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Roehrl 2007-04-17 08:17:11 UTC
Dear all,

I would like to post a bug report for the GNU C/C++ compiler 3.3-e500.

We use the compiler to generate code for a PowerPC processor.

Used invokation line for the GNU C++ compiler:

ccppc -c -x c++ -ansi -Wall -Werror -mcpu=8540 -fverbose-asm -mbig
      -fmerge-templates -mmultiple -mno-string -mstrict-align -O3
      -fno-exceptions -fno-rtti -fno-builtin-printf
      -I<some include paths>
      -D<some #define's>
      X.CPP -oX.O


// file X.CPP

template <typename, typename> class XXX;
template <typename, bool> struct enaFunc;


template <typename T_>
struct enaFunc<T_,true>
{ typedef T_ type; };

template <typename T_>
struct enaFunc<T_,false>
{};


template <typename T_>
struct isXXX
{
    typedef char NO;
    typedef char YES[2];

    template <typename U_, typename V_>
    static YES& check (const XXX<U_,V_>*);

    static NO& check (...);

    enum { value = (sizeof(check(static_cast<T_*>(0))) == sizeof(YES)) };
};


template <typename V_, typename U1_, typename U2_>
typename enaFunc<typename V_::T_RET_TYPE,
                 (isXXX<U1_>::value && isXXX<U2_>::value)
                >::type
func (V_&, U1_&, U2_&);                  // function #1

template <typename V_, typename U1_, typename U2_>
typename enaFunc<typename V_::T_RET_TYPE,
                 (isXXX<U1_>::value && isXXX<U2_>::value)
                >::type
func (const V_&, U1_&, U2_&);            // function #2


struct YYY
{ typedef int T_RET_TYPE; };


void f (const XXX<int,char>& p1, const XXX<bool,int>& p2)
{
    const YYY f = YYY();
    func (f, p1, p2);                    // <--- line 49
}


The compiler crashes with the following message:
 
X.CPP: In function `void f(const XXX<int, char>&, const XXX<bool, int>&)':
X.CPP:49: internal compiler error: Segmentation fault

(Comeau online compiles the code fragment fine.)

Kind regards
W. Roehrl
Comment 1 Andrew Pinski 2007-04-17 16:06:56 UTC
First 3.3 is getting old and no longer being supported.
Second this is a modified version of 3.3 so we don't support it.
Comment 2 Wolfgang Bangerth 2007-04-19 20:08:50 UTC
This appears fixed since gcc 3.4.x.