From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by sourceware.org (Postfix) with ESMTPS id CA1CA395C07B; Wed, 16 Nov 2022 20:24:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CA1CA395C07B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1668630295; bh=znBtLUpxwYeeyygpNLBhLtHEUG94Z1Rjd/G+GBIuVhA=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=CYpWKBPXPdr23KVIrAwaCr+GtDMC7sFaugGJiUGCAK9Dy09gQGRd5/TQi9E3Q/kfs H0gYvkQMkgFqslrO2pdtsiSwE8LIpE82VC2Uf7MwCZjGuCv++T/3MczqvTS2hOLb5d JW+baVO75sRWih/GBht9qa+IBKuD0zDqmnZOTxKezCqgEaH/O1FRlpTFusdTsYHKP+ B3J2YEG+UdoISqCMHYVLk7RKP4GNYmriUkVTPX+Slv8nU/6oBwhld2JRJkQDRlbGc9 Ca9G2QJktLUpAKgEh1n0RlQa48oSYJgsgkUD+maqYOYpaNiNoyUgsiq/7lrzRd8UwG XTfCDQotsrFnw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.29] ([93.207.86.187]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MtwZ4-1pEArz2oCi-00uMVF; Wed, 16 Nov 2022 21:24:55 +0100 Message-ID: Date: Wed, 16 Nov 2022 21:24:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH] Fortran: ICE in simplification of array expression involving power [PR107680] To: Mikael Morin , fortran , gcc-patches Newsgroups: gmane.comp.gcc.patches,gmane.comp.gcc.fortran References: Content-Language: en-US From: Harald Anlauf In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:pu653dEr/h/KAsg0Kpo/ga4PVwqDG+w1U6U2V7mAP1E/SQu4UVo 3pmZpdVoaSvJJmCvA3V8Ps/nMTUwuj4lZVzqvqiSfOYkGCA+N0zR51HS0wN4uyVBocHyjjI 8L6+ZKXKUNXo7wE+iGrPsl7AQHXKLbc8NIUohsWohOsqd81Cv++v2p9HXtV6NeZXNrZFJpQ O5PiSo8yMiaVe/PQJI3qQ== UI-OutboundReport: notjunk:1;M01:P0:6Wh1ulBh2Gg=;xqXRKMNKF5rSbZGeD6KilYoOKYy cAqSetYiinaViWUySA2DlyRhWTdGtl1k5vTn6gs/fMNm+2Whi8SlzwaO3johjLX94Ajy08t0X oyD1YZZA6zSv01PwTkSebt6AWp/eeQuus+R0edLXMHVOx+9hkvnXTvcBQ4RlAA0lgDtTKe/iE 8a3gyJ+B8Rp2moorvMtABvlUBL3ZqRkzSNo936KDkWINiuGjrWoy4Adpg7CTYrqyknrQIpwnW +BOve+sRAdsTJIkGZNF/235iKtr2YuB0bi7sQ0wFiZq4FpsgkyFCT8DQSmbA8FyxfeEcSFaev 2TphZS+bi0XvxMHEI38KZzGUvPJznOw1ACQy9anBQtwEPfJpRA2x91qHOyE5bFzPJcT9yQikQ UQw2h83lYS1x6QdpO7C+Qe0hEOpWDGNGIH+gcGSohENGLdADtNRKTjBiMJgrr6aHrz+hw0nKp PrP4uwnczg0LD2qjw1RF2uzoTQas7yKq0jMe/qbv0zP1ZQ2Ec62QM9GQA3dkvSIEjSnpPstW3 GeZtC8c7F+NnM2JnKq1ijc0B33tHXJeVELpSM63pZdsgz+I+FRcrBV6gTisR2NyBm/tVNk/Um DtbPtaNlOa1CP4RlXEz1DfD3Xg9UBHr+wbdvGBs+AXEEiWWC987m1SlzpvtwfbsVZD3GyyEMI asb0Cee8EltQgGs/zvx4IE7OJX/gXpDqgMvp0zXLcFFjdF5f0Ijb65ltevQGNOV5KYUe07DEv nBBW48uV9aJzoMBxizFlUZIYDGuWvzs+QNPbDPp8nZHn5TqTVialj/ZMpmrNh+1t2IwRXpchA S271rJoNvATrv9o7z/pNAKyXiKNd7SoXayJhV8iEBfonA/YBPNGgR8jLbsYYZVPxTcHW5odlP M2igYFmYBNzUxbyl1N+3Bg4+erPFf64B71p84tjM8mWFgETQd86xMEnqQjE6dT0g5WuWeli/p nzFrPUF0gV2qPaeRVgrNcR7BZ4o= X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,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: Am 16.11.22 um 12:39 schrieb Mikael Morin: > Le 15/11/2022 =C3=A0 21:45, Harald Anlauf via Fortran a =C3=A9crit=C2=A0= : >> Dear all, >> >> when constant expressions involve parentheses, array constructors, >> typespecs, and the power operator (**), we could fail with an ICE >> during simplification in arith_power. >> >> Debugging of the testcase showed we call the proper type conversions >> needed for the arithmetic operation, but under certain circumstances >> we seem to lose the typespec on the way to the invocation of the >> simplification.=C2=A0 We then run into unhandled combinations of operan= d >> types. >> >> The attached patch is likely a sort of a band-aid to the problem: >> we check the operand types in arith_power, and if we see that a >> conversion is (still) needed, we punt and defer the simplification. >> >> AFAICT this is safe.=C2=A0 It does not address a possibly deeply >> covered issue in gfortran, which was suspected when analyzing >> pr107000.=C2=A0 But as this is elusive, that may be hard to locate >> and fix. >> >> Regtested on x86_64-pc-linux-gnu.=C2=A0 OK for mainline? >> > Yes, let's go with this. > Thanks for investigating. > Thanks, pushed. I've opened a PR for the elusive loss of the typespec so that it won't be forgotten: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107721 Really a weird thing...