Profiling on S390

Jan Hubicka jh@suse.cz
Fri Apr 18 12:11:00 GMT 2003


Hi,
arc profiling on s390 is currently broken because of strcmp expander.
What it does is to emit:
      expand_end_loop ();

      emit_insn ((*gen_short) (op0, op1, convert_to_mode
	    (word_mode, count, 1)));
      emit_label (end_label);

      emit_insn ((*gen_result) (target));

Where gen_result expands into:
(insn 43 42 44 (nil) (set (reg:SI 44)
     (compare:SI (reg:CCS 33 %cc)
            (const_int 0 [0x0]))) -1 (nil)
	        (nil))
Where CC is intialized via the conditional jumps into the label.

It looks very unsafe for me - GCC assumes at many places that CC is not
live accross boundaries.  What happens is that profiler insert adddi on
the begining of BB clobberring the flags.  But in general gcc will
happily reverse the conditional when reordering basic blocks and do
other transformations that can break such construct.

What would be the best sollution?

Honza



More information about the Gcc mailing list