From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24789 invoked by alias); 7 Apr 2003 19:06:05 -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 24659 invoked by uid 71); 7 Apr 2003 19:06:02 -0000 Date: Mon, 07 Apr 2003 19:06:00 -0000 Message-ID: <20030407190602.24623.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Michael Ubell Subject: Re: c/10339: strncmp generates imPure code Reply-To: Michael Ubell X-SW-Source: 2003-04/txt/msg00296.txt.bz2 List-Id: The following reply was made to PR optimization/10339; it has been noted by GNATS. From: Michael Ubell To: Falk Hueffner Cc: Wolfgang Bangerth , gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c/10339: strncmp generates imPure code Date: Mon, 07 Apr 2003 12:05:31 -0700 > I suspect the extra byte read is actually not relevant for the result, > and because of alignment, gcc knows the second problem cannot occur, > but I have neither a SPARC nor SPARC knowledge to test that. > Actually if you make the compare string longer you can get it to look at an arbitrary number of bytes passed the allocated part, so I think this could fault if you set it up right. Also in the original problem, the first argument was not allocated locally so the compiler would have no idea how big or what its alignment was. (In fact it was in a loop comparing strings from an array.)