This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

[Bug rtl-optimization/51505] [4.5/4.6/4.7 Regression] ICE: in form_sum, at reload.c:5349 with -O --param max-cse-insns=1


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

--- Comment #6 from Paolo Bonzini <bonzini at gnu dot org> 2012-01-17 16:22:08 UTC ---
Yeah, perhaps you can make the code nicer by avoiding the nested loops:

        for (use_rec = DF_INSN_EQ_USES (insn); *use_rec; use_rec++)
          {
        df_ref use = *use_rec;
        if (DF_REF_REGNO (use) > FIRST_PSEUDO_REGISTER
            && (DF_REF_FLAGS (use) & DF_REF_IN_NOTE)
            && !bitmap_bit_p (live, DF_REF_REGNO (use))
            && DF_REF_LOC (use)
            && loc_mentioned_in_p (DF_REF_LOC (use), XEXP (link, 0)))
                  {
                    delete = true;
                    break;
                  }
              }
            if (!delete)
              ...
        for (use_rec = DF_INSN_EQ_USES (insn); *use_rec; use_rec++)
          if ((DF_REF_FLAGS (*use_rec) & DF_REF_IN_NOTE)
          && DF_REF_LOC (*use_rec)
          && loc_mentioned_in_p (DF_REF_LOC (*use_rec),
                     XEXP (link, 0)))
        VEC_safe_push (df_ref, heap, refs, *use_rec);
        FOR_EACH_VEC_ELT (df_ref, refs, i, use)
          df_ref_remove (use);
        VEC_free (df_ref, heap, refs);
        free_EXPR_LIST_node (link);
        *pprev = link = next;

Using a heap-allocated VEC is also a bit heavy, perhaps it's cheaper to
allocate on the stack a vector with room for all EQ_USES.  In fact, there can
be only one REG_EQUAL/REG_EQUIV note, so all EQ_USES should be killed, no?  Are
the loc_mentioned_in_p tests redundant?


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