This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: genrecog changes
- To: Jeffrey A Law <law at cygnus dot com>
- Subject: Re: genrecog changes
- From: Richard Henderson <rth at cygnus dot com>
- Date: Sun, 10 Oct 1999 02:46:39 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- References: <4345.939545433@upchuck.cygnus.com>
On Sun, Oct 10, 1999 at 02:50:33AM -0600, Jeffrey A Law wrote:
> Anyway, build up a whatever-you-like-x-hppa1.1-hp-hpux10.20 cross cc1 and
> feed it this file with -O0.
>
> void __foo () {}
>
> It'll spit out an unrecognized insn message.
It's a genrecog bug that only shows up for targets that don't
define PREDICATE_CODES. Here's the fix.
You'll get a lot better code here if you do go ahead and
provide PREDICATE_CODES...
r~
* genrecog.c (add_to_sequence): Move allow_const_int test outside
known predicate block; default allow_const_int true.
(debug_decision_list): New.
Index: genrecog.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genrecog.c,v
retrieving revision 1.57
diff -c -p -d -r1.57 genrecog.c
*** genrecog.c 1999/10/08 17:10:15 1.57
--- genrecog.c 1999/10/10 09:41:15
*************** add_to_sequence (pattern, last, position
*** 402,407 ****
--- 402,408 ----
{
const char *pred_name;
RTX_CODE was_code = code;
+ int allows_const_int = 1;
if (code == MATCH_SCRATCH)
{
*************** add_to_sequence (pattern, last, position
*** 462,471 ****
allows_const_int = 1;
break;
}
-
- /* Can't enforce a mode if we allow const_int. */
- if (allows_const_int)
- mode = VOIDmode;
}
else
{
--- 463,468 ----
*************** add_to_sequence (pattern, last, position
*** 478,489 ****
#endif
}
}
! else
! {
! /* Wildcard match. Can't enforce a mode because we allow
! anything -- const_int included. */
! mode = VOIDmode;
! }
/* Accept the operand, ie. record it in `operands'. */
test = new_decision_test (DT_accept_op, &place);
--- 475,484 ----
#endif
}
}
!
! /* Can't enforce a mode if we allow const_int. */
! if (allows_const_int)
! mode = VOIDmode;
/* Accept the operand, ie. record it in `operands'. */
test = new_decision_test (DT_accept_op, &place);
*************** debug_decision (d)
*** 2416,2419 ****
--- 2411,2425 ----
struct decision *d;
{
debug_decision_0 (d, 0, 1000000);
+ }
+
+ void
+ debug_decision_list (d)
+ struct decision *d;
+ {
+ while (d)
+ {
+ debug_decision_0 (d, 0, 0);
+ d = d->next;
+ }
}