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]

Re: [PATCH Atom] PR target/51287 fix (avoid unrecognized instruction error)


2011/11/24 Uros Bizjak <ubizjak@gmail.com>:
> Hello!
>
>> Here is a short patch to fix PR target/51287. Patch avoids
>> get_attr_type call for instructions which cannot be recognized.
>>
>> 2011-11-24 ?Enkovich Ilya ?<ilya.enkovich@intel.com>
>>
>> ? ? ? PR target/51287
>> ? ? ? * i386.c (distance_non_agu_define_in_bb): Fix insn attr check.
>
> This is OK for mainline and release branches.
>
> Thanks,
> Uros.
>

Thanks for the review!

Here is corresponding patch for 4.6 branch. Bootstrapped and checked
on linux-x86_64.

Thanks,
Ilya
---
2011-11-24  Enkovich Ilya  <ilya.enkovich@intel.com>

	PR target/51287
	* i386.c (distance_non_agu_define): Fix insn attr check.


diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 382fabf..6aa0297 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -16329,7 +16329,6 @@ distance_non_agu_define (unsigned int regno1,
unsigned int regno2,
   basic_block bb = BLOCK_FOR_INSN (insn);
   int distance = 0;
   df_ref *def_rec;
-  enum attr_type insn_type;

   if (insn != BB_HEAD (bb))
     {
@@ -16345,8 +16344,8 @@ distance_non_agu_define (unsigned int regno1,
unsigned int regno2,
                     && (regno1 == DF_REF_REGNO (*def_rec)
 			|| regno2 == DF_REF_REGNO (*def_rec)))
 		  {
-		    insn_type = get_attr_type (prev);
-		    if (insn_type != TYPE_LEA)
+		    if (recog_memoized (prev) < 0
+			|| get_attr_type (prev) != TYPE_LEA)
 		      goto done;
 		  }
 	    }
@@ -16385,8 +16384,8 @@ distance_non_agu_define (unsigned int regno1,
unsigned int regno2,
 			&& (regno1 == DF_REF_REGNO (*def_rec)
 			    || regno2 == DF_REF_REGNO (*def_rec)))
 		      {
-			insn_type = get_attr_type (prev);
-			if (insn_type != TYPE_LEA)
+			if (recog_memoized (prev) < 0
+			    || get_attr_type (prev) != TYPE_LEA)
 			  goto done;
 		      }
 		}


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