From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8472 invoked by alias); 16 Jul 2009 14:07:34 -0000 Received: (qmail 8423 invoked by uid 48); 16 Jul 2009 14:07:19 -0000 Date: Thu, 16 Jul 2009 14:07:00 -0000 Message-ID: <20090716140719.8422.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/40757] gcc 4.4.0 miscompiles mpfr-2.4.1 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-07/txt/msg01355.txt.bz2 ------- Comment #11 from jakub at gcc dot gnu dot org 2009-07-16 14:07 ------- You haven't mentioned what options you compiled this file with. So, assuming -O2, I see: add %i4, -1, %l5 ! n,, tmp186 sethi %hi(1073740800), %o2 !, tmp189 sll %l5, 2, %l5 ! tmp186,, D.4491 or %o2, 1023, %o2 ! tmp189,, tmp188 st %g1, [%i0+%l5] !,* D.4491 add %i4, %o2, %o2 ! n, tmp188, tmp187 mov %i0, %o0 ! a, sll %o2, 2, %o2 ! tmp187,, call memset, 0 !, mov 0, %o1 !, for this memset call, which looks correct to me. The st %g1, [%i0+%l5] line stores to %i0 a[n-1] and memset is called with memset (a, 0, (n + 0x3fffffffU) << 2); So, if this doesn't work (and you see the same), you hit a bug in Solaris memset implementation, which doesn't handle properly length with garbage in upper 32-bits, guess it could use brz,pn %o2, do_nothing or something similar, which is fine for 64-bit code, but certainly not for 32-bit code. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40757