From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26773 invoked by alias); 30 Oct 2014 14:15:58 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 26758 invoked by uid 89); 30 Oct 2014 14:15:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vc0-f175.google.com Received: from mail-vc0-f175.google.com (HELO mail-vc0-f175.google.com) (209.85.220.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 30 Oct 2014 14:15:56 +0000 Received: by mail-vc0-f175.google.com with SMTP id hy4so2606120vcb.6 for ; Thu, 30 Oct 2014 07:15:53 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.52.36.113 with SMTP id p17mr50263vdj.81.1414678553713; Thu, 30 Oct 2014 07:15:53 -0700 (PDT) Received: by 10.220.73.193 with HTTP; Thu, 30 Oct 2014 07:15:53 -0700 (PDT) In-Reply-To: References: Date: Thu, 30 Oct 2014 14:29:00 -0000 Message-ID: Subject: Re: genmatch infinite loop during bootstrap on AIX From: David Edelsohn To: Richard Biener Cc: Richard Biener , GCC Patches Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2014-10/txt/msg03209.txt.bz2 On Thu, Oct 30, 2014 at 4:51 AM, Richard Biener wrote: > On Wed, Oct 29, 2014 at 6:13 PM, David Edelsohn wrote: >> On Wed, Oct 29, 2014 at 9:24 AM, Richard Biener >> wrote: >> >>> Because only genmatch calls functions from libstdc++. Btw, why >>> would genmatch miscompile an empty function or the call to it? >> >> I tried bootstrapping with libstdc++ built without the AIX ld "-G" >> flag and that is succeeding. >> >> "-G" produces a shared object for use with SVR4-style runtime linking, >> so this version of libstdc++ no longer allows runtime function >> interposition, e.g., operator new, although it is not used frequently. >> Something about the GCC-produced tail calls is interacting badly with >> that feature. >> >> Note that this makes GCC bootstrap on AIX very fragile at the moment >> because it depends on how libstdc++ was built in previous releases. I >> can bootstrap with GCC 4.6.3 and 4.8.1 but not with 4.7.3, 4.8.0, nor >> 4.9.0. A problematic libstdc++ from earlier releases causes genmatch >> to loop in stage 1. > > I see. A bootstrap with IPA ICF disabled did not succeed but runs into > the same issue in stage2. So I wonder if the issue is latent for much > longer and genmatch just exposes it now. > > I'll see if I can remove the use of std::map from genmatch as a > workaround. I assume that this is a pervasive issue in the interaction between GCC optimizations and AIX -G linker option. Something expects the second call to point to a different implementation. I don't know if the address in the TOC (GOT) is wrong or something expects the second call to use a different TOC, but there is a circular reference. I am going to apply a patch to GCC to not build libstdc++ with -G. I also will apply it to GCC 4.9 branch. I was hoping that it could be included in GCC 4.9.2, but I needed to test it thoroughly and Jakub beat me with the release. - David