This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix regno_in_use_p for RTL checking bootstrap (PR rtl-optimization/72821)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Vladimir N Makarov <vmakarov at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 6 Aug 2016 21:11:31 +0200
- Subject: [PATCH] Fix regno_in_use_p for RTL checking bootstrap (PR rtl-optimization/72821)
- Authentication-results: sourceware.org; auth=none
- References: <57A23F12.5060706@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Aug 03, 2016 at 02:59:30PM -0400, Vladimir N Makarov wrote:
> --- lra-spills.c (revision 239000)
> +++ lra-spills.c (working copy)
> @@ -686,16 +686,40 @@ return_regno_p (unsigned int regno)
> return false;
> }
>
> -/* Return true if REGNO is one of subsequent USE after INSN. */
> +/* Return true if REGNO is in one of subsequent USE after INSN in the
> + same BB. */
> static bool
> regno_in_use_p (rtx_insn *insn, unsigned int regno)
> {
> + static lra_insn_recog_data_t id;
> + static struct lra_static_insn_data *static_id;
> + struct lra_insn_reg *reg;
> + int i, arg_regno;
> + basic_block bb = BLOCK_FOR_INSN (insn);
> +
> while ((insn = next_nondebug_insn (insn)) != NULL_RTX
> - && INSN_P (insn) && GET_CODE (PATTERN (insn)) == USE)
> + && bb == BLOCK_FOR_INSN (insn))
This broke rtl checking bootstrap, because BLOCK_FOR_INSN can't be used on
BARRIERs.
Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?
2016-08-06 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/72821
* lra-spills.c (regno_in_use_p): Don't use BLOCK_FOR_INSN on barriers,
just return false for them.
--- gcc/lra-spills.c.jj 2016-08-06 12:11:49.000000000 +0200
+++ gcc/lra-spills.c 2016-08-06 14:05:22.751688854 +0200
@@ -697,9 +697,10 @@ regno_in_use_p (rtx_insn *insn, unsigned
int i, arg_regno;
basic_block bb = BLOCK_FOR_INSN (insn);
- while ((insn = next_nondebug_insn (insn)) != NULL_RTX
- && bb == BLOCK_FOR_INSN (insn))
+ while ((insn = next_nondebug_insn (insn)) != NULL_RTX)
{
+ if (BARRIER_P (insn) || bb != BLOCK_FOR_INSN (insn))
+ return false;
if (! INSN_P (insn))
continue;
if (GET_CODE (PATTERN (insn)) == USE
Jakub