Hello, Here is a short patch to fix PR target/51287. Patch avoids get_attr_type call for instructions which cannot be recognized.
Bootstrapped and checked on linux-x86_64. 252.eon also works fine with this fix on Atom. Could please someone review it? Thanks, Ilya --- 2011-11-24 Enkovich Ilya <ilya.enkov...@intel.com> PR target/51287 * i386.c (distance_non_agu_define_in_bb): Fix insn attr check. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 3436820..76b15f2 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -16457,7 +16457,6 @@ distance_non_agu_define_in_bb (unsigned int regno1, unsigned int regno2, basic_block bb = start ? BLOCK_FOR_INSN (start) : NULL; rtx prev = start; rtx next = NULL; - enum attr_type insn_type; *found = false; @@ -16470,8 +16469,8 @@ distance_non_agu_define_in_bb (unsigned int regno1, unsigned int regno2, distance = increase_distance (prev, next, distance); if (insn_defines_reg (regno1, regno2, prev)) { - insn_type = get_attr_type (prev); - if (insn_type != TYPE_LEA) + if (recog_memoized (prev) < 0 + || get_attr_type (prev) != TYPE_LEA) { *found = true; return distance;