From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27962 invoked by alias); 21 Jun 2005 09:55:28 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 27912 invoked by uid 22791); 21 Jun 2005 09:55:23 -0000 Received: from metal-man.the-meissners.org (HELO tiktok.the-meissners.org) (66.205.90.83) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 21 Jun 2005 09:55:23 +0000 Received: from tiktok.the-meissners.org (localhost [127.0.0.1]) by tiktok.the-meissners.org (8.12.11/8.12.11) with ESMTP id j5L9p0k8024045 for ; Tue, 21 Jun 2005 05:51:00 -0400 Received: (from meissner@localhost) by tiktok.the-meissners.org (8.12.11/8.12.11/Submit) id j5L9oxsR024044 for gcc@gcc.gnu.org; Tue, 21 Jun 2005 05:50:59 -0400 Date: Tue, 21 Jun 2005 09:55:00 -0000 From: Michael Meissner To: gcc@gcc.gnu.org Subject: Re: How to replace -O1 with corresponding -f's? Message-ID: <20050621095059.GA24035@tiktok.the-meissners.org> Mail-Followup-To: Michael Meissner , gcc@gcc.gnu.org References: <878y159mhr.fsf@osv.topcon.com> <17078.52477.408454.106678@zapata.pink> <44a7432710d6ca83042f60c9fbab58d9@physics.uc.edu> <87zmtl84eo.fsf@osv.topcon.com> <87r7ex82ur.fsf@osv.topcon.com> <87mzpl81ia.fsf@osv.topcon.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mzpl81ia.fsf@osv.topcon.com> User-Agent: Mutt/1.4.1i X-SW-Source: 2005-06/txt/msg00930.txt.bz2 On Mon, Jun 20, 2005 at 07:57:17PM +0400, Sergei Organov wrote: > Andrew Pinski writes: > > > On Jun 20, 2005, at 11:28 AM, Sergei Organov wrote: > > > > > Andrew Pinski writes: > > > > > >> On Jun 20, 2005, at 10:54 AM, Sergei Organov wrote: > > >> > > >>> so SYMBOL_FLAG_SMALL (flags 0x6 vs 0x2) is somehow being missed when -O1 > > > > >> > > >>> is turned on. Seems to be something at tree-to-RTX conversion time. > > >>> Constant folding? > > >> > > >> No, it would mean that the target says that this is not a small data. > > >> Also try it with the following code and you will see there is no > > >> difference: > > > > >> > > >> double osvf() { return 314314314; } > > > > > > There is no difference in the sense that here both -O0 and -O1 behave > > > roughly the same. So the problem is with detecting "smallness" for true > > > constants by the target, right? > > > > I think the bug is in rs6000_elf_in_small_data_p but since I have not > > debuged it yet I don't know for sure. > > > > Could you file a bug? This is a target bug. > > Yeah, and I've reported it rather long ago against gcc-3.3 (PR 9571). > That time there were 3 problems reported in the PR of which only the > first one seems to be fixed (or are the rest just re-appeared in 4.0?). > > I think PR 9571 is in fact regression with respect to 2.95.x despite the > [wrong] comments: > > ------- Additional Comment #5 From Franz Sirl 2003-06-17 15:31 [reply] ------- > > r0 is used as a pointer to sdata2, this is a bug, it should be r2. And > since only r2 is initialized in the ecrt*.o files, how can this work? > Besides that, even if you initialize r0 manually, it is practically > clobbered in about every function. It's been a long time since I've hacked the PowerPC, but IIRC the instruction set, a base register of '0' does not mean r0, but instead it means use 0 as the base address. Every place that uses a base register should use the register class 'b' (BASE_REGS) instead of 'r' (GENERAL_REGS), which excludes r0 from being considered. Under the 32-bit eABI calling sequence, you have three small data areas: The small data area that r2 points to (.sdata/.sbss). The small data area that r13 points to (.sdata2/.sbss2). The small data area centered around location 0 (ie, small positive addresses, and the most negative addresses). I don't recall that we had special sections for this, since for many embedded apps, they couldn't allocate to those addresses. For these relocations, you should use R_PPC_EMB_SDA21, which the linker will fill in both the offset and the appropriate base register into the instruction. > ------- Additional Comment #6 From Mark Mitchell 2003-07-20 00:52 [reply] ------- > > Based on Franz's comments, this bug is not really a regression at all. > I've therefore removed the regression tags. > > that I've tried to explain in my comment #7. > > I don't think I need to file yet another PR in this situation, right? > > -- > Sergei. > -- Michael Meissner email: gnu@the-meissners.org http://www.the-meissners.org