From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27416 invoked by alias); 14 Jul 2004 13:58:30 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 27408 invoked from network); 14 Jul 2004 13:58:29 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 14 Jul 2004 13:58:29 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i6EDwTe1009541; Wed, 14 Jul 2004 09:58:29 -0400 Received: from pobox.surrey.redhat.com (pobox.surrey.redhat.com [172.16.10.17]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i6EDwS020262; Wed, 14 Jul 2004 09:58:28 -0400 Received: from [172.31.0.98] (vpnuser3.surrey.redhat.com [172.16.9.3]) by pobox.surrey.redhat.com (8.12.8/8.12.8) with ESMTP id i6EDwQhp001037; Wed, 14 Jul 2004 14:58:27 +0100 Message-ID: <40F53E22.5040400@redhat.com> Date: Wed, 14 Jul 2004 13:58:00 -0000 From: Nick Clifton User-Agent: Mozilla Thunderbird 0.7 (X11/20040615) MIME-Version: 1.0 To: Eric Botcazou CC: Kelvin Lee , "'bug-binutils@gnu.org'" , "'gcc-bugs@gcc.gnu.org'" Subject: Re: binutils-2.15 - work around for gcc optimization problem on sparc -sun-solaris2.7 References: <817522051E65D511A2740001028074C4C2F507@EX1> <200407140856.08437.ebotcazou@libertysurf.fr> <40F4F636.2030202@redhat.com> <200407141157.33412.ebotcazou@libertysurf.fr> In-Reply-To: <200407141157.33412.ebotcazou@libertysurf.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2004-07/txt/msg01703.txt.bz2 List-Id: Hi Eric, [oops - pressed send by mistake. here is the reply I meant to write...] >>Maybe... It involves arithmetic comparisons of pointers to separately >>allocated objects, which is a bit dubious in the first place. > Note that it doesn't compare pointers directly, but first performs a > substraction on pointers which is strictly specified by C99 6.5.6 ยง9: "When > two pointers are substracted, both shall point to elements of the same array > object, or one past the last element of the array object; the result is the > difference of the subscripts of the two array elements." Which is OK if the two pointers a re both pointing to elements of the same array. If however they are pointing to malloc()'ed structures for example then the semantics are not defined. So the problem with elf_sort_symbol() was that it was comparing pointers to entities that were not part of a single array... Cheers Nick