Re: [Fortran, Patch, Coarray, PR 37336] Fix crash in finalizer when derived type coarray is already freed.

2023-09-28 Thread Paul Richard Thomas
Hi Andre, The patch looks fine to me. Since you mention it in the comment, is it worth declaring the derived type 'foo' in a module and giving it a final routine? Thanks for the patch. Paul On Thu, 28 Sept 2023 at 13:45, Andre Vehreschild via Fortran wrote: > > Hi all, > > attached patch fixes

Re: [Fortran, Patch, Coarray, PR 37336] Fix crash in finalizer when derived type coarray is already freed.

2023-09-29 Thread Paul Richard Thomas
. This also is no problem. > > Regtests ok on x86_64_linux_gnu/f37. Ok for trunk? > > Regards, > Andre > > On Thu, 28 Sep 2023 19:21:12 +0100 > Paul Richard Thomas wrote: > > > Hi Andre, > > > > The patch looks fine to me. Since you mention it in the

Re: [Fortran, Patch, Coarray, PR 37336] Fix crash in finalizer when derived type coarray is already freed.

2023-10-01 Thread Paul Richard Thomas
> Thanks for the fast review. > > > > Regards, > > Andre > > > > On Fri, 29 Sep 2023 13:38:57 +0100 > > Paul Richard Thomas wrote: > > > > > Hi Andre, > > > > > > Yes indeed - it's fine for trun

[Patch, fortran] PR111674 - [13/14 regression] Failure to finalize an allocatable subobject of a non-finalizable type

2023-10-04 Thread Paul Richard Thomas
This was fixed as 'obvious' with an off-list OK, posted on the PR, from Harald. Applied to 13-branch and trunk then closed as fixed. Cheers Paul Fortran: Alloc comp of non-finalizable type not finalized [PR111674] 2023-10-04 Paul Thomas gcc/fortran PR fortran/37336 PR fortran/111674 * trans

[Patch, fortran] PR67740 - Wrong association status of allocatable character pointer in derived types

2023-10-11 Thread Paul Richard Thomas
Hi All, The title line of the PR should have been changed a long time since. As noted in comment 5, the original problem was fixed in 10.5. This patch fixes the problem described in comments 4 and 6, where the hidden string length component was not being set in pointer assignment of character arr

Re: [Patch, fortran] PR67740 - Wrong association status of allocatable character pointer in derived types

2023-10-11 Thread Paul Richard Thomas
> > you'll likely want > > ! { dg-do run } > > (Note the space before the dg-command.) > > Cheers, > Harald > > On 10/11/23 21:06, Harald Anlauf wrote: > > Hi Paul, > > > > On 10/11/23 10:48, Paul Richard Thomas wrote: > >> Hi All, >

Re: [patch, committed, fortran] PR82009 [F08] ICE with block construct

2018-07-04 Thread Paul Richard Thomas
Thanks, Jerry. On Wed, 4 Jul 2018 at 19:14, Jerry DeLisle wrote: > > This patch committed as obvious after regression testing and auditing > the code. New test case added. > > Author: jvdelisle > Date: Wed Jul 4 18:08:16 2018 > New Revision: 262416 > > URL: https://gcc.gnu.org/viewcvs?rev=262416

[Patch, fortran] PR66679 - [OOP] ICE with class(*) and transfer

2018-07-05 Thread Paul Richard Thomas
The comment in the patch says it all. Bootstrapped and regtested on FC28/x86_64 - OK for trunk? Paul 2018-07-05 Paul Thomas PR fortran/66679 * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Class array elements are returned as references to the data element. Get the class e

Re: [Patch, fortran] PR66679 - [OOP] ICE with class(*) and transfer

2018-07-23 Thread Paul Richard Thomas
Ping! On Thu, 5 Jul 2018 at 08:51, Paul Richard Thomas wrote: > > The comment in the patch says it all. > > Bootstrapped and regtested on FC28/x86_64 - OK for trunk? > > Paul > > 2018-07-05 Paul Thomas > > PR fortran/66679 > * trans-intrinsic.c (gf

[Patch, fortran] PR80477 - [OOP] Polymorphic function result generates memory leak

2018-07-28 Thread Paul Richard Thomas
Several attempts, including mine, were made to fix this bug since it was posted. They were all attacking the wrong place. Instead of providing the free of the class _data as part of the call to 'add_a_type' it should be included in the post block of the argument processing in the call to 'assign_a_

[Patch, fortran] A first small step towards CFI descriptor implementation

2018-07-31 Thread Paul Richard Thomas
Daniel Celis Garza and Damian Rouson have developed a runtime library and include file for the TS 29113 and F2018 C descriptors. https://github.com/sourceryinstitute/ISO_Fortran_binding The ordering of types is different to the current 'bt' enum in libgfortran.h. This patch interchanges BT_DERIVED

Re: [Patch, fortran] A first small step towards CFI descriptor implementation

2018-07-31 Thread Paul Richard Thomas
Hi Richard, Ah yes, you are absolutely right. I will sit on it for a bit and do the interchange at the descriptor conversion stage for now. Thanks Paul On Tue, 31 Jul 2018 at 15:57, Richard Biener wrote: > > On Tue, Jul 31, 2018 at 2:07 PM Paul Richard Thomas > wrote: > > &

[Patch, fortran] PR104625 ICE in fixup_array_ref, at fortran/resolve.cc:9275 since r10-2912-g70570ec192745095

2023-10-26 Thread Paul Richard Thomas
Hi All, The attached patch fixes the original problem, in which parentheses around the selector in select type constructs caused ICES. Stacked parentheses caused problems in trans-stmt.cc. Rather than tracking this down, the redundant parentheses were removed on resolution of the selector expressi

Re: [PATCH] Fortran: diagnostics of MODULE PROCEDURE declaration conflicts [PR104649]

2023-10-27 Thread Paul Richard Thomas
Hi Harald, That's good for mainline. Thanks for the patch Paul On Thu, 26 Oct 2023 at 21:43, Harald Anlauf wrote: > Dear all, > > the attached patch improves the diagnostics of MODULE PROCEDURE declaration > conflicts, when one of the declarations is an alternate return. We used to > ICE be

[Patch, fortran] PR104555 - ICE in gfc_compare_derived_types, at fortran/interface.cc:628 since r10-2912-g70570ec192745095

2023-10-29 Thread Paul Richard Thomas
Bizarrely, since the fix for pr101625, the testcase compiles and runs correctly with s/select type (y => x)/select type (y => (x))/ ! The fix is straightforward and appears to be one of those wrinkles arising from the use of associate variables as a selector. The fault is reasonable since the expr

[Patch, fortran] PR64120

2023-10-31 Thread Paul Richard Thomas
I found this 'obvious' fix, while going through PRs assigned to me. Regtests. OK for mainline? Cheers Paul Fortran: Allocatable automatic charlen must not be saved [PR64120]. 2023-10-31 Paul Thomas gcc/fortran PR fortran/64120 * trans-decl.cc (gfc_trans_deferred_vars): Detect automatic ch

[Patch, fortran] PR98498 - Interp request: defined operators and unlimited polymorphic

2023-11-01 Thread Paul Richard Thomas
The interpretation request came in a long time ago but I only just got around to implementing it. The updated text from the standard is in the comment. Now I am writing this, I think that I should perhaps use switch(op)/case rather than using if/else if and depending on the order of the gfc_intrin

Re: [Patch, fortran] PR98498 - Interp request: defined operators and unlimited polymorphic

2023-11-02 Thread Paul Richard Thomas
* gfortran.dg/interface_50.f90: New test. On Wed, 1 Nov 2023 at 20:12, Harald Anlauf wrote: > Hi Paul, > > Am 01.11.23 um 19:02 schrieb Paul Richard Thomas: > > The interpretation request came in a long time ago but I only just got > > around to implementing it. > > > > T

[Patch, fortran] PR112316 - [13 Regression] Fix for PR87477 rejects valid code with a bogus error...

2023-11-02 Thread Paul Richard Thomas
Hi All, I have pushed as 'obvious' a fix for this regression to both 13-branch and mainline. The patch itself looks substantial but it consists entirely of the removal of a condition and repagination of the corresponding block. Please see below for part of my first comment on the PR for an explana

Re: [PATCH] Fortran: passing of allocatable/pointer arguments to OPTIONAL+VALUE [PR92887]

2023-11-03 Thread Paul Richard Thomas
Hi Harald, This looks good to me. OK for mainline. Thanks for the patch. Paul On Wed, 1 Nov 2023 at 22:10, Harald Anlauf wrote: > Dear all, > > I've dusted off and cleaned up a previous attempt to fix the handling > of allocatable or pointer actual arguments to OPTIONAL+VALUE dummies. > The

Re: [PATCH] Fortran: Fix generate_error library function fnspec

2023-11-04 Thread Paul Richard Thomas
Hi Martin, This looks to be 'obvious' and is certainly OK for mainline. Backport if you wish. Thanks Paul On Fri, 3 Nov 2023 at 12:54, Martin Jambor wrote: > Hi, > > when developing an otherwise unrelated patch I've discovered that the > fnspec for the Fortran library function generate_error

[Patch, fortran] PR86248 - [7/8/9/10 Regression] LEN_TRIM in specification expression causes link failure

2019-10-26 Thread Paul Richard Thomas
As far as I can tell, this is a 6-regression as well - ***sigh*** The patch is fundamentally very simple. Symbols that were marked with the fn_result_spec flag that really were module parameters were having the wrong name mangling applied to them. The rest of the patch is a tidy up. Regtested on

Re: [Patch, fortran] PR86248 - [7/8/9/10 Regression] LEN_TRIM in specification expression causes link failure

2019-10-26 Thread Paul Richard Thomas
Hi Steve, Thanks for the heads up. I'll get on to it right away. Regards Paul On Sat, 26 Oct 2019 at 20:04, Steve Kargl wrote: > > On Sat, Oct 26, 2019 at 07:39:55PM +0100, Paul Richard Thomas wrote: > > As far as I can tell, this is a 6-regression as well - ***sigh*** >

Re: [Patch, Fortran] PR91863 - fix call to bind(C) with array descriptor

2019-10-27 Thread Paul Richard Thomas
Hi Tobias, Thanks for taking care of this. OK for trunk and 9-branch. Cheers Paul On Wed, 23 Oct 2019 at 14:07, Tobias Burnus wrote: > > With the trunk, there are three issues: > > (a) With bind(C), the callee side handles deallocation with intent(out). > > This should produce the code: >

Re: [Patch, Fortran] PR92277 - Fix assumed-rank array with bind(C)

2019-10-31 Thread Paul Richard Thomas
Hi Tobias, OK for trunk and for 9-branch. For the latter, you will have to get release manager approval of course. Thanks for picking up my doo-doos. Cheers Paul On Wed, 30 Oct 2019 at 15:40, Tobias Burnus wrote: > > The attached test case (w/o optional and with "this") gave an ICE as > "*thi

Re: [Patch,Fortran] PR92284 – gfc_desc_to_cfi_desc fixes

2019-10-31 Thread Paul Richard Thomas
Hi Tobias, OK for trunk and for 9-branch. As with the patch for PR92277, you will have to get release manager approval for 9.2. Thanks for working on this. Cheers Paul On Wed, 30 Oct 2019 at 23:29, Tobias Burnus wrote: > > Playing with the PR92284 test case revealed two issues related to > gf

[patch, fortran] PR92123 - [F2018/array-descriptor] Scalar allocatable/pointer with array descriptor (via bind(C)): ICE with select rank or error scalar variable with POINTER or ALLOCATABLE in procedu

2019-11-03 Thread Paul Richard Thomas
The attached patch is verging on the obvious. Thanks to Tobias for spotting Vipul's messages on the J3 list. Regtests on FC30/x86_64 - OK for trunk and 9-branch? Paul 2019-11-03 Paul Thomas PR fortran/92123 *decl.c (gfc_verify_c_interop_param): Remove error asserting that pointer

Re: [Patch] PR fortran/92470 Fixes for CFI_address

2019-11-12 Thread Paul Richard Thomas
Hi Tobias, Thanks for taking care of this so rapidly :-) OK for trunk and for 9-branch. Cheers Paul On Tue, 12 Nov 2019 at 14:42, Tobias Burnus wrote: > > Regarding the uncontroversial part: CFI_address. This has been reported > by Vipul Parekh a few hours ago and the problem is: The lower bo

Re: [Patch] PR fortran/92470 Fixes for CFI_address

2019-11-13 Thread Paul Richard Thomas
I too had some considerable difficulty on this point. I wasn't at all sure that the C world view was relevant here since the API includes CFI_address and, in principle, one could reference directly the elements pointed to by base_addr. However, I bow to the wisdom of your correspondents on the j3 l

Re: [PATCH] fortran: Fix up ISO_Fortran_binding_15.f90 failures [PR92123]

2020-01-30 Thread Paul Richard Thomas
Hi All, Thank you for taking care of that, Jakub. I have been overwhelmed by daytime work since my last posting and, in addition, have yet to set up a git workflow. This situation is likely to continue for at least another 3-4 months. I will release all the PRs assigned to me, except those associa

Re: *ping**2 Re: [Patch][Fortran] Fix to strict associate check (PR93427)

2020-02-03 Thread Paul Richard Thomas
Hi Tobias, Yes, OK for trunk. I would have been perfectly happy for you to commit as 'obvious'. Cheers Paul On Mon, 3 Feb 2020 at 08:44, Tobias Burnus wrote: > > Another slightly early ping. > > Tobias > > On 1/31/20 3:24 PM, Tobias Burnus wrote: > > *ping* after 4 days. > > > > On 1/27/20 2:

[Patch, fortran] PR92753 - [9/10 Regression] ICE in gfc_trans_call, at fortran/trans-stmt.c:392

2019-12-15 Thread Paul Richard Thomas
This patch is straight forward and well explained by the ChangeLogs. The ICE comes about because the simplification of the inquiry_part_ref expressions produced bad expressions. Thanks to Steve for spotting the error in the INQUIRY_RE and INQUIRY_IM parts that was so blindingly obvious that I coul

Re: [Patch, fortran PR89645/99065 No IMPLICIT type error with: ASSOCIATE( X => function() )

2024-03-03 Thread Paul Richard Thomas
rtran/trans-stmt.cc:2383 > [...] > > I don't see anything wrong with it: NAG groks it, like Nvidia and Flang, > while Intel crashes at runtime. > > Can you have another brief look? > > Thanks, > Harald > > > On 1/6/24 18:26, Paul Richard Thomas wrote: >

Re: [PATCH] Fortran: error recovery while simplifying expressions [PR103707, PR106987]

2024-03-06 Thread Paul Richard Thomas
Hi Harald, This all looks good to me. OK for mainline and, according to intestinal fortitude on your part, earlier branches. Thanks Paul On Tue, 5 Mar 2024 at 21:24, Harald Anlauf wrote: > Dear all, > > error recovery on arithmetic errors during simplification has bugged > me for a long time

Re: [PATCH] Fortran: handle procedure pointer component in DT array [PR110826]

2024-03-12 Thread Paul Richard Thomas
Hi Harald, This looks good to me. OK for mainline and, since it is so straightforward, for backporting. Thanks for the patch. Paul On Mon, 11 Mar 2024 at 21:20, Harald Anlauf wrote: > Dear all, > > the attached patch fixes an ICE-on-valid code when assigning > a procedure pointer that is a c

Re: [Patch, fortran PR89645/99065 No IMPLICIT type error with: ASSOCIATE( X => function() )

2024-03-12 Thread Paul Richard Thomas
Hi All, This is the last posting of this patch before I push it. Harald is OK with it on the grounds that the inferred_type flag guards the whole lot, except for the chunks in trans-stmt.cc. In spite of Harald's off-list admonition not to try to fix everything at once, this version fixes most of

Re: [Patch, fortran PR89645/99065 No IMPLICIT type error with: ASSOCIATE( X => function() )

2024-03-12 Thread Paul Richard Thomas
;s approach was very clever but has found it's limit with the associate construct. The sad thing is that this is the only blocker that I know of. Thanks Paul On Tue, 12 Mar 2024 at 21:07, Harald Anlauf wrote: > Hi Paul, > > On 3/12/24 15:54, Paul Richard Thomas wrote: > &g

Re: [PATCH] Fortran: fix IS_CONTIGUOUS for polymorphic dummy arguments [PR114001]

2024-03-13 Thread Paul Richard Thomas
Hi Harald, This looks good to me. The testcase gives the same result with other brands. OK for mainline and for backporting. Thanks Paul On Tue, 12 Mar 2024 at 22:12, Harald Anlauf wrote: > Dear all, > > here's another small fix: IS_CONTIGUOUS did erroneously always > return .true. for CLAS

Re: [PATCH v3 1/2] testsuite: Declare fortran array bound variables

2024-03-19 Thread Paul Richard Thomas
Hi Mikael, This looks completely "obvious" to me. OK for mainline and, I would suggest, 13-branch. Thanks Paul On Tue, 19 Mar 2024 at 15:49, Mikael Morin wrote: > This fixes invalid undeclared fortran array bound variables > in the testsuite. > > gcc/testsuite/ChangeLog: > > * gfort

Re: [PATCH v3 0/2] fortran: Fix specification checks [PR111781]

2024-03-19 Thread Paul Richard Thomas
Hi Mikael, Sorry, I am replying to these in the order that they appear in my intray :-) OK for mainline and, if you wish, 13-branch. Thanks Paul On Tue, 19 Mar 2024 at 15:49, Mikael Morin wrote: > Hello, > > these patches correct diagnostics dealing with variables in specification > express

Re: [PATCH v3 2/2] fortran: Fix specification expression error with dummy procedures [PR111781]

2024-03-19 Thread Paul Richard Thomas
Hi Mikael, This is very good. I am pleased to see global variables disappear and I like the new helper functions. As before, OK for mainline and, if you wish, 13-branch. Thanks Paul On Tue, 19 Mar 2024 at 15:49, Mikael Morin wrote: > This fixes a spurious invalid variable in specification e

Re: [PATCH] Fortran: no size check passing NULL() without MOLD argument [PR55978]

2024-03-24 Thread Paul Richard Thomas
Hi Harald, This is completely fine - if you haven't committed, please do so. Thanks Paul On Fri, 22 Mar 2024 at 17:32, Harald Anlauf wrote: > Dear all, > > here's a simple and obvious patch for a rejects-valid case when > we pass a NULL() actual to an optional dummy for variants where > ther

[Patch, fortran] PR110987 and PR113885 - gimplifier ICEs and wrong results in finalization

2024-03-28 Thread Paul Richard Thomas
Hi All, The attached patch has two elements: (i) A fix for gimplifier ICEs with derived type having no components. The reporter himself suggested (thanks Kirill!): - if (derived && derived->attr.zero_comp) + if (derived && (derived->components == NULL)) As far as I can tell, this is the corre

Re: [Patch, fortran] PR110987 and PR113885 - gimplifier ICEs and wrong results in finalization

2024-03-29 Thread Paul Richard Thomas
Hi Harald, Thanks for the thumbs-up. Committed as 3c793f0361bc66d2a6bf0b3e1fb3234fc511e2a6. I will backport to 13-branch in a couple of weeks. Best regards Paul On Thu, 28 Mar 2024 at 22:27, Harald Anlauf wrote: > ...snip... > yes, this looks good here. > > ...snip... The patch looks rathe

[Patch, fortran] PR112407 - [13/14 Regression] Fix for PR37336 triggers an ICE in gfc_format_decoder while constructing a vtab

2024-03-30 Thread Paul Richard Thomas
Hi All, This bug emerged in a large code and involves possible recursion with a "hidden" module procedure; ie. where the symtree name starts with '@'. This throws the format decoder. As the last message in the PR shows, I have vacillated between silently passing on the possible recursion or adding

Re: [Patch, fortran] PR112407 - [13/14 Regression] Fix for PR37336 triggers an ICE in gfc_format_decoder while constructing a vtab

2024-03-31 Thread Paul Richard Thomas
Hi Harald, > > I had only a quick glance at your patch. I guess you unintentionally > forgot to remove those parts that you already committed for PR110987, > along with the finalize-testcases. > Guilty as charged. I guess I got out of the wrong side of the bed :-) > > I am still trying to find

[Patch, fortran] PR106999 [11/12/13/14 Regression] ICE tree check: expected record_type or union_type or qual_union_type, have function_type in gfc_class_data_get, at fortran/trans-expr.cc:233

2024-03-31 Thread Paul Richard Thomas
This regression has a relatively simple fix. The passing of a subroutine procedure pointer component to a dummy variable was being missed completely. The error has been added. Conversely, an error was generated for a procedure pointer variable but no use was being made of the interface, if one was

Re: [patch, libgfortran] PR114304 - [13/14 Regression] libgfortran I/O – bogus "Semicolon not allowed as separator with DECIMAL='point'"

2024-04-04 Thread Paul Richard Thomas
Hi Jerry, It looks good to me. Noting that this is not a regression, OK for mainline on condition that you keep a sharp eye out for any associated problems. Likewise with backporting to 13-branch. Thanks Paul On Thu, 4 Apr 2024 at 02:34, Jerry D wrote: > Hi all, > > The attached log entry an

[Patch, fortran] PR114535 - [13/14 regression] ICE with elemental finalizer

2024-04-08 Thread Paul Richard Thomas
Hi All, This one is blazingly 'obvious'. I haven't had the heart to investigate why somebody thought that it is a good idea to check if unreferenced symbols are finalizable because, I suspect, that 'somebody' was me. Worse, I tried a couple of other fixes before I hit on the 'obvious' one :-( The

[Patch, fortran] PR113956 - [13/14 Regression] ice in gfc_trans_pointer_assignment, at fortran/trans-expr.cc:10524

2024-04-09 Thread Paul Richard Thomas
Patch pushed after pre-approval by Harald on Bugzilla. Fortran: Fix ICE in gfc_trans_pointer_assignment [PR113956] 2024-04-09 Paul Thomas gcc/fortran PR fortran/113956 * trans-expr.cc (gfc_trans_pointer_assignment): Remove assert causing the ICE since it was unnecesary

[Patch, fortran] PR113363 - ICE on ASSOCIATE and unlimited polymorphic function

2024-04-10 Thread Paul Richard Thomas
Hi All, This patch corrects incorrect results from assignment of unlimited polymorphic function results both in assignment statements and allocation with source. The first chunk in trans-array.cc ensures that the array dtype is set to the source dtype. The second chunk ensures that the lhs _len f

Re: [PATCH] Fortran: fix argument passing to CONTIGUOUS, TARGET dummy [PR97592]

2023-12-17 Thread Paul Richard Thomas
Hi Harald, It might be a simple patch but I have to confess it took a while for me to get my head around the difference between gfc_is_not_contiguous and !gfc_is_simply_contigous :-( Yes, this is OK for mainline and, after a short delay, for 13-branch. Thanks for the patch Paul On Sat, 16 Dec

[Patch, fortran PR89645/99065 No IMPLICIT type error with: ASSOCIATE( X => function() )

2024-01-06 Thread Paul Richard Thomas
These PRs come about because of gfortran's single pass parsing. If the function in the title is parsed after the associate construct, then its type and rank are not known. The point at which this becomes a problem is when expressions within the associate block are parsed. primary.cc (gfc_match_vars

Re: [PATCH] Fortran: allow RESTRICT qualifier also for optional arguments [PR100988]

2023-12-04 Thread Paul Richard Thomas
Hi Harald, The patch is OK for mainline. Thanks Paul On Mon, 4 Dec 2023 at 22:47, Harald Anlauf wrote: > Dear all, > > the attached patch picks up an observation by Tobias that we did > not specify the RESTRICT qualifier for optional arguments even > if that was allowed. In principle this m

{Patch, fortran] PR112834 - Class array function selector causes chain of syntax and other spurious errors

2023-12-06 Thread Paul Richard Thomas
Dear All, This patch was rescued from my ill-fated and long winded attempt to provide a fix-up for function selector references, where the function is parsed after the procedure containing the associate/select type construct (PRs 89645 and 99065). The fix-ups broke down completely once these const

[Patch, fortran] PR112459 - gfortran -w option causes derived-type finalization at creation time

2023-11-11 Thread Paul Richard Thomas
Hi All, Evidently -w causes gfc_option.allow_std to be set to default, which allows anything and everything to happen, including these f2003/8 finalizations. The fix is trivial. Regtests fine - OK for mainline and -13 branch? Paul Fortran: Prevent unwanted finalization with -w option [PR112459]

Re: [PATCH v2] Fortran: fix reallocation on assignment of polymorphic variables [PR110415]

2023-11-29 Thread Paul Richard Thomas
Hi Andrew, This is OK by me. I attach a slightly edited version of the patch itself in the hope that it will make the code a bit clearer. Thanks and welcome! Paul On Mon, 27 Nov 2023 at 17:35, Andrew Jenner wrote: > This is the second version of the patch - previous discussion at: > https:/

Re: [PATCH] Fortran: fix TARGET attribute of associating entity in ASSOCIATE [PR112764]

2023-11-30 Thread Paul Richard Thomas
Hi Harald, The original testcase is accepted by the two other brands to which I have access. OK for mainline and, I would suggest, 13-branch. Thanks Paul On Wed, 29 Nov 2023 at 21:16, Harald Anlauf wrote: > Dear all, > > the attached simple patch fixes the handling of the TARGET > attribute

[Patch, fortran] PR68155 - ICE on initializing character array in type (len_lhs <> len_rhs)

2023-09-20 Thread Paul Richard Thomas
Hi All, This is a straightforward patch that is adequately explained by the ChangeLog. Regtests fine - OK for trunk? Cheers Paul Fortran: Pad mismatched charlens in component initializers [PR68155] 2023-09-20 Paul Thomas gcc/fortran PR fortran/68155 * decl.cc (fix_initializer_charlen): Ne

Re: [Patch, Fortran] 2/3 Refactor locations where _vptr is (re)set.

2024-06-26 Thread Paul Richard Thomas
hes. > > Regards, > Andre > > PS. I have attached them in plain text and as archive to prevent mailers > from > corrupting them. > > On Thu, 20 Jun 2024 07:42:31 +0100 > Paul Richard Thomas wrote: > > > Hi Andre, > > > > Both this patch

[Patch, fortran] PR102689 - Segfault with RESHAPE of CLASS as actual argument

2024-07-01 Thread Paul Richard Thomas
Hi All, This is one of those PRs where one thing led to another I think that the patch is pretty complete and, while apparently quite heavy, is more or less self explanatory through comments and the ChangeLog. The first testcase concentrates on reshape in various guises, while the second deal

Re: [Patch, fortran] PR102689 - Segfault with RESHAPE of CLASS as actual argument

2024-07-02 Thread Paul Richard Thomas
Hi Andre, Thank you for the review. > ...snip... > > I am confused here, because you are assigning to rhs. When that is > correct, why > is there no else assigning zero to the rhs->_len when arg1 is not > unlimited? 'rhs_class_expr' is highly confusing and came from the original use of this pa

[Patch, fortran] PR84868 - [11/12/13/14/15 Regression] ICE in gfc_conv_descriptor_offset, at fortran/trans-array.c:208

2024-07-13 Thread Paul Richard Thomas
Hi All, After messing around with argument mapping, where I found and fixed another bug, I realised that the problem lay with simplification of len_trim with an argument that is the element of a parameter array. The fix was then a straightforward lift of existing code in expr.cc. The mapping bug i

Re: [Patch, fortran] PR84868 - [11/12/13/14/15 Regression] ICE in gfc_conv_descriptor_offset, at fortran/trans-array.c:208

2024-07-13 Thread Paul Richard Thomas
Hi All, Harald has pointed out that I attached the ChangeLog twice and the patch not at all :-( Please find the patch duly attached. Paul On Sat, 13 Jul 2024 at 10:58, Paul Richard Thomas < paul.richard.tho...@gmail.com> wrote: > Hi All, > > After messing around with argument

Re: [PATCH] fortran: Correctly evaluate the MASK argument of MINLOC/MAXLOC

2024-07-13 Thread Paul Richard Thomas
Hi Mikael, The fix is blindingly obvious :-) Not only that, the failing testcase runs correctly. OK for mainline and please backport to 14-branch before the 14.2 release. Thanks for the patch Paul On Sat, 13 Jul 2024 at 10:48, Mikael Morin wrote: > From: Mikael Morin > > Hello, > > I'm cur

Re: [Patch, fortran] PR84868 - [11/12/13/14/15 Regression] ICE in gfc_conv_descriptor_offset, at fortran/trans-array.c:208

2024-07-15 Thread Paul Richard Thomas
ns-array.cc:483 > 0x243e156 internal_error(char const*, ...) > ../../gcc-trunk/gcc/diagnostic-global-context.cc:491 > 0x96dd70 fancy_abort(char const*, int, char const*) > ../../gcc-trunk/gcc/diagnostic.cc:1725 > 0x749d68 gfc_conv_descriptor_stride_get(tree_node*, tree_node*) >

Re: [Patch, fortran] PR84868 - [11/12/13/14/15 Regression] ICE in gfc_conv_descriptor_offset, at fortran/trans-array.c:208

2024-07-15 Thread Paul Richard Thomas
I've done it again! Patch duly added. Paul On Mon, 15 Jul 2024 at 09:21, Paul Richard Thomas < paul.richard.tho...@gmail.com> wrote: > Hi Harald, > > Thank you for the review and for the testing to destruction. Both issues > are fixed in the attached patch. Note the new f

[Patch, fortran] PR115070 (and PR115348) - [13/14/15 Regression] ICE using IEEE_ARITHMETIC in a derived type method with class, intent(out)

2024-07-15 Thread Paul Richard Thomas
Hi All, I am not sure that I understand why this bug occurs. The regression was introduced by my patch that had gfc_trans_class_init_assign return NULL_TREE, when all the components of the default initializer are NULL. Note that this only afflicts scalar dummy arguments. With pr115070: void my_su

Re: [Patch, fortran] PR84868 - [11/12/13/14/15 Regression] ICE in gfc_conv_descriptor_offset, at fortran/trans-array.c:208

2024-07-16 Thread Paul Richard Thomas
Hi Harald, Pushed as r15-2072. I will wait a few days before backporting but I would be surprised if there are any problems simply because the bug prevented the code patch from doing anything than ICE. In answer to some of your latest points: > > >> Can we prevent the export of this artificial s

Re: [Ping, Fortran, Patch, PR82904] Fix [11/12/13/14/15 Regression][Coarray] ICE in make_ssa_name_fn, at tree-ssanames.c:261

2024-07-17 Thread Paul Richard Thomas
Hi Andre, It looks good to me. I am happy to see that the principle of the patch has Richi's blessing too. OK for mainline. I leave it for you (and Richi?) to decide whether to backport in time for the 14.2 release. Regards Paul On Wed, 17 Jul 2024 at 14:08, Andre Vehreschild wrote: > Hi al

[Patch, fortran] PR108889 -[12/13/14/15 Regression] (Re)Allocate in assignment shows used uninitialized memory warning with -Wall if LHS is unallocated

2024-07-17 Thread Paul Richard Thomas
Hi All, This patch is simple and well described by the ChangeLogs and the comments. Regtests OK. OK for mainline and backporting? Cheers Paul Change.Logs Description: Binary data diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index ed1213a41cb..c1fb896f587 100644 --- a/gcc/fortr

Re: [Ping, Fortran, Patch, PR78466, coarray, v1.1] Fix Explicit cobounds of a procedures parameter not respected

2024-07-18 Thread Paul Richard Thomas
Hi Andre, The code is standard boilerplate in handling arrays and looks OK to me. That said, I know next to nothing about the handling of co-arrays in gfortran. I hope that others can pick up anything that I have missed. Since you are likely to produce a stream (and have already) of co-array patc

Re: [Patch, fortran] PR108889 -[12/13/14/15 Regression] (Re)Allocate in assignment shows used uninitialized memory warning with -Wall if LHS is unallocated

2024-07-18 Thread Paul Richard Thomas
Hi Andre, > + /* Mark so that rhs "used unallocated" warnings can be issued. > Component > +references do not generate the warnings. */ > + for (ref = expr1->ref; ref; ref = ref->next) > + if (ref->type == REF_COMPONENT) > + break; > Good spot - I had gone blind

Re: [r15-2135 Regression] FAIL: libgomp.oacc-fortran/privatized-ref-2.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable -Os at line 32 (test for warnings, line 31) on Linux/x86_64

2024-07-18 Thread Paul Richard Thomas
Hi Haochen, Try removing lines 37-41 since these are precisely the bogus warnings that the patch is meant to eliminate. Regards Paul On Thu, 18 Jul 2024 at 14:38, haochen.jiang wrote: > On Linux/x86_64, > > c3aa339ea50f050caf7ed2e497f5499ec2d7b9cc is the first bad commit > commit c3aa339ea50f

Re: [Fortran, Patch, PR77518, (coarray), v1] Fix ICE in sizeof(coarray)

2024-07-18 Thread Paul Richard Thomas
Hi Andre, While I realise that this is not your doing, should we not check DECL_LANG_SPECIFIC ()) before touching GFC_DECL_SAVED_DESCRIPTOR? Or is access guaranteed by the REF_COMPONENT check? A micro-nit line 12 s/User/Use/ Apart from this, it looks to be eminently obvious. OK for mainline. Pa

Re: [r15-2135 Regression] FAIL: libgomp.oacc-fortran/privatized-ref-2.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable -Os at line 32 (test for warnings, line 31) on Linux/x86_64

2024-07-19 Thread Paul Richard Thomas
90" > > > > After the change, all the tests are passed. However, is that right? > > > > I am not familiar with either Fortran or libgomp, but the warning > > like something declared here which might report variable declaration > > conflict seems needed. &

Re: [Ping, Patch, Fortran, PR88624, v1] Fix Rejects allocatable coarray passed as a dummy argument

2024-07-19 Thread Paul Richard Thomas
Hi Andre, The patch looks fine to me. Please add the original testcase as pr88624.f90, since it can be a compile only. The addition to coarray/dummy_1.f90 is fine as well but I think that it is good to address the reporter's problem directly. Thanks Paul On Wed, 17 Jul 2024 at 14:10, Andre Veh

Ping: [Patch, fortran] PR115070 (and PR115348) - [13/14/15 Regression] ICE using IEEE_ARITHMETIC in a derived type method with class, intent(out)

2024-07-19 Thread Paul Richard Thomas
Hi All, Ping! I understand now why this works. The scope of the block is merged and so all the previous declarations that would otherwise disappear are added, even by the empty statement. Regards Paul On Mon, 15 Jul 2024 at 17:10, Paul Richard Thomas < paul.richard.tho...@gmail.com>

[Patch, fortran] PR114874 - [14/15 Regression] ICE with select type, type is (character(*)), and substring

2024-05-15 Thread Paul Richard Thomas
Hi All, I have been around several circuits with a patch for this regression. I posted one in Bugzilla but rejected it because it was not direct enough. This one, however, is more to my liking and fixes another bug lurking in the shadows. The way in which select type has been implemented is a bit

[Patch, fortran] PR103312 - [11/12/13/14/15 Regression] ICE in gfc_find_component since r9-1098-g3cf89a7b992d483e

2024-05-20 Thread Paul Richard Thomas
Hi All, I don't think that this PR is really a regression although the fact that it is marked as such brought it to my attention :-) The fix turned out to be remarkably simple. It was found after going down a silly number of rabbit holes, though! The chunk in dependency.cc is probably more elabo

Re: [Patch, fortran] PR103312 - [11/12/13/14/15 Regression] ICE in gfc_find_component since r9-1098-g3cf89a7b992d483e

2024-05-23 Thread Paul Richard Thomas
Hi Harald, You were absolutely right about returning 'false' :-) The patch is duly corrected. Committed to mainline and will be followed by backports in a few weeks. Regards Paul On Tue, 21 May 2024 at 19:58, Harald Anlauf wrote: > Hi Paul, > > Am 20.05.24 um 11:06 s

Re: [Fortran, Patch, PR110033, v1] Fix associate for coarrays

2024-08-14 Thread Paul Richard Thomas
Hi Andre, >From a very rapid scan(in the style of somebody on vacation :-) ) of the two patches, it all looks good to me. Adding the corank structure to gfc_expr is long overdue. Thanks also for rolling select type into the second patch. It would be good if you would check if PRs 46371 and 56496 a

Re: [Patch, PR Fortran/90072] Polymorphic Dispatch to Polymophic Return Type Memory Leak

2024-06-06 Thread Paul Richard Thomas
Hi Andre, I apologise for the slow response. It's been something of a heavy week... This is good for mainline. Thanks Paul PS That's good news about the funding. Maybe we will get to see "built in" coarrays soon? On Tue, 4 Jun 2024 at 11:25, Andre Vehreschild wrote: > Hi all, > > attached

Re: [Patch, Fortran/90068] Add finalizer creation to array constructor for functions of derived type.

2024-06-07 Thread Paul Richard Thomas
Hi Andre, I had been working in exactly the same area to correct the implementation of finalization of function results in array constructors. However, I couldn't see a light way of having the finalization occur at the correct time; "If an executable construct references a nonpointer function, the

[Patch, fortran] PR59104

2024-06-08 Thread Paul Richard Thomas
Hi All, The attached fixes a problem that, judging by the comments, has been looked at periodically over the last ten years but just looked to be too fiendishly complicated to fix. This is not in small part because of the confusing ordering of dummies in the tlink chain and the unintuitive placeme

Re: [Patch, fortran] PR59104

2024-06-09 Thread Paul Richard Thomas
quot;) stop 15 end program p On Sun, 9 Jun 2024 at 07:14, Paul Richard Thomas < paul.richard.tho...@gmail.com> wrote: > Hi All, > > The attached fixes a problem that, judging by the comments, has been > looked at periodically over the last ten years but just looked to be too &

Re: [Patch, fortran] PR59104

2024-06-09 Thread Paul Richard Thomas
t; 0 0 3 > > Expected: > > 2 3 3 > > Can you please check? > > Thanks, > Harald > > > Am 09.06.24 um 17:57 schrieb Paul Richard Thomas: > > Hi All, > > > > I have extended the testcase - see

Re: [Patch, fortran] PR59104

2024-06-13 Thread Paul Richard Thomas
& sym->ts.u.cl->length > + && sym->ts.u.cl->length->expr_type != EXPR_CONSTANT) > + front = gfc_traverse_expr (sym->ts.u.cl->length, proc_name, > + dependency_fcn, 0); > > This can overwrite a previous fron

Re: [Patch, Fortran, 90076] 1/3 Fix Polymorphic Allocate on Assignment Memory Leak

2024-06-16 Thread Paul Richard Thomas
Hi Andre, The patch is OK for mainline. Please change the subject line to have [PR90076] at the end. I am not sure that the contents of the first square brackets are especially useful in the commit. Thanks for the fix Paul On Tue, 11 Jun 2024 at 13:57, Andre Vehreschild wrote: > Hi all, > >

[Bug fortran/59104] 15 Regression - Wrong result with SIZE specification expression

2024-07-21 Thread Paul Richard Thomas
After an OK from Harald, commit r15-2187-g838999bb23303edc14e96b6034cd837fa4454cfd Author: Paul Thomas Date: Sun Jul 21 17:48:47 2024 +0100 Fortran: Fix regression caused by r14-10477 [PR59104] 2024-07-21 Paul Thomas gcc/fortran PR fortran/59104 * gfort

[Patch, fortran] PR79685 - [12/13/14/15 Regression] ICE on valid code in gfc_match_structure_constructor

2024-07-27 Thread Paul Richard Thomas
This patch is straightforward but I am still puzzled as to why it is necessary for the particular case. Having looked at all the other chunks of frontend code involving use renaming, it seems that the process just works everywhere else. I tried putting the new code in gfc_find_symtree but it caused

Re: *** SPAM *** [Patch, fortran] PR79685 - [12/13/14/15 Regression] ICE on valid code in gfc_match_structure_constructor

2024-07-27 Thread Paul Richard Thomas
Hi Mikael, You were absolutely right. I looked at the caller and "just didn't get it". Thanks. I will resubmit when I get back from a business trip. Cordialement Paul On Sat, 27 Jul 2024 at 12:35, Mikael Morin wrote: > Hello, > > Le 27/07/2024 à 11:25, Pau

Re: [Patch, fortran] PR79685 - [12/13/14/15 Regression] ICE on valid code in gfc_match_structure_constructor

2024-07-28 Thread Paul Richard Thomas
/ PR fortran/79685 * gfortran.dg/use_rename_12.f90: New test. On Sat, 27 Jul 2024 at 22:04, Paul Richard Thomas < paul.richard.tho...@gmail.com> wrote: > Hi Mikael, > > You were absolutely right. I looked at the caller and "just didn't get > it". Thanks. I wil

[Patch, fortran] PR114739 [14 Regression] ice in gfc_find_derived_types, at fortran/symbol.cc:2458

2024-04-17 Thread Paul Richard Thomas
This ICE was caused by my patch r14-9489-g3fd46d859cda10. However, the ICE hid a wrong error going back to at least 6.4.1 20180703. The patch fixes both and exposed incorrect error messages in existing tests in gfortran.dg. The fix for these was to add 'IMPLICIT NONE' in call cases so that there re

[Patch, fortran] PR103471 - [11/12/13/14 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114

2024-04-19 Thread Paul Richard Thomas
Hi All, This is a more or less obvious patch. The action is in resolve.cc. The chunk in symbol.cc is a tidy up of a diagnostic marker to distinguish where the 'no IMPLICIT type' error was coming from and the chunk in trans-decl.cc follows from discussion with Harald on the PR. Regtests fine. OK f

Re: [Patch, fortran] PR103471 - [11/12/13/14 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114

2024-04-20 Thread Paul Richard Thomas
Hi Harald, > > the patch is OK, but I had to manually fix it. I wonder how you managed > to produce: > Yes, I had to use --whitespace fix when I reapplied it a few minutes ago. > > diff --git a/gcc/testsuite/gfortran.dg/pr93484.f90 > I had followed comment 1 in the PR and wrongly named the fil

[Patch, fortran] PR89462 - [11/12/13/14 Regression] gfortran loops in code generation

2024-04-23 Thread Paul Richard Thomas
Hi All, Jakub pinpointed the source of this bug in comment 6 of the PR. The rest was 'obvious' :-) I plan to push the patch to mainline in the next 24 hours unless there are opinions to the contrary. Backporting is proposed to occur a couple of weeks later. Best regards Paul Fortran: Generate

Re: [Patch, fortran] PR89462 - [11/12/13/14 Regression] gfortran loops in code generation

2024-04-23 Thread Paul Richard Thomas
more. Paul On Tue, 23 Apr 2024 at 16:25, Paul Richard Thomas < paul.richard.tho...@gmail.com> wrote: > Hi All, > > Jakub pinpointed the source of this bug in comment 6 of the PR. The rest > was 'obvious' :-) > > I plan to push the patch to mainline in the next 24

Re: [Patch, fortran] PR89462 - [11/12/13/14 Regression] gfortran loops in code generation

2024-04-23 Thread Paul Richard Thomas
PS ignore the chunk in trans-array.cc. It is an attempt to fix PR93678 that literally did nothing. Paul On Wed, 24 Apr 2024 at 07:05, Paul Richard Thomas < paul.richard.tho...@gmail.com> wrote: > Hi, > > The linaro pre-commit error testing picked up errors for arm and aarch >

[Patch, fortran] PR93678 - [11/12/13/14 Regression] ICE with TRANSFER and typebound procedures

2024-04-24 Thread Paul Richard Thomas
Hi there, This regression turned out to be low hanging fruit, although it has taken four years to reach it :-( The ChangeLog says it all. OK for mainline and backporting after a suitable delay? Paul Fortran: Fix ICE in gfc_trans_create_temp_array from bad type [PR93678] 2024-04-24 Paul Thomas

  1   2   3   4   5   6   7   8   9   10   >