https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89733

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'm certainly seeing the uninitialized loads in the IL though.

        typename Lexer::iterator_type iter = lex.begin(first, last);
in tokenize_and_parse calls
        template <typename Iterator>
        iterator_type begin(Iterator& first, Iterator const& last
                , char_type const* initial_state = 0) const
            { return this->lexer_type::begin(first, last, initial_state); }
which calls
        template <typename IteratorData>
        iterator(IteratorData const& iterdata_, base_iterator_type& first
              , base_iterator_type const& last, char_type const* state = 0)
          : base_type(functor_type(unique_functor_type()
              , shared_functor_type(iterdata_, first, last)))
        {
            set_state(map_state(state));
        }
which calls:
      template<typename _U1, typename _U2, typename
        enable_if<_PCCP::template
      _MoveConstructiblePair<_U1, _U2>()
     && _PCCP::template
      _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
                         bool>::type=true>
 constexpr pair(_U1&& __x, _U2&& __y)
 : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }
which calls:
        template <typename Iterator, typename HasState, typename TokenValue>
        class data<Iterator, mpl::true_, HasState, TokenValue>
          : public data<Iterator, mpl::false_, HasState, TokenValue>
        {
's defaulted copy constructor, which would like to copy end_ among other
non-static data members, but that is uninitialized.
It can be seen after the inlining already:
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:300:13] MEM[(struct 
&)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61] &D.5608
49] ={v} {CLOBBER};
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:221:13] MEM[(struct 
&)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61] &D.5608
49] ={v} {CLOBBER};
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:57:13] MEM[(struct 
&)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61] &D.56084
9] ={v} {CLOBBER};
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:61:69]
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:61:69] MEM[(struct data
*)
[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61] &D.560849].first_ =
first_3(D);
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:61:69] _87 =
last_407(D);
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:61:69]
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:61:69] MEM[(struct data
*)
[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61] &D.560849].last_ =
_87;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:59:38] _88 =
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:59:38] MEM[(const st
ruct iterator_data_type
&)[./boost/spirit/home/lex/lexer/lexertl/lexer.hpp:205:34]
&iterator_data].state_machine_;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:61:69]
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:61:69] MEM[(struct data
*)
[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61]
&D.560849].state_machine_ = _88;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:60:30] _89 =
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:60:30] MEM[(const st
ruct iterator_data_type
&)[./boost/spirit/home/lex/lexer/lexertl/lexer.hpp:205:34]
&iterator_data].rules_;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:61:69]
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:61:69] MEM[(struct data
*)
[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61] &D.560849].rules_ =
_89;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:61:50] _90 =
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:61:50] MEM[(const
struct internals &)_88]._seen_BOL_assertion;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:61:69]
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:61:69] MEM[(struct data
*)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61] &D.560849].bol_ =
_90;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:223:25]
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:223:25] MEM[(struct
data *)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61]
&D.560849].state_ = 0;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:302:32] _91 =
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:302:32] MEM[(const
struct iterator_data_type
&)[./boost/spirit/home/lex/lexer/lexertl/lexer.hpp:205:34]
&iterator_data].actions_;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:304:51]
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:304:51] MEM[(struct
data *)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61]
&D.560849].actions_ = _91;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:304:51]
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:304:51] MEM[(struct
data *)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61]
&D.560849].hold_ = 0B;
  [./boost/variant/variant.hpp:1848:5] MEM[(struct 
&)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61] &D.560849 + 72]
={v} {CLOBBER};
  [./boost/type_traits/aligned_storage.hpp:108:5] MEM[(struct 
&)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61] &D.560849 + 80]
={v} {CLOBBER};
  MEM[(struct value_T
*)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61] &D.560849 + 80B] =
_87;
  MEM[(struct value_T
*)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61] &D.560849 + 88B] =
_87;
  [./boost/variant/variant.hpp:1434:9] MEM[(which_t
*)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61] &D.560849 + 72B] =
0;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:304:51]
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:304:51] MEM[(struct
data *)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61]
&D.560849].has_value_ = 0;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:304:51]
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:304:51] MEM[(struct
data *)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61]
&D.560849].has_hold_ = 0;
  [/usr/include/c++/8/bits/stl_pair.h:330:12] MEM[(struct 
&)[./boost/spirit/home/lex/lexer/lexertl/iterator.hpp:85:61] &D.560850] ={v}
{CLOBBER};
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:276:15] MEM[(struct 
&)&D.560850 + 8] ={v} {CLOBBER};
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:276:15] MEM[(struct
data *)&D.560850 + 8B].D.418885 = MEM[(const struct data *)&D.560849].D.418885;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:276:15] _100 =
MEM[(const struct data &)&D.560849].actions_;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:276:15]
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:276:15] MEM[(struct
data 
*)&D.560850 + 8B].actions_ = _100;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:276:15] _101 =
MEM[(const struct data &)&D.560849].hold_;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:276:15]
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:276:15] MEM[(struct
data 
*)&D.560850 + 8B].hold_ = _101;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:276:15] _102 =
MEM[(const struct data &)&D.560849].end_;
  [./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:276:15]
[./boost/spirit/home/lex/lexer/lexertl/functor_data.hpp:276:15] MEM[(struct
data *)&D.560850 + 8B].end_ = _102;

actions_ and hold_ are initialized, but end_ is not.

Reply via email to