From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47407 invoked by alias); 15 Aug 2018 21:14:54 -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 47396 invoked by uid 89); 15 Aug 2018 21:14:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=BAYES_00,LOTS_OF_MONEY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Aug 2018 21:14:52 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CA0280F8D; Wed, 15 Aug 2018 21:14:51 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-6.rdu2.redhat.com [10.10.112.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3482C2CFA2; Wed, 15 Aug 2018 21:14:44 +0000 (UTC) Subject: Re: [PATCH] convert braced initializers to strings (PR 71625) To: Martin Sebor , Joseph Myers Cc: James Greenhalgh , Jason Merrill , Gcc Patch List , nd References: <04935db6-1c50-90c4-9b25-b6e5ce4f446b@gmail.com> <411acfaa-7015-bdf4-43c1-84096009817c@gmail.com> From: Jeff Law Openpgp: preference=signencrypt Message-ID: <747782e0-9ca0-e4e9-6f5c-969fc21dc4dd@redhat.com> Date: Wed, 15 Aug 2018 21:14:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <411acfaa-7015-bdf4-43c1-84096009817c@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00922.txt.bz2 On 08/15/2018 03:02 PM, Martin Sebor wrote: > On 08/15/2018 06:07 AM, Joseph Myers wrote: >> On Tue, 14 Aug 2018, Martin Sebor wrote: >> >>>> This is with Bison 3.0.4, should the version used to produce >>>> intl/plural.c >>>> prove relevant. >>> >>> Can you send me the translation unit and the options it was compiled >>> with that triggered the errors? >> >> I've attached plural.i.  The error is a static link error linking sln, >> but >> maybe comparing results of compiling plural.i before and after the >> changes >> may be enlightening (unless it's actually a difference in code elsewhere >> in glibc causing a link error reported in plural.o). >> >> Compiled with: >> >> alpha-glibc-linux-gnu-gcc >> /scratch/jmyers/glibc/many9/build/compilers/alpha-linux-gnu/glibc/alpha-linux-gnu/intl/plural.c >> >> -c -std=gnu11 -fgnu89-inline  -O2 -Wall -Werror -Wundef -Wwrite-strings >> -fmerge-all-constants -fno-stack-protector -frounding-math -g >> -Wstrict-prototypes -Wold-style-definition -fno-math-errno >> -mlong-double-128 -mieee -mfp-rounding-mode=d     >> -ftls-model=initial-exec >> -I../include >> -I/scratch/jmyers/glibc/many9/build/compilers/alpha-linux-gnu/glibc/alpha-linux-gnu/intl >> >> -I/scratch/jmyers/glibc/many9/build/compilers/alpha-linux-gnu/glibc/alpha-linux-gnu >> >> -I../sysdeps/unix/sysv/linux/alpha/alpha >> -I../sysdeps/unix/sysv/linux/alpha/fpu  -I../sysdeps/alpha/fpu >> -I../sysdeps/unix/sysv/linux/alpha  -I../sysdeps/alpha/nptl >> -I../sysdeps/unix/sysv/linux/wordsize-64  >> -I../sysdeps/ieee754/ldbl-64-128 >> -I../sysdeps/ieee754/ldbl-opt  -I../sysdeps/unix/sysv/linux/include >> -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread >> -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv >> -I../sysdeps/unix/alpha  -I../sysdeps/unix  -I../sysdeps/posix >> -I../sysdeps/alpha  -I../sysdeps/wordsize-64 >> -I../sysdeps/ieee754/ldbl-128  -I../sysdeps/ieee754/dbl-64/wordsize-64 >> -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32 >> -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I. >> -D_LIBC_REENTRANT -include >> /scratch/jmyers/glibc/many9/build/compilers/alpha-linux-gnu/glibc/alpha-linux-gnu/libc-modules.h >> >> -DMODULE_NAME=libc -include ../include/libc-symbols.h >> -DTOP_NAMESPACE=glibc -D'LOCALEDIR="/usr/share/locale"' >> -D'LOCALE_ALIAS_PATH="/usr/share/locale"' -o >> /scratch/jmyers/glibc/many9/build/compilers/alpha-linux-gnu/glibc/alpha-linux-gnu/intl/plural.o >> >> -MD -MP -MF >> /scratch/jmyers/glibc/many9/build/compilers/alpha-linux-gnu/glibc/alpha-linux-gnu/intl/plural.o.dt >> >> -MT >> /scratch/jmyers/glibc/many9/build/compilers/alpha-linux-gnu/glibc/alpha-linux-gnu/intl/plural.o >> >> > > Thanks.  I don't see anything obviously wrong but I don't know > much about Alpha assembly.  Attached are the two .s files, with > (plural-new.s) and without (plural-old.s) the array-to-string > transformation. > > There are also only a handful of transformed arrays in the file > and they all look reasonable to me (see the attachment named > plural-array-to-string.txt).  The only arrays in the .sdata > section are yydefgoto and yypgoto, both before and after. > They are each just 3 bytes in size. > > There is one unusual difference in the loads of one of them in > the assembly emitted by GCC for __gettextparse. > > Before: > >     ldah $22,yypgoto($29)                !gprelhigh >     ... >     lda $2,yypgoto($22)                !gprellow > > After: > >     ldah $2,yypgoto+2305843009213693936($29)    !gprelhigh >     ... >     lda $2,yypgoto+2305843009213693936($2)        !gprellow > > I don't know if it's significant -- the lda instruction uses > just the least significant 16 bits of the constant displacement, > shifted left by 16.  I don't see any obviously bogus constants > in the disassembly produced by objdump. > > I'll need some help from someone who knows more about Alpha > to understand what's going on. I wonder if the change to how we set up the initializers is ultimately changing the section those go into and ultimately causing an overflow of the .sdata section. Jeff > > Martin