* [committed] Fix PR target/68729
@ 2015-12-10 1:00 John David Anglin
[not found] ` <6B7806D6-C14A-4226-8056-C043BD62874A@bell.net>
0 siblings, 1 reply; 2+ messages in thread
From: John David Anglin @ 2015-12-10 1:00 UTC (permalink / raw)
To: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 539 bytes --]
The attached fixes an ICE building gridengine. The problem is we are asked to do an HImode reload
for a floating pointing register. However, we can only do 32 and 64-bit loads and stores to/from floating
point registers.
The problem is resolved by not checking that the mode requested is consistent with the modes of the
input and output operands.
Tested on hppa-unknown-linux-gnu, hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11. Committed
to trunk and active branches.
Dave
--
John David Anglin dave.anglin@bell.net
[-- Attachment #2: pa.c.d.txt --]
[-- Type: text/plain, Size: 2449 bytes --]
2015-12-09 John David Anglin <danglin@gcc.gnu.org>
PR target/68729
* config/pa/pa.c (pa_emit_move_sequence): Don't check that mode is
consistent with modes of the input and output operands when doing
reloads to and from floating point registers. Do reload for all
address forms.
Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c (revision 231326)
+++ config/pa/pa.c (working copy)
@@ -1683,11 +1683,10 @@
REG+D addresses where D does not fit in 5 or 14 bits, including
(subreg (mem (addr))) cases. */
if (scratch_reg
- && fp_reg_operand (operand0, mode)
+ && FP_REG_P (operand0)
&& (MEM_P (operand1)
|| (GET_CODE (operand1) == SUBREG
- && MEM_P (XEXP (operand1, 0))))
- && !floating_point_store_memory_operand (operand1, mode))
+ && MEM_P (XEXP (operand1, 0)))))
{
if (GET_CODE (operand1) == SUBREG)
operand1 = XEXP (operand1, 0);
@@ -1699,10 +1698,8 @@
/* D might not fit in 14 bits either; for such cases load D into
scratch reg. */
- if (reg_plus_base_memory_operand (operand1, mode)
- && !(TARGET_PA_20
- && !TARGET_ELF32
- && INT_14_BITS (XEXP (XEXP (operand1, 0), 1))))
+ if (reg_plus_base_memory_operand (operand1, GET_MODE (operand1))
+ && !INT_14_BITS (XEXP (XEXP (operand1, 0), 1)))
{
emit_move_insn (scratch_reg, XEXP (XEXP (operand1, 0), 1));
emit_move_insn (scratch_reg,
@@ -1718,11 +1715,10 @@
return 1;
}
else if (scratch_reg
- && fp_reg_operand (operand1, mode)
+ && FP_REG_P (operand1)
&& (MEM_P (operand0)
|| (GET_CODE (operand0) == SUBREG
- && MEM_P (XEXP (operand0, 0))))
- && !floating_point_store_memory_operand (operand0, mode))
+ && MEM_P (XEXP (operand0, 0)))))
{
if (GET_CODE (operand0) == SUBREG)
operand0 = XEXP (operand0, 0);
@@ -1734,10 +1730,8 @@
/* D might not fit in 14 bits either; for such cases load D into
scratch reg. */
- if (reg_plus_base_memory_operand (operand0, mode)
- && !(TARGET_PA_20
- && !TARGET_ELF32
- && INT_14_BITS (XEXP (XEXP (operand0, 0), 1))))
+ if (reg_plus_base_memory_operand (operand0, GET_MODE (operand0))
+ && !INT_14_BITS (XEXP (XEXP (operand0, 0), 1)))
{
emit_move_insn (scratch_reg, XEXP (XEXP (operand0, 0), 1));
emit_move_insn (scratch_reg, gen_rtx_fmt_ee (GET_CODE (XEXP (operand0,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [committed] Fix PR target/68729
[not found] ` <6B7806D6-C14A-4226-8056-C043BD62874A@bell.net>
@ 2016-01-12 1:50 ` John David Anglin
0 siblings, 0 replies; 2+ messages in thread
From: John David Anglin @ 2016-01-12 1:50 UTC (permalink / raw)
To: John David Anglin; +Cc: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 1504 bytes --]
On 2015-12-18, at 9:05 PM, John David Anglin wrote:
> On 2015-12-09, at 8:00 PM, John David Anglin wrote:
>
>> The attached fixes an ICE building gridengine. The problem is we are asked to do an HImode reload
>> for a floating pointing register. However, we can only do 32 and 64-bit loads and stores to/from floating
>> point registers.
>>
>> The problem is resolved by not checking that the mode requested is consistent with the modes of the
>> input and output operands.
>>
>> Tested on hppa-unknown-linux-gnu, hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11. Committed
>> to trunk and active branches.
>
>
> Sadly, this change broke the gcc build on hppa1.X systems. The default scheduling for these systems allows
> pre and post increment patterns. The previous change copied a POST_INC address to a general register.
> This is not supported.
>
> The attached revision now only reloads REG+CONST_INT addresses and leaves all other forms as is.
>
> Tested on hppa1.1-hp-hpux10.20, hppa2.0w-hp-hpux11.11, hppa64-hp-hpux11.11 and hppa-unknown-linux-gnu.
And yet another regression related to this change, we need to deal with cases where reload throws us
an unsupported memory address form. This fixes an ICE compiling cs_base.c in the code-saturne package.
Tested on hppa1.1-hp-hpux10.20, hppa2.0w-hp-hpux11.11, hppa64-hp-hpux11.11 and hppa-unknown-linux-gnu.
Committed to trunk, gcc-5 and gcc-4.9.
Dave
--
John David Anglin dave.anglin@bell.net
[-- Attachment #2: pa.c.d.1.txt --]
[-- Type: text/plain, Size: 5470 bytes --]
2016-01-11 John David Anglin <danglin@gcc.gnu.org>
* config/pa/pa.c (pa_emit_move_sequence): Handle floating point
reloads for other unsupported memory operands.
Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c (revision 232130)
+++ config/pa/pa.c (working copy)
@@ -1681,7 +1681,8 @@
/* Handle secondary reloads for loads/stores of FP registers from
REG+D addresses where D does not fit in 5 or 14 bits, including
- (subreg (mem (addr))) cases. */
+ (subreg (mem (addr))) cases, and reloads for other unsupported
+ memory operands. */
if (scratch_reg
&& FP_REG_P (operand0)
&& (MEM_P (operand1)
@@ -1693,30 +1694,43 @@
if (GET_CODE (op1) == SUBREG)
op1 = XEXP (op1, 0);
- if (reg_plus_base_memory_operand (op1, GET_MODE (op1))
- && !(TARGET_PA_20
- && !TARGET_ELF32
- && INT_14_BITS (XEXP (XEXP (op1, 0), 1)))
- && !INT_5_BITS (XEXP (XEXP (op1, 0), 1)))
+ if (reg_plus_base_memory_operand (op1, GET_MODE (op1)))
{
- /* SCRATCH_REG will hold an address and maybe the actual data.
- We want it in WORD_MODE regardless of what mode it was
- originally given to us. */
- scratch_reg = force_mode (word_mode, scratch_reg);
+ if (!(TARGET_PA_20
+ && !TARGET_ELF32
+ && INT_14_BITS (XEXP (XEXP (op1, 0), 1)))
+ && !INT_5_BITS (XEXP (XEXP (op1, 0), 1)))
+ {
+ /* SCRATCH_REG will hold an address and maybe the actual data.
+ We want it in WORD_MODE regardless of what mode it was
+ originally given to us. */
+ scratch_reg = force_mode (word_mode, scratch_reg);
- /* D might not fit in 14 bits either; for such cases load D into
- scratch reg. */
- if (!INT_14_BITS (XEXP (XEXP (op1, 0), 1)))
- {
- emit_move_insn (scratch_reg, XEXP (XEXP (op1, 0), 1));
- emit_move_insn (scratch_reg,
- gen_rtx_fmt_ee (GET_CODE (XEXP (op1, 0)),
- Pmode,
- XEXP (XEXP (op1, 0), 0),
- scratch_reg));
+ /* D might not fit in 14 bits either; for such cases load D
+ into scratch reg. */
+ if (!INT_14_BITS (XEXP (XEXP (op1, 0), 1)))
+ {
+ emit_move_insn (scratch_reg, XEXP (XEXP (op1, 0), 1));
+ emit_move_insn (scratch_reg,
+ gen_rtx_fmt_ee (GET_CODE (XEXP (op1, 0)),
+ Pmode,
+ XEXP (XEXP (op1, 0), 0),
+ scratch_reg));
+ }
+ else
+ emit_move_insn (scratch_reg, XEXP (op1, 0));
+ emit_insn (gen_rtx_SET (operand0,
+ replace_equiv_address (op1, scratch_reg)));
+ return 1;
}
- else
- emit_move_insn (scratch_reg, XEXP (op1, 0));
+ }
+ else if ((!INT14_OK_STRICT && symbolic_memory_operand (op1, VOIDmode))
+ || IS_LO_SUM_DLT_ADDR_P (XEXP (op1, 0))
+ || IS_INDEX_ADDR_P (XEXP (op1, 0)))
+ {
+ /* Load memory address into SCRATCH_REG. */
+ scratch_reg = force_mode (word_mode, scratch_reg);
+ emit_move_insn (scratch_reg, XEXP (op1, 0));
emit_insn (gen_rtx_SET (operand0,
replace_equiv_address (op1, scratch_reg)));
return 1;
@@ -1733,30 +1747,43 @@
if (GET_CODE (op0) == SUBREG)
op0 = XEXP (op0, 0);
- if (reg_plus_base_memory_operand (op0, GET_MODE (op0))
- && !(TARGET_PA_20
- && !TARGET_ELF32
- && INT_14_BITS (XEXP (XEXP (op0, 0), 1)))
- && !INT_5_BITS (XEXP (XEXP (op0, 0), 1)))
+ if (reg_plus_base_memory_operand (op0, GET_MODE (op0)))
{
- /* SCRATCH_REG will hold an address and maybe the actual data.
- We want it in WORD_MODE regardless of what mode it was
- originally given to us. */
- scratch_reg = force_mode (word_mode, scratch_reg);
+ if (!(TARGET_PA_20
+ && !TARGET_ELF32
+ && INT_14_BITS (XEXP (XEXP (op0, 0), 1)))
+ && !INT_5_BITS (XEXP (XEXP (op0, 0), 1)))
+ {
+ /* SCRATCH_REG will hold an address and maybe the actual data.
+ We want it in WORD_MODE regardless of what mode it was
+ originally given to us. */
+ scratch_reg = force_mode (word_mode, scratch_reg);
- /* D might not fit in 14 bits either; for such cases load D into
- scratch reg. */
- if (!INT_14_BITS (XEXP (XEXP (op0, 0), 1)))
- {
- emit_move_insn (scratch_reg, XEXP (XEXP (op0, 0), 1));
- emit_move_insn (scratch_reg,
- gen_rtx_fmt_ee (GET_CODE (XEXP (op0, 0)),
- Pmode,
- XEXP (XEXP (op0, 0), 0),
- scratch_reg));
+ /* D might not fit in 14 bits either; for such cases load D
+ into scratch reg. */
+ if (!INT_14_BITS (XEXP (XEXP (op0, 0), 1)))
+ {
+ emit_move_insn (scratch_reg, XEXP (XEXP (op0, 0), 1));
+ emit_move_insn (scratch_reg,
+ gen_rtx_fmt_ee (GET_CODE (XEXP (op0, 0)),
+ Pmode,
+ XEXP (XEXP (op0, 0), 0),
+ scratch_reg));
+ }
+ else
+ emit_move_insn (scratch_reg, XEXP (op0, 0));
+ emit_insn (gen_rtx_SET (replace_equiv_address (op0, scratch_reg),
+ operand1));
+ return 1;
}
- else
- emit_move_insn (scratch_reg, XEXP (op0, 0));
+ }
+ else if ((!INT14_OK_STRICT && symbolic_memory_operand (op0, VOIDmode))
+ || IS_LO_SUM_DLT_ADDR_P (XEXP (op0, 0))
+ || IS_INDEX_ADDR_P (XEXP (op0, 0)))
+ {
+ /* Load memory address into SCRATCH_REG. */
+ scratch_reg = force_mode (word_mode, scratch_reg);
+ emit_move_insn (scratch_reg, XEXP (op0, 0));
emit_insn (gen_rtx_SET (replace_equiv_address (op0, scratch_reg),
operand1));
return 1;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-12 1:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10 1:00 [committed] Fix PR target/68729 John David Anglin
[not found] ` <6B7806D6-C14A-4226-8056-C043BD62874A@bell.net>
2016-01-12 1:50 ` John David Anglin
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).