Re: [PATCH] fortran: fix checking of CHARACTER lengths in array constructors [PR70231]

2023-09-18 Thread Jerry D via Gcc-patches
On 9/18/23 1:27 PM, Harald Anlauf via Fortran wrote: Dear all, as correctly analyzed by Jerry, the code for checking the consistency of character lengths in array constructors did not properly initialize the auxiliary variable used in "bounds checking". The attached patch resolves this by

Re: [PATCH] Fortran: improve bounds checking for DATA with implied-do [PR35095]

2023-08-24 Thread Jerry D via Gcc-patches
On 8/24/23 2:28 PM, Harald Anlauf via Fortran wrote: Dear all, the attached patch adds stricter bounds-checking for DATA statements with implied-do. I chose to allow overindexing (for arrays of rank greater than 1) for -std=legacy, as there might be codes in the wild that need this (and this

Re: [Patch, fortran] PR109684 - compiling failure: complaining about a final subroutine of a type being not PURE (while it is indeed PURE)

2023-08-09 Thread Jerry D via Gcc-patches
On 8/9/23 7:58 AM, Paul Richard Thomas via Fortran wrote: I took a look at my calendar and decided to backport right away. r13-7703-ged049e5d5f36cc0f4318cd93bb6b33ed6f6f2ba7 BTW It is a regression :-) Paul On Wed, 9 Aug 2023 at 12:10, Paul Richard Thomas wrote: Committed to trunk as

Re: [PATCH] Fortran: set shape of initializers of zero-sized arrays [PR95374,PR104352]

2023-05-17 Thread Jerry D via Gcc-patches
On 5/17/23 11:52 AM, Harald Anlauf via Fortran wrote: Dear all, the attached patch is neat, because it fixes a bug by removing code ;-) When generating the initializer for a parameter array, we excepted the case of size 0, which however prevented the detection of array bounds violations and

Re: [patch, fortran] PR109662 Namelist input with comma after name accepted

2023-05-12 Thread Jerry D via Gcc-patches
I plan to commit the following as simple. The issue was a value was being modified on a short namelist read. After tthe first read gives the correct EOF, a second read would give the error but modify the variable. diff --git a/libgfortran/io/unit.c b/libgfortran/io/unit.c index

Re: [patch, fortran] PR109662 Namelist input with comma after name accepted

2023-05-07 Thread Jerry D via Gcc-patches
On 5/6/23 11:15 AM, Harald Anlauf via Fortran wrote: Hi Jerry, Steve, I think I have to pour a little water into the wine. The patch fixes the reported issue only for a comma after the namelist name, but we still accept a few other illegal characters, e.g. ';', because: #define

[patch, fortran] PR109662 Namelist input with comma after name accepted

2023-05-05 Thread Jerry D via Gcc-patches
The attached patch adds a check for the invalid comma and emits a runtime error if -std=f95,f2003,f2018 are specified at compile time. Attached patch includes a new test case. Regression tested on x86_64-linux-gnu. OK for mainline? Regards, Jerry Author: Jerry DeLisle Date: Fri May 5

Re: [PATCH] testsuite: fix scan-tree-dump patterns [PR83904, PR100297]

2023-04-18 Thread Jerry D via Gcc-patches
On 4/18/23 12:39 PM, Harald Anlauf via Fortran wrote: Dear all, the attached patch adjusts the scan-tree-dump patterns of the reported testcases which likely were run in a location such that a path in an error message showing in the tree-dump might have accidentally matched "free" or "data",

Re: [PATCH] Fortran: resolve correct generic with TYPE(C_PTR) arguments [PR61615]

2023-04-10 Thread Jerry D via Gcc-patches
On 4/10/23 1:49 PM, Harald Anlauf via Fortran wrote: Dear all, when comparing formal and actual arguments of a procedure, there was no check of rank for derived types from intrinsic module ISO_C_BINDING. This could lead to a wrong resolution of generic procedures with dummy argument of related

Re: [PATCH] Fortran: fix ICE with bind(c) in block data [PR104332]

2023-03-09 Thread Jerry D via Gcc-patches
On 3/9/23 10:08 AM, Harald Anlauf via Fortran wrote: Dear all, the attached almost obvious patch fixes a NULL pointer dereference in a check of a symbol with the bind(c) attribute. Regtested on x86_64-pc-linux-gnu. OK for mainline? This PR is marked as 10/11/12/13 regression, thus it should

Re: [PATCH][stage1] Remove conditionals around free()

2023-03-03 Thread Jerry D via Gcc-patches
On 3/3/23 3:32 PM, Iain Sandoe wrote: On 3 Mar 2023, at 23:11, Bernhard Reutner-Fischer via Fortran wrote: On 2 March 2023 02:23:10 CET, Jerry D wrote: On 3/1/23 4:07 PM, Steve Kargl via Fortran wrote: On Wed, Mar 01, 2023 at 10:28:56PM +0100, Bernhard Reutner-Fischer via Fortran

Re: [PATCH][stage1] Remove conditionals around free()

2023-03-01 Thread Jerry D via Gcc-patches
On 3/1/23 4:07 PM, Steve Kargl via Fortran wrote: On Wed, Mar 01, 2023 at 10:28:56PM +0100, Bernhard Reutner-Fischer via Fortran wrote: libgfortran/caf/single.c |6 ++ libgfortran/io/async.c |6 ++ libgfortran/io/format.c |3 +--

Re: [patch, libgfortran] Initailize some variable to get rid of nuisance warnings.

2023-02-27 Thread Jerry D via Gcc-patches
Pushed, thanks for feedback On 2/26/23 11:54 PM, Tobias Burnus wrote: Just side remarks, the 0 init in the patch is fine. On 27.02.23 03:53, Jerry D via Gcc-patches wrote: regarding PACK: since this is a bogus warning as the compiler does not realize that dim >= 1, wouldn't a gcc_ass

Re: [patch, libgfortran] Initailize some variable to get rid of nuisance warnings.

2023-02-26 Thread Jerry D via Gcc-patches
d here 84 | index_type mstride[GFC_MAX_DIMENSIONS]; | ^~~ In a sense it is a regression. It showed up when builds started to use -Wmaybe-unitialized. Cheers, Harald Am 26.02.23 um 20:52 schrieb Jerry D via Gcc-patches: The attached patch is minor and self explanato

[patch, libgfortran] Initailize some variable to get rid of nuisance warnings.

2023-02-26 Thread Jerry D via Gcc-patches
The attached patch is minor and self explanatory. I assume this should wait for gfortran 14 since no regression involved. Please advise otherwise. Regression tested on x86-64. OK for trunk when the time is right? Regards, Jerry Author: Jerry DeLisle Date: Sat Feb 25 20:30:35 2023 -0800

Re: [PATCH] Fortran: ASSOCIATE variables should not be TREE_STATIC [PR95107]

2023-02-06 Thread Jerry D via Gcc-patches
On 2/6/23 12:10 PM, Harald Anlauf via Fortran wrote: Dear all, as the PR shows, it is likely not a good idea to try to make an ASSOCIATE variable static when -fno-automatic is specified, so rather keep it on the stack. Attached patch regtested on x86_64-pc-linux-gnu. OK for mainline? Thanks,

Re: *PING* [PATCH] Fortran: prevent redundant integer division truncation warnings [PR108592]

2023-02-05 Thread Jerry D via Gcc-patches
On 2/5/23 11:33 AM, Harald Anlauf via Fortran wrote: Early gentle ping. Am 30.01.23 um 22:55 schrieb Harald Anlauf via Gcc-patches: Dear Fortranners, the subject says it all: in some cases we emit redundant integer division truncation warnings (2 or 4), where just one would have been

Re: [PATCH] Fortran: diagnose USE associated symbols in COMMON blocks [PR108453]

2023-01-28 Thread Jerry D via Gcc-patches
On 1/28/23 9:07 AM, Harald Anlauf via Fortran wrote: Dear all, a USE associated symbol shall not appear in a COMMON block (F2018:C8121) and needs to be diagnosed. The patch is fairly obvious. Regtested on x86_64-pc-linux-gnu. OK for mainline? As the PR is marked as a 10/11/12/13 regression,

Re: [PATCH] Fortran: fix ICE in compare_bound_int [PR108527]

2023-01-28 Thread Jerry D via Gcc-patches
On 1/24/23 1:48 PM, Harald Anlauf via Fortran wrote: Dear all, when checking expressions for array sections, we need to ensure that these use only type INTEGER. However, it does not make sense to generate an internal error when encountering wrong types, but rather take the ordinary route of

Re: [patch, gfortran.dg] Adjust numerous tests so that they pass on line endings

2023-01-27 Thread Jerry D via Gcc-patches
Committed: It is not apparent to me that the testsuite/ChangeLog was updated. Maybe there is a time delay on that? Please be patient with me as I figure out how all this works. ommit f963705752e9d0b79a340788166269af417e344e (HEAD -> master, origin/master, origin/HEAD) Author: Jerry DeLisle

Re: [patch, gfortran.dg] Adjust numerous tests so that they pass on line endings

2023-01-22 Thread Jerry D via Gcc-patches
On 1/22/23 5:38 AM, Mikael Morin wrote: Hello, Le 22/01/2023 à 00:59, Jerry D via Fortran a écrit : (...) Proposed ChangeLog entry using git gcc-commit-mklog: Author: Jerry DeLisle Date:   Sat Jan 21 15:47:19 2023 -0800 Revise the line end tests to pass on certain windows test

Re: [patch, gfortran.dg] Adjust numerous tests so that they pass on line endings

2023-01-21 Thread Jerry D via Gcc-patches
On 1/20/23 6:13 PM, Jerry DeLisle via Fortran wrote: Hi all, The attached patch modifies the following tests to check for line endings. Some test environments inject superfluous /r characters at ends of lines. The expression matching in dg-output tests are changed from: (\n|\r\n|\r) to

Re: [patch. fortran] PR102595 ICE in var_element, at fortran/decl.c

2023-01-21 Thread Jerry D via Gcc-patches
On 1/20/23 9:16 PM, Jerry D wrote: On 1/20/23 5:46 PM, Jerry D wrote: A PARAMETER value is not allowed in a DATA statement, similar to an EQUIVALENCE. The check for this was in gfc_assign_data_value() in data.cc which turns out to be too late when trying to assign a zero sized array.

Re: [patch. fortran] PR102595 ICE in var_element, at fortran/decl.c

2023-01-20 Thread Jerry D via Gcc-patches
On 1/20/23 5:46 PM, Jerry D wrote: A PARAMETER value is not allowed in a DATA statement, similar to an EQUIVALENCE. The check for this was in gfc_assign_data_value() in data.cc which turns out to be too late when trying to assign a zero sized array. Correction, the chunk in data.cc must

[patch. fortran] PR102595 ICE in var_element, at fortran/decl.c

2023-01-20 Thread Jerry D via Gcc-patches
A PARAMETER value is not allowed in a DATA statement, similar to an EQUIVALENCE. The check for this was in gfc_assign_data_value() in data.cc which turns out to be too late when trying to assign a zero sized array. To correct this, the check is moved to match_variable() in primary.cc where

Re: [Patch] libfortran: Fix execute_command_line for Windows

2023-01-18 Thread Jerry D via Gcc-patches
On 1/18/23 7:42 AM, Tobias Burnus wrote: Reported by nightstrike, who also tested this patch. On Windows, we call system() which works as described at https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/system-wsystem?view=msvc-170 Namely, it only fails with "-1" if the command

Re: [PING] nvptx: '-mframe-malloc-threshold', '-Wframe-malloc-threshold' (was: Handling of large stack objects in GPU code generation -- maybe transform into heap allocation?)

2023-01-11 Thread Jerry D via Gcc-patches
On 1/11/23 4:06 AM, Thomas Schwinge wrote: Hi! Ping -- the '-mframe-malloc-threshold' idea, at least. Note that while this issue originally did pop up for Fortran I/O, it's likewise relevant for other functions that maintain big frames, for example in newlib:

Re: nvptx: '-mframe-malloc-threshold', '-Wframe-malloc-threshold' (was: Handling of large stack objects in GPU code generation -- maybe transform into heap allocation?)

2022-12-23 Thread Jerry D via Gcc-patches
On 12/23/22 6:08 AM, Thomas Schwinge wrote: Hi! On 2022-11-11T15:35:44+0100, Richard Biener via Fortran wrote: On Fri, Nov 11, 2022 at 3:13 PM Thomas Schwinge wrote: For example, for Fortran code like: write (*,*) "Hello world" ..., 'gfortran' creates: struct __st_parameter_dt

Re: [PATCH] Fortran: incorrect array bounds when bound intrinsic used in decl [PR108131]

2022-12-23 Thread Jerry D via Gcc-patches
On 12/17/22 1:21 PM, Harald Anlauf via Fortran wrote: Dear all, the previous fix for pr103505 introduced a regression that could lead to wrong array bounds when LBOUND/UBOUND were used in the array spec of a declaration. The reason was that we tried to simplify too early the array element

[patch, fortran] ICE on automatic array of derived type with DTIO

2022-12-23 Thread Jerry D via Gcc-patches
I have committed the obvious as simple. The master branch has been updated by Jerry DeLisle : https://gcc.gnu.org/g:7e76cd96950f49ce21246d44780e972d86b2bcdd commit r13-4862-g7e76cd96950f49ce21246d44780e972d86b2bcdd Author: Steve Kargl Date: Thu Dec 22 20:38:57 2022 -0800 Remove not

Re: [committed] testsuite: Fix up pr107397.f90 test [PR107397]

2022-12-19 Thread Jerry D via Gcc-patches
On 12/19/22 2:29 AM, Jakub Jelinek wrote: On Sat, Dec 17, 2022 at 09:12:43AM -0800, Jerry D via Gcc-patches wrote: The attached patch fixes a regression and is a patch from Steve. I have regression tested it and provided a test case. It is fairly simple and I will commit under the "s

[patch, fortran] PR107397 ICE in gfc_arith_plus, at fortran/arith.cc:654

2022-12-17 Thread Jerry D via Gcc-patches
Hi all, The attached patch fixes a regression and is a patch from Steve. I have regression tested it and provided a test case. It is fairly simple and I will commit under the "simple" rule in a little while. Thanks Steve for Patch. Thanks Harald for helping me get back up to speed on the

Re: [PATCH] Fortran: fix ICE on bad use of statement function [PR107995]

2022-12-11 Thread Jerry D via Gcc-patches
On 12/10/22 1:23 PM, Harald Anlauf via Fortran wrote: Dear all, I'm submitting the attached patch on behalf of Steve. It fixes an ICE that occurs on an obscure use of a statement function as argument to that function. Regtested on x86_64-pc-linux-gnu. OK for mainline? Thanks, Harald OK,

Re: [PATCH, committed] Fortran: error recovery for bad initializers of implied-shape arrays [PR106209]

2022-07-14 Thread Jerry D via Gcc-patches
Hi Herald, Looks good to me. I have always preferred informative messages. Thanks, Jerry On 7/14/22 1:34 PM, Harald Anlauf via Fortran wrote: Dear all, the attached patch introduces error recovery for two cases of using an invalid array in a declaration of an implied-shape array instead of

Re: *PING* [PATCH 0/4] Use pointer arithmetic for array references [PR102043]

2022-04-23 Thread Jerry D via Gcc-patches
Yes, Thank you Mikael! On 4/22/22 6:59 AM, Thomas Koenig via Fortran wrote: Hi Mikael, Ping for the four patches starting at https://gcc.gnu.org/pipermail/fortran/2022-April/057759.html : https://gcc.gnu.org/pipermail/fortran/2022-April/057757.html

Re: *Ping* [PATCH] PR fortran/104210 - [11/12 Regression] ICE in gfc_zero_size_array, at fortran/arith.cc:1685

2022-04-04 Thread Jerry D via Gcc-patches
On 4/4/22 12:09 PM, Harald Anlauf via Fortran wrote: Am 29.03.22 um 23:41 schrieb Harald Anlauf via Fortran: Dear all, during error recovery on invalid declarations of functions as coarrays we may hit multiple places with NULL pointer dereferences. The attached patch provides a minimal and

Re: [PATCH] PR fortran/105138 - Bogus error when function name does not shadow an intrinsic when RESULT clause is used

2022-04-04 Thread Jerry D via Gcc-patches
On 4/4/22 12:04 PM, Harald Anlauf via Fortran wrote: Dear all, Steve's analysis (see PR) showed that we confused the case when a symbol refererred to a recursive procedure which was named the same as an intrinsic. The standard allows such recursive references (see e.g. F2018:19.3.1). The

Re: [PATCH] PR fortran/84519 - [F2018] STOP and ERROR STOP statements with QUIET specifier

2022-02-23 Thread Jerry D via Gcc-patches
On 2/23/22 2:21 PM, Harald Anlauf via Fortran wrote: Dear Fortranners, Fortran 2018 added a QUIET= specifier to STOP and ERROR STOP statements. Janne already implemented the library side code four (4!) years ago, but so far the frontend implementation was missing. Furthermore, F2018 allows for

Re: [Patch, fortran] PR37336 (Finalization) - [F03] Finish derived-type finalization

2022-02-10 Thread Jerry D via Gcc-patches
For what it is worth. On 2/10/22 11:49 AM, Harald Anlauf via Fortran wrote: Hi Paul, Am 10.02.22 um 13:25 schrieb Paul Richard Thomas via Fortran: Conclusions on ifort: (i) The agreement between gfortran, with the patch applied, and ifort is strongest of all the other brands; (ii) The

Re: [Patch, fortran] PR37336 (Finalization) - [F03] Finish derived-type finalization

2022-02-08 Thread Jerry D via Gcc-patches
Remember the days when reading very old cryptic Fortran code? Remember the fixed line lengths and cryptic variable names! I fear the Standards committee has achieved history with the Standard itself it is so difficult to understand sometimes. Cheers to Paul and Harald for digging on this.

Re: [PATCH] PR fortran/103782 - [9/10/11/12 Regression] internal error occurs when overloading intrinsic

2022-01-13 Thread Jerry D via Gcc-patches
On 1/13/22 12:56 PM, Harald Anlauf via Fortran wrote: Dear all, there was a regression handling overloaded elemental intrinsics, leading to an ICE on valid code. Reported by Urban Jost. The logic for when we need to scalarize a call to an intrinsic seems to have been broken during the

Re: [PATCH,FORTRAN 01/29] gdbinit: break on gfc_internal_error

2021-10-29 Thread Jerry D via Gcc-patches
Looks OK. Cheers On 10/29/21 11:58 AM, Bernhard Reutner-Fischer via Fortran wrote: ping On Wed, 5 Sep 2018 14:57:04 + Bernhard Reutner-Fischer wrote: From: Bernhard Reutner-Fischer Aids debugging the fortran FE. gcc/ChangeLog: 2017-11-12 Bernhard Reutner-Fischer *

Re: [PATCH,FORTRAN 28/29] Free type-bound procedure structs

2021-10-29 Thread Jerry D via Gcc-patches
Looks good and simple. Proceed. Thanks Jerry On 10/28/21 5:05 PM, Bernhard Reutner-Fischer via Fortran wrote: ping [Rebased, re-regtested cleanly. Ok for trunk?] On Wed, 5 Sep 2018 14:57:31 + Bernhard Reutner-Fischer wrote: From: Bernhard Reutner-Fischer compiling

Re: *PING* [PATCH] PR fortran/99348, 102521 - ICEs when initializing DT parameter arrays from scalar

2021-10-09 Thread Jerry D via Gcc-patches
This one looks OK.  Sorry I missed it earlier. Thanks again for the patch! Jerry On 10/9/21 12:27 PM, Harald Anlauf via Fortran wrote: *Ping* Am 03.10.21 um 21:20 schrieb Harald Anlauf via Fortran: Dear Fortranners, when initializing parameter arrays from scalars, we did handle only the

Re: [PATCH] PR fortran/65454 - accept both old and new-style relational operators

2021-10-08 Thread Jerry D via Gcc-patches
On 10/8/21 2:33 PM, Harald Anlauf via Fortran wrote: Dear Fortranners, F2018:10.1.5.5.1(2) requires the same interpretation of old and new-style relational operators. We internally distinguish between old and new style, but try to map appropriately when used. This mapping was missing when

Re: [PATCH] PR fortran/102458 - ICE tree check: expected array_type, have pointer_type in gfc_conv_array_initializer, at fortran/trans-array.c:6136

2021-09-23 Thread Jerry D via Gcc-patches
Harald, Looks good. OK and thanks for your time and efforts. Jerry On 9/23/21 12:47 PM, Harald Anlauf via Fortran wrote: Dear Fortranners, we missed certain intrinsics as being disallowed in constant expressions, which lead to an ICE when these intrinsics were used in a specification

Re: *Ping**2 [Patch] Fortran: Fix bind(C) character length checks

2021-07-16 Thread Jerry D via Gcc-patches
Good to go Tobias. Jerry On 7/14/21 5:50 AM, Burnus, Tobias wrote: Ping**2 On Juli 8, 2021 I wrote: *Ping* I intent to incorporate Sandra's suggestions, except for the beginning of line spacing - that's needed to avoid exceeding the 80 character line limit. I did not include an updated

Re: [patch, fortran] Fix PR 100227, write with implied DO loop

2021-07-05 Thread Jerry D via Gcc-patches
Looks OK Thomas, Good for backport as well. Regards, Jerry On 7/4/21 9:09 AM, Thomas Koenig via Fortran wrote: Hello world, after a bit of an absence, I am now back, at least for some regression fixing (and for reviewing patches, if that is called for). So, here's a regression fix to start

Re: [Ping^2, Patch, Fortran] PR98301 Re: RANDOM_INIT() and coarray Fortran

2021-05-21 Thread Jerry D via Gcc-patches
yes, please commit On 5/21/21 8:08 AM, Steve Kargl via Fortran wrote: On Fri, May 21, 2021 at 10:09:02AM +0200, Andre Vehreschild wrote: Ping, ping! Please find attached a rebased version of the patch for the RANDOM_INIT issue with coarray Fortran. Nothing changed to the previous version,