public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Craig Rodrigues <rodrigc@mediaone.net> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c/5448: gcc emits internal error (unrecognized insn) Date: Mon, 21 Jan 2002 22:46:00 -0000 [thread overview] Message-ID: <20020122064603.21015.qmail@sources.redhat.com> (raw) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 2216 bytes --] The following reply was made to PR c/5448; it has been noted by GNATS. From: Craig Rodrigues <rodrigc@mediaone.net> 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 <ojolly@caramail.com> ----- Delivered-To: rodrigc@gcc.gnu.org Posted-Date: Tue, 22 Jan 2002 07:24:29 +0100 (MET) From: Olivier Jolly <ojolly@caramail.com> 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 -----
next reply other threads:[~2002-01-22 6:46 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-01-21 22:46 Craig Rodrigues [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-01-21 16:54 rodrigc 2002-01-21 14:46 ojolly
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=20020122064603.21015.qmail@sources.redhat.com \ --to=rodrigc@mediaone.net \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@gcc.gnu.org \ /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: linkBe 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).