I'm getting the following warning when compiling wesnoth. I'm not sure if this is a bug in the code or in GCC but Andrew Pinski said I should file a bug so someone can take a look at it. This happens with gcc 4.4, but not with 4.3. (sid)700:tbm@em64t: ~/src/wesnoth-1.6.2/src] g++-4.4 -c -O1 -Wall -Werror game_preferences.ii cc1plus: warnings being treated as errors game_preferences.cpp: In constructor 'preferences::manager::manager()': game_preferences.cpp:66: error: 'v.std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::<anonymous>.std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_impl.std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_Vector_impl::_M_start' may be used uninitialized in this function game_preferences.cpp:70: error: 'terrain.std::vector<t_translation::t_terrain, std::allocator<t_translation::t_terrain> >::<anonymous>.std::_Vector_base<t_translation::t_terrain, std::allocator<t_translation::t_terrain> >::_M_impl.std::_Vector_base<t_translation::t_terrain, std::allocator<t_translation::t_terrain> >::_Vector_impl::_M_start' may be used uninitialized in this function zsh: exit 1 g++-4.4 -c -O1 -Wall -Werror game_preferences.ii
Created attachment 17872 [details] Preprocessed code
Definitely bogus, maybe we already have something open about this issue, CC-ing Richard, to be sure...
Does it happen on trunk? The testcase is too big.
It is an uninitialized use in an exception handler. ;; basic block 132, loop depth 0, count 0 ;; prev block 131, next block 133 ;; pred: 131 (ab,eh,exec) ;; succ: 135 [100.0%] (fallthru,exec) <L49>: save_filt.2381_159 = [filter_expr] <<<filter object>>>; save_eptr.2380_160 = [exc_ptr_expr] <<<exception object>>>; ivtmp.6668_667 = (long unsigned int) v$D45569$_M_impl$_M_start_645(D); goto <bb 135>; possibly reached from ;; basic block 116, loop depth 0, count 0 ;; prev block 115, next block 117 ;; pred: 115 [100.0%] (fallthru,exec) ;; succ: 131 (ab,eh,exec) 117 [100.0%] (fallthru,exec) <bb 116>: D.141736 = get (&D.141735); [return slot optimization] we could avoid warning for these at all but I am not sure if that would be appreciated.
(In reply to comment #4) > It is an uninitialized use in an exception handler. Is it an explicit exception handler? Or a compiler-generated? In any case, it looks like the code is actually executed, so it may well be a bug in the code.
This is marked as a 4.4 regression. Does it happen in trunk?
Today I can't reproduce it neither with mainline nor with 4_4-branch.
I am going to close this as FIXED, since it cannot be reproduced anymore. If anyone manages to reproduce it in GCC 4.5, please reopen.