public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <dje@sebabeach.org>
To: Dave Korn <dave.korn.cygwin@googlemail.com>
Cc: cgen@sourceware.org
Subject: Re: "make gas-test" broken?
Date: Thu, 20 Aug 2009 17:07:00 -0000	[thread overview]
Message-ID: <4A8D82E2.3090805@sebabeach.org> (raw)
In-Reply-To: <4A8B77A1.8020501@gmail.com>

Dave Korn wrote:
> Doug Evans wrote:
>   
>> btw, here's how I'm testing gas-test.
>>
>> bash$ cd src/cgen
>> bash$ guile
>> guile> (load "dev.scm")
>> guile> (load-gtest)
>> guile> (cload #:arch "../cpu/m32r.cpu") ; replace with path to your cpu
>> file of course
>> guile> (cgen-build.sh)
>> guile> (cgen-all-insn.exp)
>>
>> That should run without any errors.
>>     
>
>   Hmm.  Not for me it doesn't: cgen-build.sh give me:
>
>   
>> Backtrace:
>> In ./gas-test.scm:
>>   57:  0* [list-ref ((a0 0) (a1 1)) {3}]
>>   57:  1* [car ...
>>   57:  2* [->string ...
>>   52:  {3}* [string-append "" "" ...
>> In unknown file:
>>    ?:  4* [#<procedure #f (n)> {3}]
>> In ./gas-test.scm:
>>   51:  5  [map #<procedure #f (n)> (0 {3} 2 1 1 1 2 0)]
>>     ...
>> In ./cos.scm:
>> 1106:  6  (if class-desc.meth (apply (cdr class-desc.meth) (cons # args)) ...)
>> 1104:  7  (let* ((class-desc.meth #)) (if class-desc.meth (apply # #) ...))
>> In ./gas-test.scm:
>>  132:  8  [send #(#("object" # h-accums ...) (# #f # ...)) test-data ...]
>> In unknown file:
>>    ?:  9  [#<procedure #f (self n)> #(#("object" # accs ...) (# #f # ...)) 8]
>> In ./cos.scm:
>> 1107: 10  [apply #<procedure #f (self n)> (#(#("object" # accs ...) (# #f # ...)
>> ) 8)]
>> 1106: 11  (if class-desc.meth (apply (cdr class-desc.meth) (cons # args)) ...)
>> 1104: 12  (let* ((class-desc.meth #)) (if class-desc.meth (apply # #) ...))
>> In ./gas-test.scm:
>>  140: 13  [send #(#("object" # accs ...) (# #f # ...)) test-data ...]
>>  172: 14* [operand-test-data #(#("object" # accs ...) (# #f # ...)) 8]
>> In unknown file:
>>    ?: 15* [#<procedure #f (op)> #(#("object" # accs ...) (# #f # ...))]
>> In ./gas-test.scm:
>>  172: 16* [map #<procedure #f (op)> (#(# #) #(# #))]
>>  172: 17  (let ((test-data #) (len #)) (cond (# #) (else #)))
>>  204: 18* [build-test-set (#(# #) #(# #)) 8]
>>  202: 19* (let* (# # #) (string-map # test-set))
>>  198: 20  [string-append "\x09.text
>> " "\x09.global " ... ...
>>  285: 21* [gen-gas-test #(#("object" # mvfachi-a "mvfachi-a" ...) (# #f # #f ...
>> ))]
>> In unknown file:
>>    ?: 22* [#<procedure #f (insn)> #(#("object" # mvfachi-a ...) (# #f # ...))]
>>    ?: 23* [map #<procedure #f (insn)> (#(# #) #(# #) #(# #) #(# #) ...)]
>>    ?: 24  [map]
>> In ./utils.scm:
>>  100: 25* [apply #<primitive-generic map> (#<procedure #f (insn)> (# # # # ...))
>> ]
>>  100: 26  [apply #<primitive-procedure string-append> ...
>> In ./gas-test.scm:
>>  284: 27* [string-map #<procedure #f (insn)> (#(# #) #(# #) #(# #) #(# #) ...)]
>>  229: 28  [string-append "#/bin/sh
>> # Generate test result data for " m32r ... ...
>> In standard input:
>>    4: 29* [cgen-build.sh]
>>
>> ./gas-test.scm:57:29: In procedure list-ref in expression (list-ref test-cases n
>> ):
>> ./gas-test.scm:57:29: Argument 2 out of range: 3
>> ABORT: (out-of-range)
>> guile>
>>     

Ya, that's the problem I was referring to in 
http://sourceware.org/ml/cgen/2009-q3/msg00056.html.
I've changed method test-data of class <keyword> to flag a warning and 
compensate.  It's not ideal, technically wrong, but for right now I 
don't mind in this particular case.

>
>   And my own target seems to fall at the first hurdle:
>
>   
>> Backtrace:
>> In ./gas-test.scm:
>>  229: 0  [string-append "#/bin/sh
>> # Generate test result data for " ...]
>> In standard input:
>>    4: 1* [cgen-build.sh]
>>
>> ./gas-test.scm:229:3: In procedure string-append in expression (string-append "#
>> /bin/sh
>> # Generate test result data for " (current-arch-name) ...):
>> ./gas-test.scm:229:3: Wrong type (expecting string): foobararch
>> ABORT: (wrong-type-arg)
>> guile>
>>     
>
> ... where 'foobararch' is the name attribute from my define-arch:
>
>   
>> (define-arch
>>   (name "foobararch")
>>   (comment "Example")
>>   (default-alignment aligned)
>>   (insn-lsb0? #t)
>>   (machs foobar24)
>>   (isas foobarisa)
>> )
>>     
>
>   It doesn't make any difference whether or not I quote 'foobararch' in that
> definition.
>   

Ya, this is a change in Guile's behaviour (circa 1.4?).  string-append 
use to accept symbols, it no longer does.
Most of cgen has been updated, alas gas-test.scm wasn't - I've fixed it, 
give it another try.

>   What can I do next to find out why the m32r regeneration doesn't work for
> me?  I'm using Guile 1.8.2 (on Cygwin) and I updated cgen from CVS earlier
> today; I have no significant local diffs, just this in Makefile.am/in:
>
> -ARCHFILE = $(srcroot)/cpu/$(ARCH).cpu
> +ARCHFILE = $(word 1,$(wildcard $(srcroot)/cpu/$(ARCH).cpu
> $(srcroot)/cgen/cpu/$(ARCH).cpu))
>
> and this in mode.scm:
>
>      (dfm 'HI "16 bit int" '() 'INT 16 2 "int" "'x'" #f #f #f)
> +    (dfm 'TQI "24 bit int" '() 'INT 24 3 "int" "'x'" #f #f #f)
>      (dfm 'SI "32 bit int" '() 'INT 32 4 "int" "'x'" #f #f #f)
>      (dfm 'DI "64 bit int" '(FN-SUPPORT) 'INT 64 8 "" "'D'" #f #f #f)
>
> @@ -517,6 +518,8 @@ Define a mode, all arguments specified.
>          8 1 "unsigned int" "'x'" (mode:lookup 'QI) #f #f)
>      (dfm 'UHI "16 bit unsigned int" '() 'UINT
>          16 2 "unsigned int" "'x'" (mode:lookup 'HI) #f #f)
> +    (dfm 'UTQI "24 bit unsigned int" '() 'UINT
> +        24 3 "unsigned int" "'x'" (mode:lookup 'TQI) #f #f)
>
> ... neither of which I'd expect to cause this kind of problem.  I guess I'll
> try it on a linux vm tomorrow morning and see what happens there.
>
>     cheers,
>       DaveK
>
>   

  reply	other threads:[~2009-08-20 17:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-25 14:31 Dave Korn
2009-08-18 16:42 ` Doug Evans
2009-08-18 17:44   ` Dave Korn
2009-08-19  3:41   ` Dave Korn
2009-08-20 17:07     ` Doug Evans [this message]
2009-08-20 17:19       ` Dave Korn
2009-08-20 17:35         ` Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A8D82E2.3090805@sebabeach.org \
    --to=dje@sebabeach.org \
    --cc=cgen@sourceware.org \
    --cc=dave.korn.cygwin@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).