public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: egcs-970825 cross build question
@ 1997-08-28 23:24 Joel Sherrill
  1997-08-28 23:24 ` genflags / genemit inconsistency Joern Rennecke
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Sherrill @ 1997-08-28 23:24 UTC (permalink / raw)
  To: egcs

On Thu, 28 Aug 1997, Ian Lance Taylor wrote:

> I believe the egcs snapshot is arranged like a standard Cygnus
> binutils or gdb release.  You should be able to just copy the
> bfd/gas/include/newlib etc. directories in as siblings to the gcc
> directory.  You should then be able to just run configure and make.

This did the trick. I have a modified version of the one-tree script to
work with egcs now.

I can post it or email it to Doug if he is interested.

--joel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* genflags / genemit inconsistency
  1997-08-28 23:24 egcs-970825 cross build question Joel Sherrill
@ 1997-08-28 23:24 ` Joern Rennecke
  0 siblings, 0 replies; 3+ messages in thread
From: Joern Rennecke @ 1997-08-28 23:24 UTC (permalink / raw)
  To: egcs

For patterns like this one:

(define_expand "casesi_jump"
  [(parallel [(set (pc) (match_operand:SI 0 "register_operand" "r"))
              (use (label_ref (match_operand 2 "" "")))])]

genflags generates prototypes that don't match the function definition
that genemit creates: the function definition for this example has three
arguments, while the prototype has only two.

Here is a fix:

Thu Aug 28 23:09:53 1997  J"orn Rennecke <amylaar@cygnus.co.uk>

	* genflags.c (max_operand): New function.
	(num_operands): Deleted.
	(gen_proto): Agree with genemit on number of arguments.

*** genflags.c-970803	Wed Oct  9 12:25:42 1996
--- genflags.c	Thu Aug 28 23:09:53 1997
*************** static struct obstack call_obstack, norm
*** 49,90 ****
  /* Max size of names encountered.  */
  static int max_id_len;
  
- /* Count the number of match_operand's found.  */
- 
  static int
! num_operands (x)
       rtx x;
  {
!   int count = 0;
!   int i, j;
!   enum rtx_code code = GET_CODE (x);
!   char *format_ptr = GET_RTX_FORMAT (code);
  
    if (code == MATCH_OPERAND)
!     return 1;
  
    if (code == MATCH_OPERATOR || code == MATCH_PARALLEL)
!     count++;
  
!   for (i = 0; i < GET_RTX_LENGTH (code); i++)
      {
!       switch (*format_ptr++)
  	{
! 	case 'u':
! 	case 'e':
! 	  count += num_operands (XEXP (x, i));
! 	  break;
! 
! 	case 'E':
! 	  if (XVEC (x, i) != NULL)
! 	    for (j = 0; j < XVECLEN (x, i); j++)
! 	      count += num_operands (XVECEXP (x, i, j));
! 
! 	  break;
  	}
      }
! 
!   return count;
  }
  
  /* Print out prototype information for a function.  */
--- 49,89 ----
  /* Max size of names encountered.  */
  static int max_id_len;
  
  static int
! max_operand (x)
       rtx x;
  {
!   register RTX_CODE code;
!   register int i;
!   register int len;
!   register char *fmt;
!   int max_opno = -1;
! 
!   if (x == 0)
!     return;
! 
!   code = GET_CODE (x);
  
    if (code == MATCH_OPERAND)
!     return XINT (x, 0);
  
    if (code == MATCH_OPERATOR || code == MATCH_PARALLEL)
!     max_opno = XINT (x, 0);
  
!   fmt = GET_RTX_FORMAT (code);
!   len = GET_RTX_LENGTH (code);
!   for (i = 0; i < len; i++)
      {
!       if (fmt[i] == 'e' || fmt[i] == 'u')
! 	max_opno = MAX (max_opno, max_operand (XEXP (x, i)));
!       else if (fmt[i] == 'E')
  	{
! 	  int j;
! 	  for (j = 0; j < XVECLEN (x, i); j++)
! 	    max_opno = MAX (max_opno, max_operand (XVECEXP (x, i, j)));
  	}
      }
!   return max_opno;
  }
  
  /* Print out prototype information for a function.  */
*************** static void
*** 93,99 ****
  gen_proto (insn)
       rtx insn;
  {
!   int num = num_operands (insn);
    printf ("extern rtx gen_%-*s PROTO((", max_id_len, XSTR (insn, 0));
  
    if (num == 0)
--- 92,98 ----
  gen_proto (insn)
       rtx insn;
  {
!   int num = max_operand (insn) + 1;
    printf ("extern rtx gen_%-*s PROTO((", max_id_len, XSTR (insn, 0));
  
    if (num == 0)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: genflags / genemit inconsistency
  1997-08-29 13:47 g77 problem in egcs-ss-970828 Toon Moene
@ 1997-08-29 15:18 ` Jeffrey A Law
  0 siblings, 0 replies; 3+ messages in thread
From: Jeffrey A Law @ 1997-08-29 15:18 UTC (permalink / raw)
  To: egcs

  In message you write:
  > For patterns like this one:
  > 
  > (define_expand "casesi_jump"
  >   [(parallel [(set (pc) (match_operand:SI 0 "register_operand" "r"))
  >               (use (label_ref (match_operand 2 "" "")))])]
  > 
  > genflags generates prototypes that don't match the function definition
  > that genemit creates: the function definition for this example has three
  > arguments, while the prototype has only two.
Why not just fix the pattern?  Seems to me this patch caters to
broken machine descriptions that we should instead fix.

jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-08-29 15:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-28 23:24 egcs-970825 cross build question Joel Sherrill
1997-08-28 23:24 ` genflags / genemit inconsistency Joern Rennecke
1997-08-29 13:47 g77 problem in egcs-ss-970828 Toon Moene
1997-08-29 15:18 ` genflags / genemit inconsistency Jeffrey A Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).