This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

A couple of bugs.


It shows that the patch from the thread 'g++ not finding the V3 target
include dir' on gcc-bugs is somehow broken

It also points out the need to either make it configureable where bash 2
is located or remove the dependencies of bash 2

And, finaly (and probably least interesting?) it includes a file that
triggers an ICE in CVS gcc when compiled at optimization level -O3 or
above. When I look at it in a debugger it shows that the code of the
method 'PutteItemHolder::operator PutteItem()' for some reason is
represented as NULL.

I have configured the compiler as follows:

../gcc/configure --prefix=/usr/local/src/gnu/gcc-2.97/install
--enable-languages=c,c++ --enable-version-specific-runtime-libs
--disable-nls

and have found the following oddities:

make check results in

...
./mkcheck 0 `pwd` ../../../gcc/libstdc++-v3
running mkcheck
./mkcheck: testing the build directory
You need bash 2.x to run mkcheck.  Exiting.

How do I specify the path to bash 2.x? I do have one installed.

Compiling the attached file results in the following errors:

% /usr/local/src/gnu/gcc-2.97/install/bin/g++ -DHAVE_CONFIG_H -I. \
-I../2257-2 -I. -Wall -ansi -posix -pedantic -W -O3 -v \
-ftemplate-depth-23 -c ../2257-2/test.C
Reading specs from
/usr/local/src/gnu/gcc-2.97/install/lib/gcc-lib/i586-pc-linux-gnu/2.97/specs
Configured with: ../gcc/configure
--prefix=/usr/local/src/gnu/gcc-2.97/install --enable-languages=c,c++
--enable-version-specific-runtime-libs --disable-nls
gcc version 2.97 20001227 (experimental)

/usr/local/src/gnu/gcc-2.97/install/lib/gcc-lib/i586-pc-linux-gnu/2.97/cc1plus
-v -I. -I../2257-2 -I. -D__GNUC__=2 -D__GNUC_MINOR__=97
-D__GNUC_PATCHLEVEL__=0 -D__ELF__ -D__unix__ -D__linux__ -D__unix
-D__linux -Asystem=posix -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -Wall -W
-pedantic -Acpu=i386 -Amachine=i386 -D__i386 -D__i386__ -D__tune_i586__
-D__tune_pentium__ -D_POSIX_SOURCE -DHAVE_CONFIG_H -MD .deps/test.pp
../2257-2/test.C -D__GNUG__=2 -D__GXX_ABI_VERSION=100 -D__STRICT_ANSI__
-trigraphs -$ -quiet -dumpbase test.C -ansi -O3 -Wall -W -pedantic -ansi
-version -fnew-abi -ftemplate-depth-23 -o /tmp/ccMXEkFo.s
GNU CPP version 2.97 20001227 (experimental) (cpplib) (i386 Linux/ELF)
GNU C++ version 2.97 20001227 (experimental) (i586-pc-linux-gnu) compiled
by GNU C version 2.97 20001227 (experimental).
ignoring duplicate directory "."
ignoring duplicate directory
"/usr/local/src/gnu/gcc-2.97/install/i586-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 ../2257-2
 /usr/local/src/gnu/gcc-2.97/install/lib/gcc-lib/i586-pc-linux-gnu/2.97/include/g++
 /usr/local/src/gnu/gcc-2.97/install/i586-pc-linux-gnu/include/
 /usr/local/include
 /usr/local/src/gnu/gcc-2.97/install/lib/gcc-lib/i586-pc-linux-gnu/2.97/include
 /usr/include
End of search list.
In file included from
/usr/local/src/gnu/gcc-2.97/install/lib/gcc-lib/i586-pc-linux-gnu/2.97/include/g++/cstdlib:2,
                 from ../2257-2/test.C:1:
/usr/local/src/gnu/gcc-2.97/install/lib/gcc-lib/i586-pc-linux-gnu/2.97/include/g++/bits/std_cstdlib.h:39:28:
bits/c++config.h: No such file or directory
../2257-2/test.C: In function `void fun()':
../2257-2/test.C:102: Internal error: Segmentation fault.
Please submit a full bug report.
 See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

The compiler do install bits/c++config.h as
/usr/local/src/gnu/gcc-2.97/install/i586-pc-linux-gnu/include/g++/bits/c++config.h
but for some reason is that not on the search path.

The internal error seems to originate in the method body being optimized
away from the tree, why this happens is currently beyond me. With -O2 it
compiles.

Magnus Fromreide					+46-13 17 68 48
Mårdtorpsgatan 21, 2tr					magfr@lysator.liu.se
S-584 34  LINKÖPING
#include <cstdlib>

class PutteItem
{
public:
    class PutteItemData;
    PutteItem();
    explicit PutteItem(PutteItemData*);
    PutteItem(const PutteItem& c);
    PutteItem& operator=(const PutteItem& c);
    virtual ~PutteItem();    
private:
    PutteItemData*	internal;
};

///////////////////////////////////////////////////////////////////////////////

class PutteItem::PutteItemData
{
public:
    virtual PutteItem Find() const;

    void AddRef() const { ++refCnt_; }
    void DelRef() const { --refCnt_; if(refCnt_ == 0) delete this; }
protected:
    PutteItemData() : refCnt_(0) { }
    inline virtual ~PutteItemData();
private:
    PutteItemData(const PutteItemData &);
    PutteItemData& operator=(const PutteItemData &);

    mutable unsigned long int	refCnt_;
};

///////////////////////////////////////////////////////////////////////////////

namespace
{
    class NullPutteItemData : public PutteItem::PutteItemData
    {
    public:
	static NullPutteItemData* Get()
	{
	    if(theNullPutteItemData == NULL)
		theNullPutteItemData = new NullPutteItemData;
	    return theNullPutteItemData;
	}
    protected:
	virtual ~NullPutteItemData() { theNullPutteItemData = NULL; }
    private:
	static NullPutteItemData*	theNullPutteItemData;

	NullPutteItemData() : PutteItemData() { }
    };
    NullPutteItemData*	NullPutteItemData::theNullPutteItemData = NULL;
}

///////////////////////////////////////////////////////////////////////////////

PutteItem PutteItem::PutteItemData::Find() const
{
    return PutteItem(NullPutteItemData::Get());
}

///////////////////////////////////////////////////////////////////////////////

PutteItem::PutteItem(PutteItemData* c)
    : internal(c)
{ internal->AddRef(); }

PutteItem::PutteItem(const PutteItem& c)
    : internal(c.internal)
{ internal->AddRef(); }

PutteItem& PutteItem::operator=(const PutteItem& c)
{
    c.internal->AddRef();
    internal->DelRef();
    internal = c.internal;
    return *this;
}

PutteItem::~PutteItem()
{
    internal->DelRef();
    internal = NULL;
}

///////////////////////////////////////////////////////////////////////////////

namespace
{
    class PutteItemHolder
    {
    public:
       	PutteItemHolder() : d_(NullPutteItemData::Get()) { d_->AddRef(); }
	~PutteItemHolder() { d_->DelRef(); }
	PutteItemHolder(const PutteItemHolder& c) : d_(c.d_)
	{ d_->AddRef(); }
	PutteItemHolder& operator=(const PutteItemHolder& c)
	{ c.d_->AddRef(); d_->DelRef(); d_ = c.d_; return *this; }
	operator PutteItem() { return PutteItem(d_); }
    private:
	PutteItem::PutteItemData*	d_;
    };
}

void fun()
{
    PutteItem root = PutteItemHolder();
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]