https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81325
Bug ID: 81325 Summary: -fcompare-debug failure on ppc64le Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: trippels at gcc dot gnu.org CC: segher at gcc dot gnu.org Target Milestone: --- trippels@gcc2-power8 llvm_build % cat test.ii struct A { A(char *, const int & = 0); }; template <typename> struct B; template <typename> struct C { int _M_i; void m_fn1() { __atomic_fetch_add(&_M_i, 0, 0); } }; struct D { int *Data; long Length = 0; D(int) : Data() {} }; template <> struct B<int> : C<int> {}; struct F { B<int> RefCount; void m_fn2() { RefCount.m_fn1(); } }; struct G { F *Obj; G(const G &p1) : Obj(p1.Obj) { if (Obj) { F *a = 0; a->m_fn2(); } } }; struct H { int CPlusPlus : 1; }; struct I { enum {} KindId; }; template <typename ResultT, typename ArgT> struct J { void operator()(); ResultT operator()(ArgT) {} }; struct K { int AllowBind; I SupportedKind; I RestrictKind; G Implementation; }; struct L { L(int) : Implementation(Implementation) {} K Implementation; }; struct M { int Param1; }; struct N { N(int, L &p2) : Param2(p2) {} L Param2; }; struct O { L m_fn3(); }; L ignoringImpCasts(L); J<O, L> b; L hasName(const A &); M hasOverloadedOperatorName(D); J<O, int> c; struct P { void m_fn4(L, int); }; struct Q { void m_fn5(P *); }; H d; void Q::m_fn5(P *p1) { if (!d.CPlusPlus) { c(); L e = 0, f = ignoringImpCasts(e); b(ignoringImpCasts(f)).m_fn3(); } hasOverloadedOperatorName(0); hasName(""); L g = 0; N(0, g); L h(0); p1->m_fn4(h, 0); } trippels@gcc2-power8 llvm_build % g++ --save-temps -c -O2 -fcompare-debug test.ii test.ii: In member function ‘void Q::m_fn5(P*)’: test.ii:77:13: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] hasName(""); ^ g++: error: test.ii: -fcompare-debug failure trippels@gcc2-power8 llvm_build % diff -u test.gkd test.gk.gkd --- test.gkd 2017-07-05 13:49:05.946937825 +0000 +++ test.gk.gkd 2017-07-05 13:49:06.076940789 +0000 @@ -131,7 +131,7 @@ (int_list:REG_BR_PROB 3300 (nil))) -> 30) (note # 0 0 [bb 3] NOTE_INSN_BASIC_BLOCK) -(insn:TI # 0 0 (set (reg/f:DI 31 31 [205]) +(insn:TI # 0 0 (set (reg/f:DI 31 31 [206]) (plus:DI (reg/f:DI 1 1) (const_int 32 [0x20])))# {*adddi3} (expr_list:REG_EQUAL (plus:DI (reg/f:DI 111 sfp) @@ -143,7 +143,7 @@ (expr_list:REG_EQUAL (plus:DI (reg/f:DI 111 sfp) (const_int 56 [0x38])) (nil))) -(insn # 0 0 (set (reg/f:DI 30 30 [206]) +(insn # 0 0 (set (reg/f:DI 30 30 [205]) (plus:DI (reg/f:DI 1 1) (const_int 80 [0x50])))# {*adddi3} (expr_list:REG_EQUAL (plus:DI (reg/f:DI 111 sfp) @@ -198,7 +198,7 @@ (expr_list:REG_EQUAL (symbol_ref/f:DI ("*.LC0") [flags 0x82] <var_decl # *.LC0>) (nil))) (insn # 0 0 (set (reg:DI 3 3) - (reg/f:DI 30 30 [206])) "test.ii":77# {*movdi_internal64} + (reg/f:DI 30 30 [205])) "test.ii":77# {*movdi_internal64} (expr_list:REG_EQUAL (plus:DI (reg/f:DI 111 sfp) (const_int 80 [0x50])) (nil))) @@ -223,13 +223,13 @@ (expr_list:DI (use (reg:DI 5 5)) (nil)))))) (insn # 0 0 (set (reg:DI 4 4) - (reg/f:DI 30 30 [206])) "test.ii":77# {*movdi_internal64} - (expr_list:REG_DEAD (reg/f:DI 30 30 [206]) + (reg/f:DI 30 30 [205])) "test.ii":77# {*movdi_internal64} + (expr_list:REG_DEAD (reg/f:DI 30 30 [205]) (expr_list:REG_EQUAL (plus:DI (reg/f:DI 111 sfp) (const_int 80 [0x50])) (nil)))) (insn # 0 0 (set (reg:DI 3 3) - (reg/f:DI 31 31 [205])) "test.ii":77# {*movdi_internal64} + (reg/f:DI 31 31 [206])) "test.ii":77# {*movdi_internal64} (expr_list:REG_EQUAL (plus:DI (reg/f:DI 111 sfp) (const_int 32 [0x20])) (nil))) @@ -267,8 +267,8 @@ (expr_list:REG_EQUIV (const_int 0 [0]) (nil))) (insn # 0 0 (set (reg:DI 4 4) - (reg/f:DI 31 31 [205])) "test.ii":81# {*movdi_internal64} - (expr_list:REG_DEAD (reg/f:DI 31 31 [205]) + (reg/f:DI 31 31 [206])) "test.ii":81# {*movdi_internal64} + (expr_list:REG_DEAD (reg/f:DI 31 31 [206]) (expr_list:REG_EQUAL (plus:DI (reg/f:DI 111 sfp) (const_int 32 [0x20])) (nil)))) @@ -369,7 +369,7 @@ (expr_list:REG_EQUAL (const:DI (plus:DI (symbol_ref:DI ("*.LANCHOR0") [flags 0x182]) (const_int 4 [0x4]))) (nil))) -(insn # 0 0 (set (reg/f:DI 31 31 [205]) +(insn # 0 0 (set (reg/f:DI 31 31 [206]) It looks like an ancient issue, because even it fails even with gcc-4.8.5.