From: Steven Bosscher <stevenb@suse.de>
To: Andreas Schwab <schwab@suse.de>
Cc: gcc-patches@gcc.gnu.org, rth@redhat.com
Subject: Hopefully fix Alpha/SH/IA64 for mainline (was: Re: Accumulated cleanups)
Date: Wed, 28 Jul 2004 15:02:00 -0000 [thread overview]
Message-ID: <200407281042.31392.stevenb@suse.de> (raw)
In-Reply-To: <200407281022.23315.stevenb@suse.de>
[-- Attachment #1: Type: text/plain, Size: 535 bytes --]
On Wednesday 28 July 2004 10:22, Steven Bosscher wrote:
> I'll prepare a patch.
Like so. Can you give this a try please?
* rtl.c (currently_expanding_to_rtl): New.
* rtl.h (currently_expanding_to_rtl): Export it.
* cfgexpand.c (tree_cfg_expand): Set/clear it at entry/exit.
* config/alpha/alpha.c (alpha_expand_mov): Remove old RTL
inliner hack.
* config/sh/sh.c: Replace rtx_equal_function_value_matters
with currently_expanding_to_rtl.
* config/sh/sh.md: Likewise.
* config/ia64/ia64.c (got_symbolic_operand): Likewise.
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 12171 bytes --]
* rtl.c (currently_expanding_to_rtl): New.
* rtl.h (currently_expanding_to_rtl): Export it.
* cfgexpand.c (tree_cfg_expand): Set/clear it at entry/exit.
* config/alpha/alpha.c (alpha_expand_mov): Remove old RTL
inliner hack.
* config/sh/sh.c: Replace rtx_equal_function_value_matters
with currently_expanding_to_rtl.
* config/sh/sh.md: Likewise.
* config/ia64/ia64.c (got_symbolic_operand): Likewise.
Index: cfgexpand.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgexpand.c,v
retrieving revision 2.15
diff -c -3 -p -r2.15 cfgexpand.c
*** cfgexpand.c 27 Jul 2004 19:09:29 -0000 2.15
--- cfgexpand.c 28 Jul 2004 08:31:51 -0000
*************** tree_expand_cfg (void)
*** 433,438 ****
--- 433,441 ----
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)));
}
+ /* Some backends want to know that we are expanding to RTL. */
+ currently_expanding_to_rtl = 1;
+
/* Prepare the rtl middle end to start recording block changes. */
reset_block_changes ();
*************** tree_expand_cfg (void)
*** 459,464 ****
--- 462,470 ----
construct_exit_block ();
+ /* We're done expanding trees to RTL. */
+ currently_expanding_to_rtl = 0;
+
/* Convert from NOTE_INSN_EH_REGION style notes, and do other
sorts of eh initialization. Delay this until after the
initial rtl dump so that we can see the original nesting. */
Index: rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.c,v
retrieving revision 1.143
diff -c -3 -p -r1.143 rtl.c
*** rtl.c 27 Jul 2004 19:09:32 -0000 1.143
--- rtl.c 28 Jul 2004 08:31:51 -0000
*************** shallow_copy_rtx_stat (rtx orig MEM_STAT
*** 320,325 ****
--- 320,329 ----
/* Nonzero when we are generating CONCATs. */
int generating_concat_p;
+
+ /* Nonzero when we are expanding trees to RTL. */
+ int currently_expanding_to_rtl;
+
/* Return 1 if X and Y are identical-looking rtx's.
This is the Lisp function EQUAL for rtx arguments. */
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.495
diff -c -3 -p -r1.495 rtl.h
*** rtl.h 27 Jul 2004 19:09:32 -0000 1.495
--- rtl.h 28 Jul 2004 08:31:51 -0000
*************** do { \
*** 1543,1548 ****
--- 1543,1551 ----
/* Nonzero when we are generating CONCATs. */
extern int generating_concat_p;
+ /* Nonzero when we are expanding trees to RTL. */
+ extern int currently_expanding_to_rtl;
+
/* Generally useful functions. */
/* In expmed.c */
Index: config/alpha/alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.380
diff -c -3 -p -r1.380 alpha.c
*** config/alpha/alpha.c 26 Jul 2004 07:07:48 -0000 1.380
--- config/alpha/alpha.c 28 Jul 2004 08:31:52 -0000
*************** alpha_expand_mov (enum machine_mode mode
*** 2796,2818 ****
{
rtx tmp;
- /* With RTL inlining, at -O3, rtl is generated, stored, then actually
- compiled at the end of compilation. In the meantime, someone can
- re-encode-section-info on some symbol changing it e.g. from global
- to local-not-small. If this happens, we'd have emitted a plain
- load rather than a high+losum load and not recognize the insn.
-
- So if rtl inlining is in effect, we delay the global/not-global
- decision until rest_of_compilation by wrapping it in an
- UNSPEC_SYMBOL. */
- if (TARGET_EXPLICIT_RELOCS && flag_inline_functions
- && rtx_equal_function_value_matters
- && global_symbolic_operand (operands[1], mode))
- {
- emit_insn (gen_movdi_er_maybe_g (operands[0], operands[1]));
- return true;
- }
-
tmp = alpha_legitimize_address (operands[1], operands[0], mode);
if (tmp)
{
--- 2796,2801 ----
Index: config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.311
diff -c -3 -p -r1.311 ia64.c
*** config/ia64/ia64.c 27 Jul 2004 21:41:20 -0000 1.311
--- config/ia64/ia64.c 28 Jul 2004 08:31:52 -0000
*************** got_symbolic_operand (rtx op, enum machi
*** 489,495 ****
/* "Ok" while emitting rtl, since otherwise we won't be provided
with the entire offset during emission, which makes it very
hard to split the offset into high and low parts. */
! if (rtx_equal_function_value_matters)
return 1;
/* Force the low 14 bits of the constant to zero so that we do not
--- 489,495 ----
/* "Ok" while emitting rtl, since otherwise we won't be provided
with the entire offset during emission, which makes it very
hard to split the offset into high and low parts. */
! if (currently_expanding_to_rtl)
return 1;
/* Force the low 14 bits of the constant to zero so that we do not
Index: config/sh/sh.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.c,v
retrieving revision 1.285
diff -c -3 -p -r1.285 sh.c
*** config/sh/sh.c 20 Jul 2004 07:27:15 -0000 1.285
--- config/sh/sh.c 28 Jul 2004 08:31:53 -0000
*************** shl_and_scr_length (rtx insn)
*** 2239,2247 ****
return len + shift_insns[INTVAL (XEXP (op, 1))];
}
- /* Generating rtl? */
- extern int rtx_equal_function_value_matters;
-
/* Generate rtl for instructions for which shl_and_kind advised a particular
method of generating them, i.e. returned zero. */
--- 2239,2244 ----
*************** gen_shl_and (rtx dest, rtx left_rtx, rtx
*** 2312,2318 ****
case 2:
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
! if (rtx_equal_function_value_matters
|| reload_in_progress || reload_completed)
{
rtx operands[3];
--- 2309,2315 ----
case 2:
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
! if (currently_expanding_to_rtl
|| reload_in_progress || reload_completed)
{
rtx operands[3];
*************** gen_shl_sext (rtx dest, rtx left_rtx, rt
*** 2509,2515 ****
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
! if (! rtx_equal_function_value_matters
&& ! reload_in_progress && ! reload_completed)
{
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
--- 2506,2512 ----
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
! if (! currently_expanding_to_rtl
&& ! reload_in_progress && ! reload_completed)
{
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
*************** gen_shl_sext (rtx dest, rtx left_rtx, rt
*** 2564,2570 ****
case 5:
{
int i = 16 - size;
! if (! rtx_equal_function_value_matters
&& ! reload_in_progress && ! reload_completed)
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
else
--- 2561,2567 ----
case 5:
{
int i = 16 - size;
! if (! currently_expanding_to_rtl
&& ! reload_in_progress && ! reload_completed)
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
else
*************** gen_shl_sext (rtx dest, rtx left_rtx, rt
*** 2583,2589 ****
case 7:
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
! if (! rtx_equal_function_value_matters
&& ! reload_in_progress && ! reload_completed)
{
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
--- 2580,2586 ----
case 7:
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
! if (! currently_expanding_to_rtl
&& ! reload_in_progress && ! reload_completed)
{
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
Index: config/sh/sh.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.md,v
retrieving revision 1.177
diff -c -3 -p -r1.177 sh.md
*** config/sh/sh.md 19 Jul 2004 07:11:37 -0000 1.177
--- config/sh/sh.md 28 Jul 2004 08:31:54 -0000
***************
*** 3389,3395 ****
(unspec:SI [(match_operand 1 "register_operand" "")] UNSPEC_RA))]
"TARGET_SH1"
"#"
! "&& ! rtx_equal_function_value_matters"
[(set (match_dup 0) (match_dup 1))]
"
{
--- 3389,3395 ----
(unspec:SI [(match_operand 1 "register_operand" "")] UNSPEC_RA))]
"TARGET_SH1"
"#"
! "&& ! currently_expanding_to_rtl"
[(set (match_dup 0) (match_dup 1))]
"
{
*************** mov.l\\t1f,r0\\n\\
*** 7393,7399 ****
}
if (sh_expand_t_scc (EQ, operands[0]))
DONE;
! if (! rtx_equal_function_value_matters)
FAIL;
operands[1] = prepare_scc_operands (EQ);
}")
--- 7393,7399 ----
}
if (sh_expand_t_scc (EQ, operands[0]))
DONE;
! if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (EQ);
}")
*************** mov.l\\t1f,r0\\n\\
*** 7441,7447 ****
}
DONE;
}
! if (! rtx_equal_function_value_matters)
FAIL;
operands[1] = prepare_scc_operands (LT);
}")
--- 7441,7447 ----
}
DONE;
}
! if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (LT);
}")
*************** mov.l\\t1f,r0\\n\\
*** 7545,7551 ****
}
DONE;
}
! if (! rtx_equal_function_value_matters)
FAIL;
operands[1] = prepare_scc_operands (GT);
}")
--- 7545,7551 ----
}
DONE;
}
! if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (GT);
}")
*************** mov.l\\t1f,r0\\n\\
*** 7599,7605 ****
DONE;
}
! if (! rtx_equal_function_value_matters)
FAIL;
if (GET_MODE_CLASS (GET_MODE (sh_compare_op0)) == MODE_FLOAT)
{
--- 7599,7605 ----
DONE;
}
! if (! currently_expanding_to_rtl)
FAIL;
if (GET_MODE_CLASS (GET_MODE (sh_compare_op0)) == MODE_FLOAT)
{
*************** mov.l\\t1f,r0\\n\\
*** 7640,7646 ****
sh_compare_op0, sh_compare_op1));
DONE;
}
! if (! rtx_equal_function_value_matters)
FAIL;
operands[1] = prepare_scc_operands (GTU);
}")
--- 7640,7646 ----
sh_compare_op0, sh_compare_op1));
DONE;
}
! if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (GTU);
}")
*************** mov.l\\t1f,r0\\n\\
*** 7666,7672 ****
sh_compare_op1, sh_compare_op0));
DONE;
}
! if (! rtx_equal_function_value_matters)
FAIL;
operands[1] = prepare_scc_operands (LTU);
}")
--- 7666,7672 ----
sh_compare_op1, sh_compare_op0));
DONE;
}
! if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (LTU);
}")
*************** mov.l\\t1f,r0\\n\\
*** 7697,7703 ****
DONE;
}
! if (! rtx_equal_function_value_matters)
FAIL;
operands[1] = prepare_scc_operands (LEU);
}")
--- 7697,7703 ----
DONE;
}
! if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (LEU);
}")
*************** mov.l\\t1f,r0\\n\\
*** 7729,7735 ****
DONE;
}
! if (! rtx_equal_function_value_matters)
FAIL;
operands[1] = prepare_scc_operands (GEU);
}")
--- 7729,7735 ----
DONE;
}
! if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (GEU);
}")
*************** mov.l\\t1f,r0\\n\\
*** 7780,7786 ****
if (sh_expand_t_scc (NE, operands[0]))
DONE;
! if (! rtx_equal_function_value_matters)
FAIL;
operands[1] = prepare_scc_operands (EQ);
operands[2] = gen_reg_rtx (SImode);
--- 7780,7786 ----
if (sh_expand_t_scc (NE, operands[0]))
DONE;
! if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (EQ);
operands[2] = gen_reg_rtx (SImode);
next prev parent reply other threads:[~2004-07-28 8:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-22 7:30 Accumulated cleanups Steven Bosscher
2004-07-26 22:53 ` Ping: " Steven Bosscher
2004-07-28 3:17 ` Jeffrey A Law
2004-07-28 14:47 ` Andreas Schwab
2004-07-28 15:02 ` Steven Bosscher
2004-07-28 15:02 ` Steven Bosscher [this message]
2004-07-28 15:52 ` Hopefully fix Alpha/SH/IA64 for mainline (was: Re: Accumulated cleanups) Andreas Schwab
2004-07-29 8:16 ` Richard Henderson
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=200407281042.31392.stevenb@suse.de \
--to=stevenb@suse.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=rth@redhat.com \
--cc=schwab@suse.de \
/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).