From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by sourceware.org (Postfix) with ESMTPS id 546B03858D20; Thu, 28 Sep 2023 06:27:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 546B03858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5046bf37daeso11022724e87.1; Wed, 27 Sep 2023 23:27:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695882478; x=1696487278; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QdAU/19ckseVvNsfSxf4Xo5kHeoYCNAYaZHXe0pdlzE=; b=ezs8/333hzkn5cDCsMx6Aq7Jx3gzfIggrXVAmTMGuYEdsAXJtfijo6dJ37Bg+UDGMt eBUkP1SV1DHCbYJcZ/95P7eyLsQbMIrZ7Wk0jghfDGdl/YnSyP0/ZZGGCt0hvPQnC+O/ FoeHU8Vpb4WB/75HZQoTabZS4CZWIITTaPSZbSw/DLI5PSuk4e+6p8uUZ8mN3nRQjciU z4WxpbZh1R3BKLdgnft8EGtHFbywnRyASjulhJ6E/0HW9HMZ71BTKuKusscN5F52uXTk YXMQOczkKpsSBea1CH8aS/IScoLuO7n+h+N6KHAB0xS3GmQuRWj61+1HLlPvT1O0VEy/ EgAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695882478; x=1696487278; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QdAU/19ckseVvNsfSxf4Xo5kHeoYCNAYaZHXe0pdlzE=; b=Gcaz37B+5JUYvtkz4m7s9y1FyzbrWde08FGFOod7l7+U8xuTuTn+DJEXve/l2Ed6j5 fKSWAcNpjH5ARon5FqJuc1ltBwGoDIgKAhDs3gMHu7YRWDJ0YMmFp2+Nf8Ru3JtRryWI JyLPyx6OEu3c+0uGYP3z/SE0tYeYjs7QLfs1d4mzcXfWRYt1PMoT7SFrONdEDZO1RKMz +E4zcC7BurBRW6L5GM5UgeRKBD68FX+jiTFeRyrV8iw1b6y43fnbXZgYknq/TwP0FStC hVATTqVkhOhnwtgZzRwM0JPZKqgnwew3GvJbhQFHrm9F8EQ2MTBCyQzCDhS4e1AZyncN xqYA== X-Gm-Message-State: AOJu0YwNdomgsp89lYno05/TGz6Cxu6ovZ6D/4863rjCrJr4IO1AL4mg ahoBBByVpEFjWVf3J6q5X+vPxCVZYanrYFloGno= X-Google-Smtp-Source: AGHT+IEJI4KuTG8a7j4vcxZKCF8pCydz2CvB/RbZGvp6kilSA8kznmI0JjqTJVVbuB4ylq8NmvV8GZ17jg0JKoCeD4U= X-Received: by 2002:ac2:4f0b:0:b0:500:953b:d112 with SMTP id k11-20020ac24f0b000000b00500953bd112mr264415lfr.27.1695882477454; Wed, 27 Sep 2023 23:27:57 -0700 (PDT) MIME-Version: 1.0 References: <9e347fa4-1940-46c6-a5c9-899cf5a7ae85@moene.org> In-Reply-To: From: Richard Biener Date: Thu, 28 Sep 2023 08:25:32 +0200 Message-ID: Subject: Re: Test with an lto-build of libgfortran. To: Jeff Law Cc: Toon Moene , gcc mailing list , gfortran Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Sep 27, 2023 at 11:48=E2=80=AFPM Jeff Law via Fortran wrote: > > > > On 9/27/23 12:21, Toon Moene wrote: > > > > > The lto-ing of libgfortran did succeed, because I did get a new warning= : > > > > gfortran -O3 -flto -flto-partition=3Dnone -static -o xlintstrfz zchkrf= p.o > > zdrvrfp.o zdrvrf1.o zdrvrf2.o zdrvrf3.o zdrvrf4.o zerrrfp.o zlatb4.o > > zlaipd.o zlarhs.o zsbmv.o zget04.o zpot01.o zpot03.o zpot02.o chkxer.o > > xerbla.o alaerh.o aladhd.o alahd.o alasvm.o ../../libtmglib.a > > ../../liblapack.a ../../librefblas.a > > In function 'xtoa_big', > > inlined from 'write_z' at > > /home/toon/compilers/gcc/libgfortran/io/write.c:1296:11, > > inlined from 'formatted_transfer_scalar_write' at > > /home/toon/compilers/gcc/libgfortran/io/transfer.c:2136:4: > > /home/toon/compilers/gcc/libgfortran/io/write.c:1222:6: warning: writin= g > > 1 byte into a region of size 0 [-Wstringop-overflow=3D] > > 1222 | *q =3D '\0'; > > | ^ > > /home/toon/compilers/gcc/libgfortran/io/write.c: In function > > 'formatted_transfer_scalar_write': > > /home/toon/compilers/gcc/libgfortran/io/write.c:1291:8: note: at offset > > [34, 4294967294] into destination object 'itoa_buf' of size 33 > > 1291 | char itoa_buf[GFC_XTOA_BUF_SIZE]; > > | ^ > > > > which was (of course) not given with a non-lto libgfortran. > Yea. This certainly can happen with LTO. These warnings would > definitely be something worth investigating. > > Essentially the inlining enabled by LTO can expose a different set of > diagnostics. This particular place in libgfortran has /* write_z, which calls xtoa_big, is called from transfer.c, formatted_transfer_scalar_write. There it is passed the kind as argument, which means a maximum of 16. The buffer is large enough, but the compiler does not know that, so shut up the warning here. */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstringop-overflow" *q =3D '\0'; #pragma GCC diagnostic pop so obviously the #pragma doesn't survive through LTO. Somehow I think this is a known bug, but maybe I misremember (I think we are not streaming any of the ad-hoc location parts). Richard. > > Jeff