* patch to solve PR48380
@ 2011-04-02 3:01 Vladimir Makarov
2011-04-04 18:23 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Makarov @ 2011-04-02 3:01 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 845 bytes --]
The following patch is to solve the PR. The reason for the problem is
described on
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48380
I also found some problem with function fix_reg_equiv_init (it calls
grow_reg_equivs) whose code is never executed anymore because
grow_reg_equivs is called before fix_reg_equiv_init now. I fixed that,
please see all difference for file ira.c
Ok to commit if the patch is successfully bootstrapped on x86_64 and x86
with H.J.'s tester parameters (unfortunately right now I can not check
my patch because a recent patch resulted in a bootstrap failure).
2011-04-01 Vladimir Makarov <vmakarov@redhat.com>
PR target/48380
* ira.c (ira): Call grow_reg_equivs when fix_reg_equiv_init is
not called.
* ira-emit.c (emit_move_list): Update reg equiv init insn list.
[-- Attachment #2: pr48380.patch --]
[-- Type: text/plain, Size: 2923 bytes --]
Index: ira.c
===================================================================
--- ira.c (revision 171852)
+++ ira.c (working copy)
@@ -3657,8 +3657,6 @@ ira (FILE *f)
if (delete_trivially_dead_insns (get_insns (), max_reg_num ()))
df_analyze ();
- grow_reg_equivs ();
-
if (max_regno != max_regno_before_ira)
{
regstat_free_n_sets_and_refs ();
@@ -3667,10 +3665,10 @@ ira (FILE *f)
regstat_compute_ri ();
}
- allocate_initial_values (reg_equivs);
-
overall_cost_before = ira_overall_cost;
- if (ira_conflicts_p)
+ if (! ira_conflicts_p)
+ grow_reg_equivs ();
+ else
{
fix_reg_equiv_init ();
@@ -3686,6 +3684,7 @@ ira (FILE *f)
memset (ira_spilled_reg_stack_slots, 0,
max_regno * sizeof (struct ira_spilled_reg_stack_slot));
}
+ allocate_initial_values (reg_equivs);
timevar_pop (TV_IRA);
Index: ira-emit.c
===================================================================
--- ira-emit.c (revision 171852)
+++ ira-emit.c (working copy)
@@ -900,8 +900,8 @@ modify_move_list (move_t list)
static rtx
emit_move_list (move_t list, int freq)
{
- int cost;
- rtx result, insn;
+ int cost, regno;
+ rtx result, insn, set, to;
enum machine_mode mode;
enum reg_class aclass;
@@ -913,12 +913,34 @@ emit_move_list (move_t list, int freq)
allocno_emit_reg (list->from));
list->insn = get_insns ();
end_sequence ();
- /* The reload needs to have set up insn codes. If the reload
- sets up insn codes by itself, it may fail because insns will
- have hard registers instead of pseudos and there may be no
- machine insn with given hard registers. */
for (insn = list->insn; insn != NULL_RTX; insn = NEXT_INSN (insn))
- recog_memoized (insn);
+ {
+ /* The reload needs to have set up insn codes. If the
+ reload sets up insn codes by itself, it may fail because
+ insns will have hard registers instead of pseudos and
+ there may be no machine insn with given hard
+ registers. */
+ recog_memoized (insn);
+ /* Add insn to equiv init insn list if it is necessary.
+ Otherwise reload will not remove this insn if it decides
+ to use the equivalence. */
+ if ((set = single_set (insn)) != NULL_RTX)
+ {
+ to = SET_DEST (set);
+ if (GET_CODE (to) == SUBREG)
+ to = SUBREG_REG (to);
+ ira_assert (REG_P (to));
+ regno = REGNO (to);
+ if (regno >= ira_reg_equiv_len
+ || (! ira_reg_equiv_invariant_p[regno]
+ && ira_reg_equiv_const[regno] == NULL_RTX))
+ continue; /* regno has no equivalence. */
+ ira_assert (VEC_length (reg_equivs_t, reg_equivs)
+ >= ira_reg_equiv_len);
+ reg_equiv_init (regno)
+ = gen_rtx_INSN_LIST (VOIDmode, insn, reg_equiv_init (regno));
+ }
+ }
emit_insn (list->insn);
mode = ALLOCNO_MODE (list->to);
aclass = ALLOCNO_CLASS (list->to);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: patch to solve PR48380
2011-04-02 3:01 patch to solve PR48380 Vladimir Makarov
@ 2011-04-04 18:23 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2011-04-04 18:23 UTC (permalink / raw)
To: Vladimir Makarov; +Cc: gcc-patches
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 04/01/11 21:06, Vladimir Makarov wrote:
> The following patch is to solve the PR. The reason for the problem is
> described on
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48380
>
> I also found some problem with function fix_reg_equiv_init (it calls
> grow_reg_equivs) whose code is never executed anymore because
> grow_reg_equivs is called before fix_reg_equiv_init now. I fixed that,
> please see all difference for file ira.c
OK. I think this is going to need another twiddle in the future, but I
think it's good for now.
>
> Ok to commit if the patch is successfully bootstrapped on x86_64 and x86
> with H.J.'s tester parameters (unfortunately right now I can not check
> my patch because a recent patch resulted in a bootstrap failure).
>
> 2011-04-01 Vladimir Makarov <vmakarov@redhat.com>
>
> PR target/48380
> * ira.c (ira): Call grow_reg_equivs when fix_reg_equiv_init is
> not called.
>
> * ira-emit.c (emit_move_list): Update reg equiv init insn list.
OK.
Thanks,
Jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJNmgynAAoJEBRtltQi2kC75pYIAJ1ZIdlrv7nVeBMMwcBwo+U1
XU7ipYmtFdWZygyX+2/KNHbNCb0NKg6OzlZAwafuWrGtYNvtinbKw4SVjM2JPTK5
01z2MKuS77C2PPq4NHTMkah/PYjHc+T5WoqqMG+D+gqryo4Q2QwvW76hh6Xac+0b
cq/EiSVwp9yRJPk8bDtNS9633uMdXVovis2olUO9Epe0QmUoDECsdHE1joNuRjkj
Kb5hoOxTjCh9I5ilHAW1NaCW1IqsSfL0Rz9p8K+mGceVTdOx71Su+zXLDFoRULf8
n3oweqt1agK+axKcqnLxwm9PML7j3PH7hBUlFsP5h6a4hbaFegEtU8wMk6RK25g=
=Pf+4
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-04-04 18:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-02 3:01 patch to solve PR48380 Vladimir Makarov
2011-04-04 18:23 ` Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).