http://llvm.org/bugs/show_bug.cgi?id=4708
Summary: llvm-prof has cast warnings after r78477
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Global Analyses
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Created an attachment (id=3303)
--> (http://llvm.org/bugs/attachment.cgi?id=3303)
patch to fix warnings in llvm-prof.cpp
It looks like r78477 changed a couple of the return types for ProfileInfo to
return doubles instead of unsigned ints, and llvm-prof.cpp wasn't updated to
reflect this. I'm now getting a couple cast warnings from this (I know
gcc-4.1.1 is bad, but the warnings appear to be valid):
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_pair.h:
In constructor âstd::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with
_U1 = llvm::Function*, _U2 = double, _T1 = llvm::Function*, _T2 = unsigned
int]â:
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_algo.h:2477:
instantiated from âvoid std::partial_sort(_RandomAccessIterator,
_RandomAccessIterator, _RandomAccessIterator, _Compare) [with
_RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<llvm::Function*,
double>*, std::vector<std::pair<llvm::Function*, double>,
std::allocator<std::pair<llvm::Function*, double> > > >, _Compare =
PairSecondSortReverse<llvm::Function*>]â
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_algo.h:2666:
instantiated from âvoid std::__introsort_loop(_RandomAccessIterator,
_RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<std::pair<llvm::Function*, double>*,
std::vector<std::pair<llvm::Function*, double>,
std::allocator<std::pair<llvm::Function*, double> > > >, _Size = long int,
_Compare = PairSecondSortReverse<llvm::Function*>]â
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_algo.h:2749:
instantiated from âvoid std::sort(_RandomAccessIterator,
_RandomAccessIterator, _Compare) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<std::pair<llvm::Function*, double>*,
std::vector<std::pair<llvm::Function*, double>,
std::allocator<std::pair<llvm::Function*, double> > > >, _Compare =
PairSecondSortReverse<llvm::Function*>]â
/scratch/llvm/llvm/tools/llvm-prof/llvm-prof.cpp:169: instantiated from here
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_pair.h:90:
warning: converting to âunsigned intâ from âconst doubleâ
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_pair.h:
In constructor âstd::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with
_U1 = llvm::BasicBlock*, _U2 = double, _T1 = llvm::BasicBlock*, _T2 = unsigned
int]â:
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_algo.h:2477:
instantiated from âvoid std::partial_sort(_RandomAccessIterator,
_RandomAccessIterator, _RandomAccessIterator, _Compare) [with
_RandomAccessIterator =
__gnu_cxx::__normal_iterator<std::pair<llvm::BasicBlock*, double>*,
std::vector<std::pair<llvm::BasicBlock*, double>,
std::allocator<std::pair<llvm::BasicBlock*, double> > > >, _Compare =
PairSecondSortReverse<llvm::BasicBlock*>]â
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_algo.h:2666:
instantiated from âvoid std::__introsort_loop(_RandomAccessIterator,
_RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<std::pair<llvm::BasicBlock*, double>*,
std::vector<std::pair<llvm::BasicBlock*, double>,
std::allocator<std::pair<llvm::BasicBlock*, double> > > >, _Size = long int,
_Compare = PairSecondSortReverse<llvm::BasicBlock*>]â
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_algo.h:2749:
instantiated from âvoid std::sort(_RandomAccessIterator,
_RandomAccessIterator, _Compare) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<std::pair<llvm::BasicBlock*, double>*,
std::vector<std::pair<llvm::BasicBlock*, double>,
std::allocator<std::pair<llvm::BasicBlock*, double> > > >, _Compare =
PairSecondSortReverse<llvm::BasicBlock*>]â
/scratch/llvm/llvm/tools/llvm-prof/llvm-prof.cpp:212: instantiated from here
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_pair.h:90:
warning: converting to âunsigned intâ from âconst double
I've attached a patch that fixes this, but I'm not sure what the consequences
of this patch will do since I've got a bad gcc installed.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs