This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix for sign extension elimination
- From: Mircea Namolaru <NAMOLARU at il dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Ayal Zaks <ZAKS at il dot ibm dot com>, "H. J. Lu" <hjl at lucon dot org>, Leehod Baruch <leehod dot baruch at weizmann dot ac dot il>, Mark Mitchell <mark at codesourcery dot com>, Roger Sayle <roger at eyesopen dot com>, Richard Henderson <rth at redhat dot com>
- Date: Thu, 25 May 2006 15:43:36 +0200
- Subject: [PATCH] Fix for sign extension elimination
The see code don't support the case when the sign
extension instruction is a parallel instruction. The
patch below introduces checks for this case.
On x86, the sign extension may be indeed a parallel
instruction and this caused the problems seen on this
platform when see was enabled.
Bootstrapping and regression testing done on x86 and
PowerPC.
Mircea
2006-05-25 Mircea Namolaru <namolaru@il.ibm.com>
Leehod Baruch <leehod.baruch@weizmann.ac.il>
* see.c (see_analyze_one_def): Correct check.
(see_get_extension_data): Check if extension is parallel.
(see_get_extension_reg): Likewise.
Index: see.c
===================================================================
--- see.c (revision 114111)
+++ see.c (working copy)
@@ -674,6 +674,10 @@
rtx reg1 = NULL;
rtx reg2 = NULL;
+ /* Parallel pattern for extension not supported for the moment. */
+ if (GET_CODE (PATTERN (extension)) == PARALLEL)
+ return NULL;
+
set = single_set (extension);
if (!set)
return NULL;
@@ -719,6 +723,10 @@
if (!extension || !INSN_P (extension))
return UNKNOWN;
+ /* Parallel pattern for extension not supported for the moment. */
+ if (GET_CODE (PATTERN (extension)) == PARALLEL)
+ return NOT_RELEVANT;
+
set = single_set (extension);
if (!set)
return NOT_RELEVANT;
@@ -3462,8 +3470,8 @@
relevant. Handling this extension as relevant would make things
much
more complicated. */
next_insn = NEXT_INSN (insn);
- if (prev_insn
- && INSN_P (prev_insn)
+ if (next_insn
+ && INSN_P (next_insn)
&& (see_get_extension_data (next_insn, &next_source_mode) !=
NOT_RELEVANT))
{