[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#630441: g++-4.6 miscompilation



Hi there.
I believe I've tracked down the problem.

I've published new versions of v3c(1.9.0-03), treedb(1.1.0-01) and meta-treedb(1.3.0-02) in SourceForge, which gets around this problem.

It appears that gcc-4.6 (and clang for that matter) make some dodgy decisions about what appear to be references to temporaries created during optimization.

Looking at meta-treedb's v3c/1-comet/cxx-string-list-test.cpp, line 75:
    typedef char * DataType;
is the heart of the problem.
The change at line 77:
    typedef char DataType[0];
guides the compiler along the proper path.

Neither compiler has a problem with either option in debug (-O0) builds and the tests pass.

I guess the compiler should issue warnings or errors, depending on how you want to handle this.

Regards,
Philip



Reply to: