This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to update reg_dead notes

when i suggested that you do a build with all of the checking turned on, i wanted you to this without you new code in it. there is a good possibility that the problem is that your port is generating bad rtl. Also, you should generate a debuggable compiler so that the line numbers have some relevance to reality.

On 02/24/2015 01:23 PM, Georg-Johann Lay wrote:
Am 02/24/2015 um 06:06 PM schrieb Eric Botcazou:
Could you give me some advice on correct usage of df or even more preferred point me to a comprehensible documentation of df which is more complete than
in df-core.c?

Take a look at the c6x and mep ports.

Thanks for the hint.  I changed the execute method to:

unsigned int execute ()
    compute_bb_for_insn ();
    //df_clear_flags (DF_LR_RUN_DCE);
    df_note_add_problem ();
    df_analyze ();
    df_finish_pass (false);

    return 0;

bit it keeps aborting. Actually I am just copy pasting code from some other passes / BEs, but these places also don't have explanation for why they must use, may use, must not use specific functions.

Compiling the mentioned test case from libgcc with -Os (so that less insns are left over) and patching df-scan.c:df_refs_verify to print the refs just before it does gcc_assert (0):

new_ref = { u-1(18){ }}
*old_rec = { u-1(18){ }u-1(19){ }u-1(24){ }u-1(25){ }}
libgcc2-addvsi3.c: In function '__addvhi3':
libgcc2-addvsi3.c:1514:1: internal compiler error: in df_refs_verify, at df-scan.c:4338

In df_insn_refs_verify which is in the call chain of df_refs_verify, insn reads:

(insn 21 19 22 5 (parallel [
            (set (cc0)
                (compare (reg/v:HI 18 r18 [orig:48 a ] [48])
                    (reg/v:HI 24 r24 [orig:46 w ] [46])))
            (clobber (scratch:QI))
        ]) libgcc2-addvsi3.c:1511 408 {*cmphi}
     (expr_list:REG_DEAD (reg/v:HI 18 r18 [orig:48 a ] [48])

r18 and r24 are ordinary general-purpose hard registers.

The latest pass which runs before the crash is .split5, i.e. recog.c::pass_split_for_shorten_branches which executes split_all_insns_noflow which in turn reads:

/* Same as split_all_insns, but do not expect CFG to be available.
   Used by machine dependent reorg passes.  */

unsigned int
split_all_insns_noflow (void)
{ ...

Does this mean CFG is (or might be) messed up after this pass and this is the reason for why df crashes because df needs correct CFG?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]