From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 3C1E63858415; Mon, 18 Oct 2021 09:52:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3C1E63858415 Received: by mail-ed1-x52b.google.com with SMTP id w19so68467960edd.2; Mon, 18 Oct 2021 02:52:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=LJaP6oQdJJu00B9D3ze+kGMtfQELHMtqOsx4z9D97j8=; b=T2ShXNfBkjLIzL9nn8xgeq0h5exvhvjdSyfnFaYIRiYNscSlI51iH0+JccDocK4SzY gLS4VYv+IxqQDE6QT+gwZyFDKa0yW8DmOfh9xYqqRe/SfE4ennMK63xvdHhGWL+ZxlXV tYRW/Uob+fJ7nUg4pWla7DBJSHFxv52726MTU3Q2cfPtTD86yKRaX/BbXGG3BlMiGgEG AKXuxYfKv5vbNRzcnzp4/3nIn7JDSvQEcgmNZ2UDToYwGWoVkQp6DhUibotjsl9r37ii MUHyfndQe193XmDUKk7aoZieCMpgGjzf8iiRwcDOUepiKCR/PpWMZT4iwBDpYOYkBOW4 Wl3w== X-Gm-Message-State: AOAM533nEUv8oJRwIx90B+rDGYwjDfSdN0KFfrE7xarJGu4/eXezZ4d2 /+C/BlSmd9NYTg7YowZDWHMjOcf16tpmmL0WTF5eMxAr X-Google-Smtp-Source: ABdhPJxKQ/t6aYSSfb08lTO7GX1c1EpwGHOga6da72uEvhh3DUeVhI28JBaDNEdv6h3UIG5UmMkmOBXsFwQqWJaZyU8= X-Received: by 2002:a05:6402:14c8:: with SMTP id f8mr2198978edx.251.1634550729153; Mon, 18 Oct 2021 02:52:09 -0700 (PDT) MIME-Version: 1.0 References: <20211016161130.731AF286470F@gskx-2.sc.intel.com> <20211016182354.GE64164@kam.mff.cuni.cz> In-Reply-To: <20211016182354.GE64164@kam.mff.cuni.cz> From: Richard Biener Date: Mon, 18 Oct 2021 11:51:58 +0200 Message-ID: Subject: Re: [r12-4457 Regression] FAIL: gfortran.dg/deferred_type_param_6.f90 -Os execution test on Linux/x86_64 To: Jan Hubicka , "fortran@gcc.gnu.org" Cc: "sunil.k.pandey" , gcc-regression@gcc.gnu.org, GCC Patches , Tobias Burnus Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-regression@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-regression mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Oct 2021 09:52:11 -0000 On Sat, Oct 16, 2021 at 8:24 PM Jan Hubicka via Gcc-patches wrote: > > Hi, > > > > FAIL: gfortran.dg/deferred_type_param_6.f90 -O1 execution test > > FAIL: gfortran.dg/deferred_type_param_6.f90 -Os execution test > Sorry for the breakage. This time it seems like bug in Fortran FE > which was previously latent: > > __attribute__((fn spec (". . R "))) > void subfunc (character(kind=3D1)[1:..__result] * & __result, integer(kin= d=3D8) * .__result) > { > # PT =3D nonlocal > character(kind=3D1)[1:..__result] * & __result_3(D) =3D __result; > # PT =3D nonlocal null > integer(kind=3D8) * .__result_5(D) =3D .__result; > integer(kind=3D4) _1; > > [local count: 1073741824]: > *__result_3(D) =3D &fifec; > # USE =3D nonlocal escaped { D.4230 } (nonlocal, escaped) > _1 =3D _gfortran_compare_string (5, &fifec, 5, &"FIVEC"[1]{lb: 1 sz: 1}= ); > if (_1 !=3D 0) > goto ; [0.04%] > else > goto ; [99.96%] > > [local count: 429496]: > # USE =3D nonlocal escaped null > # CLB =3D nonlocal escaped null > _gfortran_stop_numeric (10, 0); > > [local count: 1073312329]: > *.__result_5(D) =3D 5; > return; > } > > The fnspec ". . R " specifies that .__result is readonly however we > have: > *.__result_5(D) =3D 5; > > I am not sure I understand fortran FE well enough to figure out why > it is set so. The function is declared as: > > function subfunc() result(res) > character(len=3D:), pointer :: res > res =3D> fifec > if (len(res) /=3D 5) STOP 9 > if (res /=3D "FIVEC") STOP 10 > end function subfunc > > and we indeed optimize load of the result: > - # USE =3D nonlocal escaped { D.4252 D.4254 } (nonlocal, escaped) > - # CLB =3D nonlocal escaped { D.4254 } (escaped) > + # USE =3D nonlocal escaped > + # CLB =3D { D.4254 } > subfunc (&pstr.5, &slen.4); > - .s2_34 =3D slen.4; > - # PT =3D nonlocal escaped null { D.4254 } (escaped) > - s2_35 =3D pstr.5; > pstr.5 =3D{v} {CLOBBER}; > > and I think tat is what breaks the testcase (I also verified that > ignoring the fnspec 'R' fixes it). The FE code adding the fnspec probably fails to consider the separately passed length of the string result? Can you open a bugreport please? Richard. > Honza > > > > with GCC configured with > > > > ../../gcc/configure --prefix=3D/local/skpandey/gccwork/toolwork/gcc-bis= ect-master/master/r12-4457/usr --enable-clocale=3Dgnu --with-system-zlib --= with-demangler-in-ld --with-fpmath=3Dsse --enable-languages=3Dc,c++,fortran= --enable-cet --without-isl --enable-libmpx x86_64-linux --disable-bootstra= p > > > > To reproduce: > > > > $ cd {build_dir}/gcc && make check RUNTESTFLAGS=3D"dg.exp=3Dgfortran.dg= /deferred_type_param_6.f90 --target_board=3D'unix{-m32}'" > > $ cd {build_dir}/gcc && make check RUNTESTFLAGS=3D"dg.exp=3Dgfortran.dg= /deferred_type_param_6.f90 --target_board=3D'unix{-m32\ -march=3Dcascadelak= e}'" > > $ cd {build_dir}/gcc && make check RUNTESTFLAGS=3D"dg.exp=3Dgfortran.dg= /deferred_type_param_6.f90 --target_board=3D'unix{-m64}'" > > $ cd {build_dir}/gcc && make check RUNTESTFLAGS=3D"dg.exp=3Dgfortran.dg= /deferred_type_param_6.f90 --target_board=3D'unix{-m64\ -march=3Dcascadelak= e}'" > > > > (Please do not reply to this email, for question about this report, con= tact me at skpgkp2 at gmail dot com)