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

--- Comment #7 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> 
---
(In reply to Pat Haugen from comment #6)
> (In reply to rsand...@gcc.gnu.org from comment #4)
> > 
> > Hmm, bootstrap succeeded for me on gcc110.  I used r225278, but I don't
> > think anything significant changed between the two.
> 
> Mike Meissner and I ran various builds since he was not seeing any problem
> on the same machine I was building on. From what I can tell, this is
> starting to look like an issue when building with older compiler versions.
> 
> I can recreate the problem on machines with 4.3 and 4.4 versions of GCC as
> the default distro compiler but if I modify my path so a 4.8 version of the
> compiler is found first my bootstrap succeeds. Looks like gcc110 is a 4.7
> distro compiler, and appears not an issue there.

Thanks for narrowing it down.  I tried a 4.4 compiler on gcc110 and yeah,
it fails for me too.  I think the problem is due to inc_hash::add_expr
being entered with the wrong TOC pointer:

Breakpoint 1, inchash::add_expr (t=0x3fffafc8a2f0, hstate=...) at
/home/rsandifo/gcc/HEAD/gcc/gcc/tree.c:7697
7697          tclass = TREE_CODE_CLASS (code);
(gdb) p/x $r2
$1 = 0x123af688
(gdb) cond 1 $r2 != 0x123af688
(gdb) cont
Continuing.

Breakpoint 1, inchash::add_expr (t=0x3fffaf816000, hstate=...) at
/home/rsandifo/gcc/HEAD/gcc/gcc/tree.c:7697
7697          tclass = TREE_CODE_CLASS (code);
(gdb) bt
#0  inchash::add_expr (t=0x3fffaf816000, hstate=...) at
/home/rsandifo/gcc/HEAD/gcc/gcc/tree.c:7697
#1  0x0000000010ef9118 in iterative_hash_expr (tree=0x3fffaf816000, seed=0) at
/home/rsandifo/gcc/HEAD/gcc/gcc/tree.h:4519
#2  0x0000000010efc99c in tree_operand_hash::hash (t=0x3fffaf816000) at
/home/rsandifo/gcc/HEAD/gcc/gcc/tree-hash-traits.h:33
#3  0x000000001124bc7c in simple_hashmap_traits<tree_operand_hash>::hash
(h=@0x3fffffffdb30: 0x3fffaf816000)
    at /home/rsandifo/gcc/HEAD/gcc/gcc/hash-map-traits.h:48
#4  0x000000001124b7f4 in hash_map<tree_node*, vec<tree_node*, va_heap,
vl_ptr>, val_ssa_equiv_hash_traits>::get (
    this=0x125e0670, k=@0x3fffffffdb30: 0x3fffaf816000) at
/home/rsandifo/gcc/HEAD/gcc/gcc/hash-map.h:142
#5  0x000000001124ab3c in uncprop_into_successor_phis (bb=0x3fffaf850340)
    at /home/rsandifo/gcc/HEAD/gcc/gcc/tree-ssa-uncprop.c:408

So we end up loading an incorrect value of tree_code_type and thus end
up with an invalid tclass:

Dump of assembler code from 0x113575e0 to 0x11357620:
=> 0x00000000113575e0 <inchash::add_expr(tree_node const*,
inchash::hash&)+1776>:       lwz     r0,156(r31)
   0x00000000113575e4 <inchash::add_expr(tree_node const*,
inchash::hash&)+1780>:       clrldi  r0,r0,32
   0x00000000113575e8 <inchash::add_expr(tree_node const*,
inchash::hash&)+1784>:       extsw   r0,r0
   0x00000000113575ec <inchash::add_expr(tree_node const*,
inchash::hash&)+1788>:       ld      r9,-25616(r2)
(gdb) x/1a $r2-25616
0x123b9130:     0x11f86ba0
<_ZZN3vecIP21ipa_agg_jump_function7va_heap8vl_embedE10quick_pushERKS1_E12__FUNCTION__>
(gdb) p/x tree_code_type
$2 = 0x11d9131c <tree_code_type>
(gdb) print code
$3 = ADDR_EXPR
(gdb) print tclass
$4 = 1969711199

Reply via email to