This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


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

Re: Urgent build problem with Re: patch to allow any character in keyword


Geoff Keating wrote:
> 
> Does this patch fix the problem?  I've checked that it still works
> with my port.
> 

It fixes the original problem, however, it causes a new failure with mnemonics that use ".".  For
example, insn.1 vs insn.2.  In the internal port, these two insns are distinct - they use different
operands.  The original scenario I reported differed because the operands were the same.

-- Jeff J.


> --
> - Geoffrey Keating <geoffk@geoffk.org>
> 
> ===File ~/patches/cygnus/cgen-keywordfirstspecial.patch=====
> 2001-06-19  Geoffrey Keating  <geoffk@redhat.com>
> 
>         * cgen-asm.c (cgen_parse_keyword): Allow any first character.
>         * cgen-opc.c (cgen_keyword_add): Ignore special first
>         character when building nonalpha_chars field.
> 
> Index: opcodes/cgen-asm.c
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/opcodes/cgen-asm.c,v
> retrieving revision 1.21
> diff -p -u -p -r1.21 cgen-asm.c
> --- cgen-asm.c  2001/06/14 21:00:28     1.21
> +++ cgen-asm.c  2001/06/19 07:55:33
> @@ -212,6 +212,12 @@ cgen_parse_keyword (cd, strp, keyword_ta
> 
>    p = start = *strp;
> 
> +  /* Allow any first character.  This is to make life easier for
> +     the fairly common case of suffixes, eg. 'ld.b.w', where the first
> +     character of the suffix ('.') is special.  */
> +  if (*p)
> +    ++p;
> +
>    /* Allow letters, digits, and any special characters.  */
>    while (((p - start) < (int) sizeof (buf))
>          && *p
> Index: opcodes/cgen-opc.c
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/opcodes/cgen-opc.c,v
> retrieving revision 1.28
> diff -p -u -p -r1.28 cgen-opc.c
> --- cgen-opc.c  2001/06/14 21:11:59     1.28
> +++ cgen-opc.c  2001/06/19 07:55:33
> @@ -134,7 +134,7 @@ cgen_keyword_add (kt, ke)
>    if (ke->name[0] == 0)
>      kt->null_entry = ke;
> 
> -  for (i = 0; i < strlen (ke->name); i++)
> +  for (i = 1; i < strlen (ke->name); i++)
>      if (! isalnum ((unsigned char) ke->name[i])
>         && ! strchr (kt->nonalpha_chars, ke->name[i]))
>        {
> ============================================================


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