https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63761
Bug ID: 63761
Summary: [5 Regression] error: gimple_bb (stmt) is set to a
wrong basic block
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: trippels at gcc dot gnu.org
On ppc64 I get the following binutils build failure:
trippels@gcc2-power8 gold % cat dynobj.ii
template <typename> struct A;
template <typename _Tp> struct A<_Tp *>
{
typedef _Tp reference;
};
template <typename _Iterator> class B
{
public:
typename A<_Iterator>::reference operator*();
};
template <typename _Tp> class C
{
typedef _Tp *const_pointer;
};
template <typename _Tp, typename _Alloc = C<_Tp> > class D
{
public:
typedef B<typename _Alloc::const_pointer> const_iterator;
};
struct F
{
static int
convert_host (int p1)
{
return (
{
p1 >> 8 & 255 | (p1 & 255) << 8;
});
}
};
struct G
{
static int
convert_host (int p1)
{
return F::convert_host (p1);
}
};
struct H
{
int vd_ndx;
};
class I
{
public:
I (int);
short set_vd_flags_a;
void
set_vd_flags (int)
{
unsigned short v;
set_vd_flags_a = (
{
v >> 8 | v << 8;
});
}
void
set_vd_ndx (int p1)
{
p_->vd_ndx = G::convert_host (p1);
}
H *p_;
};
typedef int Stringpool;
class J
{
public:
template <int, bool>
unsigned char *write (const Stringpool *, bool, unsigned char *) const;
int index_;
};
class Versions
{
template <int, bool>
void def_section_contents (const Stringpool *, unsigned char **, unsigned *,
unsigned *) const;
};
template <int size, bool big_endian>
void
Versions::def_section_contents (const Stringpool *, unsigned char **,
unsigned *, unsigned *) const
{
D<J *>::const_iterator p;
(*p)->write<size, big_endian> (0, 0, 0);
}
template void Versions::def_section_contents<32, false> (const Stringpool *,
unsigned char **,
unsigned *,
unsigned *) const;
void fn1 (int, int, int) __attribute__ ((__noreturn__));
template <int, bool>
unsigned char *
J::write (const Stringpool *, bool, unsigned char *) const
{
I c (0);
c.set_vd_flags (0);
!index_ ? fn1 (0, 0, 0), 0 : 0;
c.set_vd_ndx (index_);
}
trippels@gcc2-power8 gold % /home/trippels/gcc_test/usr/local/bin/g++ -c -O2
dynobj.ii
dynobj.ii: In member function ‘void Versions::def_section_contents(const
Stringpool*, unsigned char**, unsigned int*, unsigned int*) const [with int
<anonymous> = 32; bool <anonymous> = false; Stringpool = int]’:
dynobj.ii:80:1: error: gimple_bb (stmt) is set to a wrong basic block
Versions::def_section_contents (const Stringpool *, unsigned char **,
^
_7 = v_6(D) r>> 8;
dynobj.ii:80:1: internal compiler error: verify_gimple failed
0x109c04df verify_gimple_in_cfg(function*, bool)
../../gcc/gcc/tree-cfg.c:5039
0x108830b7 execute_function_todo
../../gcc/gcc/passes.c:1868
0x10883fb3 do_per_function
../../gcc/gcc/passes.c:1595
0x10884287 execute_todo
../../gcc/gcc/passes.c:1925
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.