From: Jeff Law <law@redhat.com>
To: David Malcolm <dmalcolm@redhat.com>,
Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH v2] Re: PR62304 (was Re: (Still) ICE for cris-elf at r214710)
Date: Sat, 30 Aug 2014 05:42:00 -0000 [thread overview]
Message-ID: <54016423.8030906@redhat.com> (raw)
In-Reply-To: <1409335624.31600.32.camel@surprise>
On 08/29/14 12:07, David Malcolm wrote:
>
> Yes: I made various mistakes in reorg.c and resource.c where I assumed
> that a JUMP_LABEL(insn) was an insn, whereas the existing code is set up
> to handle RETURN nodes.
Well, it would seem to me that reorg is being totally braindead in
mixing and matching these two nodes. In particular whatever code is
passing around a RETURN rtx into places that normally accept some kind
of INSN would appear to be broken.
>
> It eliminates all uses of JUMP_LABEL_AS_INSN from reorg.c, and indeed
> after that there are only 6 uses in the tree (including config subdirs).
Good to some extent as I see JUMP_LABEL_AS_INSN as papering over bugs
elsewhere, but this patch is also a step backwards as we're papering
over a mess in reorg.c.
>
> 2014-08-29 David Malcolm <dmalcolm@redhat.com>
>
> PR bootstrap/62304
>
> * gcc/reorg.c (skip_consecutive_labels): Convert return type and
> param back from rtx_insn * to rtx. Rename param from "label" to
> "label_or_return", reintroducing "label" as an rtx_insn * after
> we've ensured it's not a RETURN.
> (first_active_target_insn): Likewise for return type and param;
> add a checked cast to rtx_insn * once we've ensured "insn" is not
> a RETURN.
> (steal_delay_list_from_target): Convert param "pnew_thread" back
> from rtx_insn ** to rtx *. Replace use of JUMP_LABEL_AS_INSN
> with JUMP_LABEL.
> (own_thread_p): Convert param "thread" back from an rtx_insn * to
> an rtx. Introduce local rtx_insn * "thread_insn" with a checked
> cast once we've established we're not dealing with a RETURN,
> renaming subsequent uses of "thread" to "thread_insn".
> (fill_simple_delay_slots): Convert uses of JUMP_LABEL_AS_INSN back
> to JUMP_LABEL.
> (follow_jumps): Convert return type and param "label" from
> rtx_insn * back to rtx. Move initialization of "value" to after
> the handling for ANY_RETURN_P, adding a checked cast there to
> rtx_insn *. Convert local rtx_insn * "this_label" to an rtx and
> rename to "this_label_or_return", reintroducing "this_label" as
> an rtx_insn * once we've handled the case where it could be an
> ANY_RETURN_P.
> (fill_slots_from_thread): Rename param "thread" to
> "thread_or_return", converting from an rtx_insn * back to an rtx.
> Reintroduce name "thread" as an rtx_insn * local with a checked
> cast once we've handled the case of it being an ANY_RETURN_P.
> Convert local "new_thread" from an rtx_insn * back to an rtx.
> Add a checked cast when assigning to "trial" from "new_thread".
> Convert use of JUMP_LABEL_AS_INSN back to JUMP_LABEL. Add a
> checked cast to rtx_insn * from "new_thread" when invoking
> get_label_before.
> (fill_eager_delay_slots): Convert locals "target_label",
> "insn_at_target" from rtx_insn * back to rtx.
> Convert uses of JUMP_LABEL_AS_INSN back to JUMP_LABEL.
> (relax_delay_slots): Convert locals "trial", "target_label" from
> rtx_insn * back to rtx. Convert uses of JUMP_LABEL_AS_INSN back
> to JUMP_LABEL. Add a checked cast to rtx_insn * on "trial" when
> invoking update_block.
> (dbr_schedule): Convert use of JUMP_LABEL_AS_INSN back to
> JUMP_LABEL; this removes all JUMP_LABEL_AS_INSN from reorg.c.
>
> * resource.h (mark_target_live_regs): Undo erroneous conversion
> of second param of r214693, converting it back from rtx_insn * to
> rtx, since it could be a RETURN.
>
> * resource.c (find_dead_or_set_registers): Similarly, convert
> param "jump_target" back from an rtx_insn ** to an rtx *, as we
> could be writing back a RETURN. Rename local rtx_insn * "next" to
> "next_insn", and introduce "lab_or_return" as a local rtx,
> handling the case where JUMP_LABEL (this_jump_insn) is a RETURN.
> (mark_target_live_regs): Undo erroneous conversion
> of second param of r214693, converting it back from rtx_insn * to
> rtx, since it could be a RETURN. Rename it from "target" to
> "target_maybe_return", reintroducing the name "target" as a local
> rtx_insn * with a checked cast, after we've handled the case of
> ANY_RETURN_P.
I'll OK as a means to restore the trunk to working order, but let's add
a follow-up item to track down places where we're passing things like a
RETURN rtx in places where we really are expecting insns.
jeff
>
next prev parent reply other threads:[~2014-08-30 5:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 4:14 (Still) ICE for cris-elf at r214710 Hans-Peter Nilsson
2014-08-29 11:30 ` David Malcolm
2014-08-29 11:44 ` David Malcolm
2014-08-29 13:41 ` Hans-Peter Nilsson
2014-08-29 14:49 ` Hans-Peter Nilsson
2014-08-29 15:37 ` PR62304 (was Re: (Still) ICE for cris-elf at r214710) David Malcolm
2014-08-29 16:16 ` Hans-Peter Nilsson
2014-08-29 18:10 ` [PATCH v2] " David Malcolm
2014-08-29 20:27 ` Hans-Peter Nilsson
2014-08-30 5:42 ` Jeff Law [this message]
2014-08-30 14:38 ` David Malcolm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54016423.8030906@redhat.com \
--to=law@redhat.com \
--cc=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hans-peter.nilsson@axis.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).