From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21032 invoked by alias); 22 Jan 2002 06:46:07 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 21016 invoked by uid 71); 22 Jan 2002 06:46:04 -0000 Date: Mon, 21 Jan 2002 22:46:00 -0000 Message-ID: <20020122064603.21015.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Craig Rodrigues Subject: Re: c/5448: gcc emits internal error (unrecognized insn) Reply-To: Craig Rodrigues X-SW-Source: 2002-01/txt/msg00755.txt.bz2 List-Id: The following reply was made to PR c/5448; it has been noted by GNATS. From: Craig Rodrigues To: gcc-gnats@gcc.gnu.org Cc: gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Subject: Re: c/5448: gcc emits internal error (unrecognized insn) Date: Tue, 22 Jan 2002 01:37:38 -0500 ----- Forwarded message from Olivier Jolly ----- Delivered-To: rodrigc@gcc.gnu.org Posted-Date: Tue, 22 Jan 2002 07:24:29 +0100 (MET) From: Olivier Jolly To: rodrigc@gcc.gnu.org X-Mailer: Caramail - www.caramail.com X-Originating-IP: [80.11.125.56] Subject: Re[1] c/5448: gcc emits internal error (unrecognized insn) Date: Tue, 22 Jan 2002 07:24:29 GMT+1 > Synopsis: gcc emits internal error (unrecognized insn) > > State-Changed-From-To: open->analyzed > State-Changed-By: rodrigc > State-Changed-When: Mon Jan 21 16:54:04 2002 > State-Changed-Why: > Crash reproduced on gcc 3.0.3 and gcc 3.1 mainline. > > The line which is causing the problem is: > > section[pWrd - sCfgFileLine - 1] = '\0'; > > where the variables are: > char *section; > char *pWrd; > char sCfgFileLine[8192]; > > What exactly are you trying to do in this piece of > code? The compiler should not crash, but this code > looks suspect. thanks for your quick reply, this piece of code is code to recognize section declaration. It follows the following regex : ^\[(.*)\].*$ pWrd is normally a pointer toward the ']' character inside the sCfgFileLine buffer. So, pWrd - sCfgFileLine - 1 should represent the actual size of the inner string, enclosed with brackets since it's the difference of 2 char*. The problematic line then should simply put a '\0' at the end of the freshly (re) allocated section variable. note: the very same expression is used on the line above without problem ( strncpy( section, sCfgFileLine + 1, pWrd - sCfgFileLine - 1);) it's as array index that it causes problem. I hope it will help making gcc even greater. Thanks for all and good luck regards Olivier Jolly ______________________________________________________ BoƮte aux lettres - Caramail - http://www.caramail.com ----- End forwarded message -----