From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10155 invoked by alias); 22 Oct 2005 00:08:10 -0000 Mailing-List: contact cgen-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sources.redhat.com Received: (qmail 10143 invoked by uid 22791); 22 Oct 2005 00:08:06 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 22 Oct 2005 00:08:06 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j9M085Cq012099; Fri, 21 Oct 2005 20:08:05 -0400 Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [172.16.52.227]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j9M084V02030; Fri, 21 Oct 2005 20:08:04 -0400 Received: from greed.delorie.com (dj.cipe.redhat.com [10.0.0.222]) by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j9M084R13997; Fri, 21 Oct 2005 20:08:04 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.13.1/8.13.1) with ESMTP id j9M083iP023491; Fri, 21 Oct 2005 20:08:03 -0400 Received: (from dj@localhost) by greed.delorie.com (8.13.1/8.13.1/Submit) id j9M07wPR023488; Fri, 21 Oct 2005 20:07:58 -0400 Date: Sat, 22 Oct 2005 00:08:00 -0000 Message-Id: <200510220007.j9M07wPR023488@greed.delorie.com> From: DJ Delorie To: binutils@sources.redhat.com, cgen@sources.redhat.com Subject: [cgen] suggestion: improve error message X-SW-Source: 2005-q4/txt/msg00016.txt.bz2 If you use the wrong operand in an insn, you get a vague "assert: indx" error. This replaces it with a (hopefully) more instructive message, hopefully allowing you to *find* the error. * operand.scm (-anyof-merge-syntax): Print a more useful error message. Index: operand.scm =================================================================== RCS file: /cvs/src/src/cgen/operand.scm,v retrieving revision 1.11 diff -p -U3 -r1.11 operand.scm --- operand.scm 29 Jul 2005 18:51:24 -0000 1.11 +++ operand.scm 22 Oct 2005 00:04:39 -0000 @@ -1120,7 +1120,9 @@ (if (anyof-operand? e) (let* ((name (obj:name e)) (indx (element-lookup-index name value-names 0))) - (assert indx) + (if (not indx) + (error "Name " name " not one of " values) + ) (-anyof-syntax (list-ref values indx))) e)) syntax-elements)))