flow still deleting important labels

Jeffrey A Law law@upchuck.cygnus.com
Sun Mar 28 02:56:00 GMT 1999


Flow is still deleting labels that it should probably leave alone.

Compile the attached code on a PA with -O (using current egcs sources).

Near the top of the assembly file you'll see something like this:

L$C0004
        .word L$0074
        .align 4
L$C0005
        .word L$0081
        .align 4
L$C0006
        .word L$0088
        .align 4
L$C0007
        .word L$0091
        .align 4
L$C0008
        .word L$C0001



L$0088 and L$0091 are never defined in the assembly file.



In the .cse2 dump we have stuff like:

(insn/i 243 242 244 (set (reg:SI 166)
        (high:SI (label_ref:SI 250))) 76 {add_high_const+1} (nil)
    (expr_list:REG_EQUAL (high:SI (label_ref:SI 250))
        (expr_list:REG_LABEL (code_label/i 250 249 251 88 "")
            (nil))))

(insn/i 244 243 245 (set (reg:SI 167)
        (lo_sum:SI (reg:SI 166)
            (label_ref:SI 250))) 77 {add_high_const+2} (nil)
    (expr_list:REG_LABEL (code_label/i 250 249 251 88 "")
        (expr_list:REG_EQUAL (label_ref:SI 250)
            (nil))))

[ ... ]

(code_label/i 250 249 251 88 "")

[ ... ]
(insn/i 280 279 281 (set (reg:SI 175)
        (high:SI (label_ref:SI 287))) 76 {add_high_const+1} (nil)
    (expr_list:REG_EQUAL (high:SI (label_ref:SI 287))
        (expr_list:REG_LABEL (code_label/i 287 286 288 91 "")
            (nil))))

(insn/i 281 280 282 (set (reg:SI 176)
        (lo_sum:SI (reg:SI 175)
            (label_ref:SI 287))) 77 {add_high_const+2} (nil)
    (expr_list:REG_LABEL (code_label/i 287 286 288 91 "")
        (expr_list:REG_EQUAL (label_ref:SI 287)
            (nil))))

[ ... ]
(code_label/i 287 286 288 91 "")


Which all disappears in the .flow dump.   Presumably the blocks containing 
this code were deleted as unreachable.


This is causing libstdc++ to fail it's self-tests because the tests will not
link.

struct __false_type { };
template <class _Tp> struct _Is_integer {
  typedef __false_type _Integral;
};
template <class _Tp>
class allocator {
public:
  ~allocator() throw()  {}
};
template <class _Tp, class _Allocator> struct _Alloc_traits { };
template <class _Tp, class _Tp1>
struct _Alloc_traits<_Tp, allocator<_Tp1> >
{
  static const bool _S_instanceless = true;
  typedef allocator<_Tp> allocator_type;
};
template <class _Tp>
struct _List_node {
};
template<class _Tp, class _Ref, class _Ptr>
struct _List_iterator {
};
template <class _Tp, class _Allocator, bool _IsStatic>
class _List_alloc_base {
};
template <class _Tp, class _Allocator>
class _List_alloc_base<_Tp, _Allocator, true> {
public:
  typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
          allocator_type;
  _List_alloc_base(const allocator_type&) {}
protected:
  _List_node<_Tp>* _M_node;
};
template <class _Tp, class _Alloc>
class _List_base 
  : public _List_alloc_base<_Tp, _Alloc,
                            _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
{
public:
  typedef _List_alloc_base<_Tp, _Alloc,
                           _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
          _Base; 
  typedef typename _Base::allocator_type allocator_type;
  _List_base(const allocator_type& __a) : _Base(__a) { }
  ~_List_base() { }
  void clear();
};
template <class _Tp, class _Alloc = allocator< _Tp >  >
class list : protected _List_base<_Tp, _Alloc> {
  typedef _List_base<_Tp, _Alloc> _Base;
public:      
  typedef typename _Base::allocator_type allocator_type;
public:
  typedef _List_iterator<_Tp,_Tp&,_Tp*>             iterator;
public:
  iterator begin() {}
  template <class _InputIterator>
  void _M_insert_dispatch(iterator __pos, 
                          _InputIterator __first, _InputIterator __last,
                          __false_type);
  template <class _InputIterator>
  void insert( iterator __pos, _InputIterator __first, _InputIterator __last) {
    typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
    _M_insert_dispatch(__pos, __first, __last, _Integral());
  }
  template <class _InputIterator>
  list(_InputIterator __first, _InputIterator __last, 
       const allocator_type& __a = allocator_type())
     : _Base(__a) 
    { insert(begin(), __first, __last); }
};
int array1 [] = { 9, 16, 36 };
int test_splice ()
{
  list<int> l1 (array1, array1 + 3);
}




More information about the Gcc-bugs mailing list