This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Remove peephole2 optimization for floating-point stores on PA
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 Dec 2005 01:24:21 -0500 (EST)
- Subject: [committed] Remove peephole2 optimization for floating-point stores on PA
The investigation shown in PR fortran/25586 convinced me that it wasn't
safe to use the REG_POINTER flag post-reload to try to determine the
base pointer for floating-point stores on hppa*-*-hpux*. This optimization
is only safe on hppa targets that use an unsegmented memory model.
The simple fix is just to remove the optimization. At some point,
the reload issue for non-floating point stores needs to be revisited
to see if it's possible to do the optimization prior to reload.
The change fixes the failure of gfortran.dg/cray_pointers_2.f90. However,
there still appears to a problem with pointer handling in IV-OPTS.
Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11. Applied
to 3.4, 4.0, 4.1 and trunk.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2005-12-30 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR fortran/25586
* pa.md: Remove REG_POINTER check from REG+REG peephole2 floating-point
store patterns.
Index: config/pa/pa.md
===================================================================
--- config/pa/pa.md (revision 109148)
+++ config/pa/pa.md (working copy)
@@ -2421,9 +2421,9 @@
(match_operand:SI 3 "register_operand" ""))]
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
- && REG_OK_FOR_BASE_P (operands[1])
- && (TARGET_NO_SPACE_REGS
- || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_INDEX_P (operands[1])
+ && REG_OK_FOR_BASE_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:SI (plus:SI (match_dup 1) (match_dup 2)))
(match_dup 3))
@@ -2438,9 +2438,9 @@
(match_operand:SI 3 "register_operand" ""))]
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
- && REG_OK_FOR_BASE_P (operands[2])
- && (TARGET_NO_SPACE_REGS
- || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_BASE_P (operands[1])
+ && REG_OK_FOR_INDEX_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:SI (plus:SI (match_dup 2) (match_dup 1)))
(match_dup 3))
@@ -2456,9 +2456,9 @@
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
&& TARGET_64BIT
- && REG_OK_FOR_BASE_P (operands[1])
- && (TARGET_NO_SPACE_REGS
- || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_INDEX_P (operands[1])
+ && REG_OK_FOR_BASE_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:SI (plus:DI (match_dup 1) (match_dup 2)))
(match_dup 3))
@@ -2474,9 +2474,9 @@
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
&& TARGET_64BIT
- && REG_OK_FOR_BASE_P (operands[2])
- && (TARGET_NO_SPACE_REGS
- || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_BASE_P (operands[1])
+ && REG_OK_FOR_INDEX_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:SI (plus:DI (match_dup 2) (match_dup 1)))
(match_dup 3))
@@ -3948,9 +3948,9 @@
(match_operand:DF 3 "register_operand" ""))]
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
- && REG_OK_FOR_BASE_P (operands[1])
- && (TARGET_NO_SPACE_REGS
- || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_INDEX_P (operands[1])
+ && REG_OK_FOR_BASE_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:DF (plus:SI (match_dup 1) (match_dup 2)))
(match_dup 3))
@@ -3965,9 +3965,9 @@
(match_operand:DF 3 "register_operand" ""))]
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
- && REG_OK_FOR_BASE_P (operands[2])
- && (TARGET_NO_SPACE_REGS
- || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_BASE_P (operands[1])
+ && REG_OK_FOR_INDEX_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:DF (plus:SI (match_dup 2) (match_dup 1)))
(match_dup 3))
@@ -3983,9 +3983,9 @@
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
&& TARGET_64BIT
- && REG_OK_FOR_BASE_P (operands[1])
- && (TARGET_NO_SPACE_REGS
- || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_INDEX_P (operands[1])
+ && REG_OK_FOR_BASE_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:DF (plus:DI (match_dup 1) (match_dup 2)))
(match_dup 3))
@@ -4001,9 +4001,9 @@
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
&& TARGET_64BIT
- && REG_OK_FOR_BASE_P (operands[2])
- && (TARGET_NO_SPACE_REGS
- || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_BASE_P (operands[1])
+ && REG_OK_FOR_INDEX_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:DF (plus:DI (match_dup 2) (match_dup 1)))
(match_dup 3))
@@ -4253,9 +4253,9 @@
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
&& TARGET_64BIT
- && REG_OK_FOR_BASE_P (operands[1])
- && (TARGET_NO_SPACE_REGS
- || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_INDEX_P (operands[1])
+ && REG_OK_FOR_BASE_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:DI (plus:DI (match_dup 1) (match_dup 2)))
(match_dup 3))
@@ -4271,9 +4271,9 @@
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
&& TARGET_64BIT
- && REG_OK_FOR_BASE_P (operands[2])
- && (TARGET_NO_SPACE_REGS
- || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_BASE_P (operands[1])
+ && REG_OK_FOR_INDEX_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:DI (plus:DI (match_dup 2) (match_dup 1)))
(match_dup 3))
@@ -4486,9 +4486,9 @@
(match_operand:SF 3 "register_operand" ""))]
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
- && REG_OK_FOR_BASE_P (operands[1])
- && (TARGET_NO_SPACE_REGS
- || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_INDEX_P (operands[1])
+ && REG_OK_FOR_BASE_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:SF (plus:SI (match_dup 1) (match_dup 2)))
(match_dup 3))
@@ -4503,9 +4503,9 @@
(match_operand:SF 3 "register_operand" ""))]
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
- && REG_OK_FOR_BASE_P (operands[2])
- && (TARGET_NO_SPACE_REGS
- || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_BASE_P (operands[1])
+ && REG_OK_FOR_INDEX_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:SF (plus:SI (match_dup 2) (match_dup 1)))
(match_dup 3))
@@ -4521,9 +4521,9 @@
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
&& TARGET_64BIT
- && REG_OK_FOR_BASE_P (operands[1])
- && (TARGET_NO_SPACE_REGS
- || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_INDEX_P (operands[1])
+ && REG_OK_FOR_BASE_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:SF (plus:DI (match_dup 1) (match_dup 2)))
(match_dup 3))
@@ -4539,9 +4539,9 @@
"!TARGET_SOFT_FLOAT
&& !TARGET_DISABLE_INDEXING
&& TARGET_64BIT
- && REG_OK_FOR_BASE_P (operands[2])
- && (TARGET_NO_SPACE_REGS
- || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && TARGET_NO_SPACE_REGS
+ && REG_OK_FOR_BASE_P (operands[1])
+ && REG_OK_FOR_INDEX_P (operands[2])
&& FP_REGNO_P (REGNO (operands[3]))"
[(set (mem:SF (plus:DI (match_dup 2) (match_dup 1)))
(match_dup 3))