lmi
[Top][All Lists]
Advanced

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

Re: [lmi] gcc -fprofile-generate and -fprofile-use [Was: gcc -flto]


From: Vadim Zeitlin
Subject: Re: [lmi] gcc -fprofile-generate and -fprofile-use [Was: gcc -flto]
Date: Tue, 27 Dec 2016 16:35:53 +0100

On Tue, 27 Dec 2016 14:59:36 +0000 Greg Chicares <address@hidden> wrote:

GC> With inadequate care, while battling insomnia, I repeated those steps
GC> except that instead of manually removing everything except '*.gcda'
GC> I did 'make clean' (removing even '*.gcda'), and then something odd
GC> happened:
GC> 
GC> i686-w64-mingw32-g++ -MMD -MP -MT operations_posix_windows.o -MF 
operations_posix_windows.d  -c -I /opt/lmi/src/lmi -I 
/opt/lmi/src/lmi/tools/pete-2.1.1 -I 
/opt/lmi/local/lib/wx/include/i686-w64-mingw32-msw-unicode-3.1 -I 
/opt/lmi/local/include/wx-3.1 -I /opt/lmi/third_party/include -I 
/opt/lmi/third_party/src -I /opt/lmi/local/include -I 
/opt/lmi/local/include/libxml2 -DLMI_WX_NEW_USE_SO  -DLIBXML_USE_DLL -DSTRICT   
 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DBOOST_STRICT_CONFIG   
-std=c++11 -pedantic-errors -Werror -Wall -Wcast-align -Wconversion 
-Wdeprecated-declarations -Wdisabled-optimization -Wextra -Wimport -Wmultichar 
-Wpacked -Wpointer-arith -Wredundant-decls -Wsign-compare -Wundef 
-Wwrite-strings  -Wno-long-long -Wctor-dtor-privacy -Wdeprecated 
-Wnon-template-friend -Woverloaded-virtual -Wpmf-conversions -Wsynth  
-Wcast-qual  -Wno-unused-parameter -Wno-conversion -Wno-deprecated-declarations 
-Wno-parentheses -Wno-unused-local-typedefs -Wno-unused-variable     -ggdb -O2 
-fno-omit-frame-pointer -fprofile-use   
/opt/lmi/third_party/src/boost/libs/filesystem/src/operations_posix_windows.cpp 
-ooperations_posix_windows.o
GC> 
GC> 
/opt/lmi/third_party/src/boost/libs/filesystem/src/operations_posix_windows.cpp:
 In function 'bool boost::filesystem::equivalent(const 
boost::filesystem::path&, const boost::filesystem::path&)':
GC> 
/opt/lmi/third_party/src/boost/libs/filesystem/src/operations_posix_windows.cpp:524:25:
 error: 'error1' may be used uninitialized in this function 
[-Werror=maybe-uninitialized]
GC>            ph1, error1 ) );
GC>                          ^
GC> cc1plus: all warnings being treated as errors
GC> /opt/lmi/src/lmi/workhorse.make:779: recipe for target 
'operations_posix_windows.o' failed

 This looks like a bug in compiler to me, the warning is given only when
-fprofile-use is specified (even if there is no profile data) and only by
MinGW-w64 4.9.1 compiler, i.e. it's not given neither by the native Linux
amd64 4.9.2 nor by MinGW-w64 6.2.1.

GC> I think that warning is correct: if
GC>        p1.handle != BOOST_INVALID_HANDLE_VALUE
GC>     && p2.handle == BOOST_INVALID_HANDLE_VALUE
GC> then 'error1' is used without ever having been initialized.

 No, the warning is definitely not correct, there is an earlier return if
either of the handles is valid and there even is an assert checking that
both of them are invalid before the line throwing the exception.

GC> I won't try to figure that out, or to fix the defect. Only the text of
GC> an exception is affected, so I'll just suppress that warning for this
GC> file.

 If you've decided to not use -fprofile-xxx finally, then it's not worth
doing this neither as the warning doesn't happen without this option.

 Regards,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]