[Bug bootstrap/57604] LRA related bootstrap comparison failure on s390x --with-arch=zEC12

krebbel at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jun 14 09:45:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57604

--- Comment #1 from Andreas Krebbel <krebbel at gcc dot gnu.org> ---
This is caused by a miscompilation of cp/lex.c:

#define DEF_OPERATOR(NAME, CODE, MANGLING, ARITY, ASSN_P)            \
  sprintf (buffer, ISALPHA (NAME[0]) ? "operator %s" : "operator%s", NAME); \
  identifier = get_identifier (buffer);                        \
...

The problem is that during LRA an add insn is being generated which is placed
between the "ISALPHA" check and the conditional load for the format string. 
The ADD which is generated clobbers the condition code why DSE later removes
the "ISALPHA" check completely.

When generating the ADD LRA probably needs to check whether it will break
dataflow. On S/390 we can do such address calculations without clobbering CC by
using the load address instruction. Unfortunately la cannot be used for generic
add patterns when generating 32 bit code since it only deals with the lower 31
bits.

Breakpoint 1, make_insn_raw (pattern=0x3fff6195580) at
/home/andreas/clean/gcc-head/gcc/emit-rtl.c:3651
3651      insn = rtx_alloc (INSN);
(gdb) p debug_rtx(pattern)
(parallel [
        (set (reg:DI 3022)
            (plus:DI (reg/f:DI 34 %fp)
                (const_int 176 [0xb0])))
        (clobber (reg:CC 33 %cc))
    ])
$1 = void
(gdb) bt
#0  make_insn_raw (pattern=0x3fff6195580) at
/home/andreas/clean/gcc-head/gcc/emit-rtl.c:3651
#1  0x00000000805b4578 in emit_insn (x=0x3fff6195580) at
/home/andreas/clean/gcc-head/gcc/emit-rtl.c:4736
#2  0x00000000807d5e74 in lra_emit_add (x=0x3fff7a079c0, y=0x3fff78754c0,
z=0x3fff632a630) at /home/andreas/clean/gcc-head/gcc/lra.c:266
#3  0x00000000807d656e in lra_emit_move (x=0x3fff7a079c0, y=0x3fff6199600) at
/home/andreas/clean/gcc-head/gcc/lra.c:415
#4  0x00000000807eb7fa in curr_insn_transform() ()
#5  0x00000000807ed45c in lra_constraints(bool) ()
#6  0x00000000807dc616 in lra (f=0x816a46f0) at
/home/andreas/clean/gcc-head/gcc/lra.c:2278
#7  0x00000000807845a6 in do_reload () at
/home/andreas/clean/gcc-head/gcc/ira.c:4641
#8  0x000000008078485e in rest_of_handle_reload () at
/home/andreas/clean/gcc-head/gcc/ira.c:4753
#9  0x000000008085a4b2 in execute_one_pass (pass=0x81359060 <pass_reload>) at
/home/andreas/clean/gcc-head/gcc/passes.c:2337
#10 0x000000008085a76a in execute_pass_list (pass=0x81359060 <pass_reload>) at
/home/andreas/clean/gcc-head/gcc/passes.c:2389
#11 0x000000008085a7b8 in execute_pass_list (pass=0x813597d0
<pass_rest_of_compilation>) at /home/andreas/clean/gcc-head/gcc/passes.c:2390
#12 0x00000000804ece5e in expand_function (node=0x3fff62f1130) at
/home/andreas/clean/gcc-head/gcc/cgraphunit.c:1582
#13 0x00000000804ed418 in expand_all_functions () at
/home/andreas/clean/gcc-head/gcc/cgraphunit.c:1686
#14 0x00000000804ee00c in compile () at
/home/andreas/clean/gcc-head/gcc/cgraphunit.c:2020
#15 0x00000000804ee1f0 in finalize_compilation_unit () at
/home/andreas/clean/gcc-head/gcc/cgraphunit.c:2097
#16 0x00000000802667fc in cp_write_global_declarations () at
/home/andreas/clean/gcc-head/gcc/cp/decl2.c:4356
#17 0x0000000080966c06 in compile_file () at
/home/andreas/clean/gcc-head/gcc/toplev.c:558
#18 0x00000000809697e8 in do_compile () at
/home/andreas/clean/gcc-head/gcc/toplev.c:1872
#19 0x00000000809699c4 in toplev_main (argc=32, argv=0x3fffffff138) at
/home/andreas/clean/gcc-head/gcc/toplev.c:1948
#20 0x0000004f6a8ec30c in __libc_start_main () from /lib64/libc.so.6
#21 0x00000000801335aa in _start ()
(gdb)



More information about the Gcc-bugs mailing list