TCE

compile error

Bug #1422079 reported by Vinogradov Viacheslav
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
TCE
Fix Released
Undecided
Unassigned

Bug Description

Dear TCE designers,

Long time no compile :)
I've just updated and tried to compile tce from scratch (make distclean and configure again) and end up with compile error:

MachineInfo.cc:239:66: error: call of overloaded 'requiredBitsSigned(int64_t&)' is ambiguous
     size_t requiredBitsSigned = MathTools::requiredBitsSigned(imm);
                                                                  ^
MachineInfo.cc:239:66: note: candidates are:
In file included from ../../../src/tools/MathTools.hh:59:0,
                 from MachineInfo.cc:46:
../../../src/tools/MathTools.icc:74:1: note: static int MathTools::requiredBitsSigned(long int)
 MathTools::requiredBitsSigned(long int number) {
 ^
../../../src/tools/MathTools.icc:112:1: note: static int MathTools::requiredBitsSigned(int)
 MathTools::requiredBitsSigned(int number) {
 ^
../../../src/tools/MathTools.icc:94:1: note: static int MathTools::requiredBitsSigned(UInt32)
 MathTools::requiredBitsSigned(UInt32 number) {
 ^
../../../src/tools/MathTools.icc:128:1: note: static int MathTools::requiredBitsSigned(long unsigned int)
 MathTools::requiredBitsSigned(unsigned long number) {

file:
MachineInfo.cc

line:
 239 size_t requiredBitsSigned = MathTools::requiredBitsSigned(imm);

where imm is int64_t. Meanwhile, MathTools.icc where are prototypes of requiredBitsSigned do not have int64_t as parameter

possible fix:
    size_t requiredBitsSigned = MathTools::requiredBitsSigned(static_cast<long int>(imm));

Could you please review source?

Thanks.

BR,
Slava.

Revision history for this message
Vinogradov Viacheslav (vinogradov-slava) wrote :

BTW
all test are ok with this fix
tce-selftest -v
Testing TCE installation, this can take up to two hours.
Time to go for a lunch? Use -v to see the progress.
test_noOpt (__main__.TestCompiler)
Test C compilation with -O0 ... ok
test_opencl_sa (__main__.TestCompiler)
Test standalone OpenCL compilation if the support has been enabled ... ok
test_opt (__main__.TestCompiler)
Test C compilation with -O3 ... ok
test_custom_operation_from_c_code (__main__.TestCustomOps)
Test creating a simple custom operation with simulation code and ... ok
test_estimator (__main__.TestEstimator)
Test the cost estimator by estimating the area and delay of minimal.adf (this takes a while!) ... ok
test_basic_plugins (__main__.TestExplorer)
Test the ImplementationSelector and Evaluate explorer plugins (this takes a while!) ... ok
test_default_plugins_found (__main__.TestExplorer)
Check that the default Explorer plugins are listed. ... ok
test_proge_and_pig (__main__.TestProGeAndPIG)
Test the processor generator and the program image generator (with dictionary instruction compression) ... ok
test_compiled_simulation (__main__.TestSimulator)
Test the compiled engine of the simulator ... ok
test_debugging_simulation (__main__.TestSimulator)
Test the debugging engine of the simulator ... ok

----------------------------------------------------------------------
Ran 10 tests in 1268.760s

OK

Revision history for this message
Pekka Jääskeläinen (pekka-jaaskelainen) wrote :

Thanks! Committed in r2202.

Changed in tce:
status: New → Fix Released
Revision history for this message
Vinogradov Viacheslav (vinogradov-slava) wrote :

commit 2237 has the same bug again!
possible fix:
file MachineInfo.cc
line 252:
    size_t requiredBitsSigned =
        std::min((unsigned)MathTools::requiredBitsSigned(static_cast<long int>(imm)), destWidth);

Revision history for this message
Pekka Jääskeläinen (pekka-jaaskelainen) wrote :

Should be fixed (again).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.