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

2013-07-31 Thread krebbel at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57604

Andreas Krebbel  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Andreas Krebbel  ---
Fixed with r200227:

2013-06-19  Vladimir Makarov  

PR bootstrap/57604
* lra.c (emit_add3_insn, emit_add2_insn): New functions.
(lra_emit_add): Use the functions.  Add comment about Y as an
address segment.


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

2013-06-18 Thread krebbel at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57604

--- Comment #3 from Andreas Krebbel  ---
(In reply to Vladimir Makarov from comment #2)
Thanks! Btw. the Ada and Java bootstraps started failing with enabling LRA for
S/390 (also without --with-arch=...).  I'll wait for a patch for this PR before
having a closer look. Perhaps the fails are related?!


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

2013-06-17 Thread vmakarov at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57604

Vladimir Makarov  changed:

   What|Removed |Added

 CC||vmakarov at redhat dot com

--- Comment #2 from Vladimir Makarov  ---
Andreas, thanks for checking it and doing the analysis.  I'll try to make a
patch fixing this on this week.


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

2013-06-14 Thread krebbel at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57604

--- Comment #1 from Andreas Krebbel  ---
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  0x805b4578 in emit_insn (x=0x3fff6195580) at
/home/andreas/clean/gcc-head/gcc/emit-rtl.c:4736
#2  0x807d5e74 in lra_emit_add (x=0x3fff7a079c0, y=0x3fff78754c0,
z=0x3fff632a630) at /home/andreas/clean/gcc-head/gcc/lra.c:266
#3  0x807d656e in lra_emit_move (x=0x3fff7a079c0, y=0x3fff6199600) at
/home/andreas/clean/gcc-head/gcc/lra.c:415
#4  0x807eb7fa in curr_insn_transform() ()
#5  0x807ed45c in lra_constraints(bool) ()
#6  0x807dc616 in lra (f=0x816a46f0) at
/home/andreas/clean/gcc-head/gcc/lra.c:2278
#7  0x807845a6 in do_reload () at
/home/andreas/clean/gcc-head/gcc/ira.c:4641
#8  0x8078485e in rest_of_handle_reload () at
/home/andreas/clean/gcc-head/gcc/ira.c:4753
#9  0x8085a4b2 in execute_one_pass (pass=0x81359060 ) at
/home/andreas/clean/gcc-head/gcc/passes.c:2337
#10 0x8085a76a in execute_pass_list (pass=0x81359060 ) at
/home/andreas/clean/gcc-head/gcc/passes.c:2389
#11 0x8085a7b8 in execute_pass_list (pass=0x813597d0
) at /home/andreas/clean/gcc-head/gcc/passes.c:2390
#12 0x804ece5e in expand_function (node=0x3fff62f1130) at
/home/andreas/clean/gcc-head/gcc/cgraphunit.c:1582
#13 0x804ed418 in expand_all_functions () at
/home/andreas/clean/gcc-head/gcc/cgraphunit.c:1686
#14 0x804ee00c in compile () at
/home/andreas/clean/gcc-head/gcc/cgraphunit.c:2020
#15 0x804ee1f0 in finalize_compilation_unit () at
/home/andreas/clean/gcc-head/gcc/cgraphunit.c:2097
#16 0x802667fc in cp_write_global_declarations () at
/home/andreas/clean/gcc-head/gcc/cp/decl2.c:4356
#17 0x80966c06 in compile_file () at
/home/andreas/clean/gcc-head/gcc/toplev.c:558
#18 0x809697e8 in do_compile () at
/home/andreas/clean/gcc-head/gcc/toplev.c:1872
#19 0x809699c4 in toplev_main (argc=32, argv=0x3fff138) at
/home/andreas/clean/gcc-head/gcc/toplev.c:1948
#20 0x004f6a8ec30c in __libc_start_main () from /lib64/libc.so.6
#21 0x801335aa in _start ()
(gdb)