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 for genrecog.c bug in predicate generation


I had a very bizzare bug in that I could build a native HP-UX IA64
compiler but not a cross-compiler version.  I finally tracked it down to
a bug in compute_predicate_codes in genrecog.c where we are accessing
uninitialized memory due to using 'codes' instead of 'op0_codes' when
handing NOT.  This could affect any md file that has a NOT in a
predicate.

With this change I can build a cross-compiler and a working insn-recog.c
file again but I can't do a complete build and test due to other bugs.

Ok for checkin?

Steve Ellcey
sje@cup.hp.com


2004-09-09  Steve Ellcey  <sje@cup.hp.com>

	* genrecog.c (compute_predicate_codes): Use op0_codes
	instead of codes.
*** gcc.orig/gcc/gcc/genrecog.c	Thu Sep  9 15:09:40 2004
--- gcc/gcc/gcc/genrecog.c	Thu Sep  9 15:09:50 2004

*************** compute_predicate_codes (rtx exp, char c
*** 254,260 ****
      case NOT:
        compute_predicate_codes (XEXP (exp, 0), op0_codes);
        for (i = 0; i < NUM_RTX_CODE; i++)
! 	codes[i] = TRISTATE_NOT (codes[i]);
        break;
  
      case IF_THEN_ELSE:
--- 254,260 ----
      case NOT:
        compute_predicate_codes (XEXP (exp, 0), op0_codes);
        for (i = 0; i < NUM_RTX_CODE; i++)
! 	codes[i] = TRISTATE_NOT (op0_codes[i]);
        break;
  
      case IF_THEN_ELSE:


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