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

--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> ---
Dump of assembler code from 0x1094366c to 0x109436e0:
   0x000000001094366c <operand_compare::hash_operand(tree_node const*,
inchash::hash&, unsigned int)+2432>:     lhz     r0,0(r9)
   0x0000000010943670 <operand_compare::hash_operand(tree_node const*,
inchash::hash&, unsigned int)+2436>:     clrldi  r0,r0,48
   0x0000000010943674 <operand_compare::hash_operand(tree_node const*,
inchash::hash&, unsigned int)+2440>:     stw     r0,200(r31)
   0x0000000010943678 <operand_compare::hash_operand(tree_node const*,
inchash::hash&, unsigned int)+2444>:     lwz     r0,200(r31)
=> 0x000000001094367c <operand_compare::hash_operand(tree_node const*,
inchash::hash&, unsigned int)+2448>:     clrldi  r0,r0,32
   0x0000000010943680 <operand_compare::hash_operand(tree_node const*,
inchash::hash&, unsigned int)+2452>:     extsw   r0,r0
   0x0000000010943684 <operand_compare::hash_operand(tree_node const*,
inchash::hash&, unsigned int)+2456>:     ld      r9,-11776(r2)
   0x0000000010943688 <operand_compare::hash_operand(tree_node const*,
inchash::hash&, unsigned int)+2460>:     rldicr  r0,r0,2,61
   0x000000001094368c <operand_compare::hash_operand(tree_node const*,
inchash::hash&, unsigned int)+2464>:     add     r9,r9,r0
   0x0000000010943690 <operand_compare::hash_operand(tree_node const*,
inchash::hash&, unsigned int)+2468>:     lwz     r0,0(r9)
   0x0000000010943694 <operand_compare::hash_operand(tree_node const*,
inchash::hash&, unsigned int)+2472>:     stw     r0,152(r31)

r0 is ADDR_EXPR (130)

(gdb) p/x $r2
$21 = 0x12b81a48
(gdb) p/x tree_code_type
$22 = 0x123216a0 <tree_code_type>

after ld      r9,-11776(r2):

(gdb) p/x $r9
$25 = 0x12a9fc38
rldicr  r0,r0,2,61
(gdb) p $r0
$26 = 520
add     r9,r9,r0
(gdb) p/x $r9
$27 = 0x12a9fe40

and then we load 0 (tcc_exceptional) from $r9, but

(gdb) p tree_code_type[130]
$31 = tcc_expression

so sth is obviously broken here, but I don't understand ppc assembly enough
to spot what.  I guess r2 is "off"?  It has this same value at function
entry already.

Are we maybe running into some linker relaxation / TOC overflow issue
(given that -O2 works)?  We're using -mno-minimal-toc when building libgcc
but the host compiler uses plain -g -fno-PIE and we don't supply any
special linker flags for cc1 either.  Note this build uses binutils 2.25.0
(Bill, is that what you use as well?)

Reply via email to