From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 5402D3858D38; Thu, 28 Sep 2023 06:29:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5402D3858D38 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-wr1-x42a.google.com with SMTP id ffacd0b85a97d-32320381a07so8259683f8f.0; Wed, 27 Sep 2023 23:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695882594; x=1696487394; 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=70SB5kDY43KhdZejgz21XbY+y5jCDy9elQ5zzZfYKLU=; b=jyQkr9mdh3MwTKUSJJ/4g30Rp1vfh/Bl8swXCtQV2gkpF8J0Xkju0DZrYBwo6tYXG3 PNElG4dRe/oEktPfXizgWT5QR16HadWLZCcY6XbbdITpNMXt+1TCXfucirsL7JUrJ4Bj HowSnebacaAe52ceIbjeokFNQFp+r7dzQ7RsSotnZhkcJyQmGqi+/pbndT0wVQMZaP4Q 7FJ9Jp5Y+Cxg03qxLQsIXsxEjV+dh/ZIDF6ZEB/c5wb603Ss+WgcN/MP3GyzfIY1o3uj XDpx8OGEb+hk3SGj5mfMul0d4sDQpQb3GOjmX0VKCBu+sp8kgTAqyT47U0EKYfm/vzUC dSng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695882594; x=1696487394; 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=70SB5kDY43KhdZejgz21XbY+y5jCDy9elQ5zzZfYKLU=; b=kZCPZW/DbzwzrgQVR45Qcj3Zg2JE8hmj16Pv1XpisCQfbxIm77mdfX6g/6hcjSmdQm xXH/X/zbsm+Jzz1eYSbSG+AHer1KpKTm9mdtnXyrcfsI74Oz9uxcBqQBKEPPL7yPHRBu 11RhH0etaoipahIYSHkQ35bbVFopMwV4gQpfOFTYr4hEbR5GxTpZc+q+xqp0l8zIsTAJ tUV2RfFkZQZfZcEW4esYEcR97abYo+6P1HSqLXdCjbp9isX+cRYrevYhiJG6TfBjpwDF NrxgrYGAqdfeHO4aA/l+4j+uVm914xxhhWSlq66OftV+Am57BFnJk2uyVMzVQQC1f/Vd bfLA== X-Gm-Message-State: AOJu0YwWorFyvJtSxri47ZmdV4r4fFmsDi0RblD/InwTwFIhIQXp8bGH dza9t6M5ZhnARQW9+tLYSnBbu7SuVb8zTC3ILgo= X-Google-Smtp-Source: AGHT+IGW+C87oJh8np0JR6gGsPgYq1E8owgEwxQJy1F7AuwTHWzc5VUrbcFvPNx+lZx1bqdKASyhdsMEaJoV0RkUiWk= X-Received: by 2002:adf:f4ca:0:b0:31a:dc58:cdd9 with SMTP id h10-20020adff4ca000000b0031adc58cdd9mr325716wrp.60.1695882593549; Wed, 27 Sep 2023 23:29:53 -0700 (PDT) MIME-Version: 1.0 References: <9e347fa4-1940-46c6-a5c9-899cf5a7ae85@moene.org> In-Reply-To: From: Andrew Pinski Date: Wed, 27 Sep 2023 23:29:40 -0700 Message-ID: Subject: Re: Test with an lto-build of libgfortran. To: Richard Biener Cc: Jeff Law , gcc mailing list , gfortran Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,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:28=E2=80=AFPM Richard Biener via Fortran wrote: > > 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 warni= ng: > > > > > > gfortran -O3 -flto -flto-partition=3Dnone -static -o xlintstrfz zchk= rfp.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: writ= ing > > > 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 offs= et > > > [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 streamin= g > any of the ad-hoc location parts). Yes it is a known bug. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D80922 . Thanks, Andrew > > Richard. > > > > > Jeff