This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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))
        {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]