From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12383 invoked by alias); 18 Dec 2002 02:03:06 -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 12368 invoked from network); 18 Dec 2002 02:03:04 -0000 Received: from unknown (HELO fenway.scenix.com) (4.20.168.10) by 209.249.29.67 with SMTP; 18 Dec 2002 02:03:04 -0000 Received: from nkelseyxp (NKELSEY-XP [192.168.1.246]) by fenway.scenix.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2656.59) id Y3L4BM77; Tue, 17 Dec 2002 18:01:43 -0800 Message-ID: <0ea301c2a639$92e9fcb0$f601a8c0@nkelseyxp> Reply-To: "Nick Kelsey" From: "Nick Kelsey" To: Subject: Problem with keyword parsing for gas Date: Tue, 17 Dec 2002 18:03:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-SW-Source: 2002-q4/txt/msg00104.txt.bz2 Hi guys, A change was made to cgen in mid 2001 that affects keyword parsing.... opcodes/cgen-asm.c (early 2001): cgen_parse_keyword: /* Now allow letters, digits, and _. */ while (((p - start) < (int) sizeof (buf)) && (isalnum ((unsigned char) *p) || *p == '_')) ++p; This would correctly treat _temp as a non keyword. The new code reads as follows: /* Allow letters, digits, and any special characters. */ while (((p - start) < (int) sizeof (buf)) && *p && (ISALNUM (*p) || strchr (keyword_table->nonalpha_chars, *p))) ++p; This does not treat an underscore as a symbol character and gas barfs on a symbol that starts underscore. Possible solutions that spring to mind... Add an explicit check for underscore to the while statement, or add an underscore to nonalpha_chars. Adding an underscore to nonalpha_chars is easy as it is global and pre-initialized... CGEN_KEYWORD xxx_cgen_opval_register_names = { & xxx_cgen_opval_register_names_entries[0], 121, 0, 0, 0, 0, "_" }; However this is generated code so there are bigger implications. I am completly open to suggestions and implications as to the best way to fix this without breaking other ports. Thanks Nick