[Patch v2, fortran] PR fortran/90350 - ubound ICE on assumed size array even though explicit bound is specified

2020-04-21 Thread José Rui Faustino de Sousa via Gcc-patches
Hi again! Proposed patch to Bug 90350 - ubound ICE on assumed size array even though explicit bound is specified Patch tested only on x86_64-pc-linux-gnu. Best regards, José Rui 2020-4-19 José Rui Faustino de Sousa PR fortran/90350 * simplify.c (simplify_bound): In the case of

Re: [Patch, fortran] PR fortran/90350 - ubound ICE on assumed size array even though explicit bound is specified

2020-04-19 Thread José Rui Faustino de Sousa via Gcc-patches
Hi Thomas! > ? In other words, maybe a check on the upper bound > of the last dimension would be better? > You mean enforcing: C928 (R921) The second subscript shall not be omitted from a subscript-triplet in the last dimension of an assumed-size array. right? If I have correctly

[Patch, fortran] PR fortran/90350 - ubound ICE on assumed size array even though explicit bound is specified

2020-04-19 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to Bug 90350 - ubound ICE on assumed size array even though explicit bound is specified Patch tested only on x86_64-pc-linux-gnu. Bumped into the same problem. Probably a better fix would be to add an extra step to the reference chain reflecting that array-section

[Patch, fortran] PR fortran/94327 and PR fortran/94331 Bind(C) problems

2020-03-25 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to: Bug 94327 - Bind(c) argument attributes are incorrectly set and to: Bug 94331 - Bind(C) corrupts array descriptors Patch tested only on x86_64-pc-linux-gnu. Sorry for the double patch but applying them separately would break things. Fixing 94327 is simple, just

Re: [Patch v2, fortran] PR fortran/90350 - ubound ICE on assumed size array even though explicit bound is specified

2020-04-22 Thread José Rui Faustino de Sousa via Gcc-patches
Hi Thomas, On 21/04/20 16:38, Thomas Koenig wrote: Do you have commit privileges? It not, I can commit it for you. No i do not. I would be grateful if you could. Best regards, José Rui

[Patch, fortran] PR fortran/66833,67938,95214 ICE on using assumed rank character array

2020-05-19 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to PRs 66833, 67938 and 95214 ICE(s) on using assumed rank character array in different situations. Patch tested only on x86_64-pc-linux-gnu. Simple patch only add assumed-rank to the list of possible attributes. Thank you very much. Best regards, José Rui

[Patch, fortran] PR fortran/96870 - Class name on error message

2020-08-31 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to PR96870 - Class name on error message. Patch tested only on x86_64-pc-linux-gnu. Make the error message more intelligible for the average user. Thank you very much. Best regards, José Rui 2020-8-21 José Rui Faustino de Sousa gcc/fortran/ChangeLog:

[Patch, fortran] PR fortran/95352 - ICE on select rank with assumed-size selector and lbound intrinsic

2020-08-21 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to PR95352 - ICE on select rank with assumed-size selector and lbound intrinsic. Patch tested only on x86_64-pc-linux-gnu. Add check for NULL pointer before trying to access structure member, patch by Steve Kargl. Thank you very much. Best regards, José Rui

[Patch, fortran] PR fortran/96724 - Bogus warnings with the repeat intrinsic and the flag -Wconversion-extra

2020-08-20 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to PR96724 - Bogus warnings with the repeat intrinsic and the flag -Wconversion-extra. Patch tested only on x86_64-pc-linux-gnu. Add code to force conversion to the default wider integer type before multiplication. Thank you very much. Best regards, José Rui

[Patch, fortran] PR fortran/96727 - ICE with character length specified using specification function on assumed-rank array

2020-08-20 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to PR96727 - ICE with character length specified using specification function on assumed-rank array. Patch tested only on x86_64-pc-linux-gnu. Add missing default error message for the assumed-rank array case. Thank you very much. Best regards, José Rui 2020-8-20

[Patch, fortran] PR fortran/96728 - Fatal Error: Reading module inquiry functions on assumed-rank

2020-08-20 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to PR96728 - Fatal Error: Reading module inquiry functions on assumed-rank. Patch tested only on x86_64-pc-linux-gnu. The rank of the argument to specification functions gets written when writing the module file, but, since the value will be negative for assumed-rank

[Patch, fortran] PR fortran/96726 - ICE with user defined specification function on assumed-rank array

2020-08-20 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to PR96726 - ICE with user defined specification function on assumed-rank array. Patch tested only on x86_64-pc-linux-gnu. Obvious fix, replace different operator with less than to avoid infinite loop. Thank you very much. Best regards, José Rui 2020-8-20 José

[Patch, fortran] PR fortran/94110 - Passing an assumed-size to an assumed-shape argument should be rejected

2020-08-20 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to PR94110 - Passing an assumed-size to an assumed-shape argument should be rejected. Patch tested only on x86_64-pc-linux-gnu. Add code to also check for deferred-shape and assumed-rank pointer (allocatable arguments are checked elsewhere) dummy arguments being

Re: [Patch, fortran, v2] PR fortran/96728 - Fatal Error: Reading module inquiry functions on assumed-rank

2020-08-20 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Exactly the same thing, only actually including the patch this time. Sorry for the mishap. Thank you very much. Best regards, José Rui On 20/08/20 19:33, José Rui Faustino de Sousa wrote: Hi all! Proposed patch to PR96728 - Fatal Error: Reading module inquiry functions on

[Patch, fortran] PR fortran/95331 - Unlimited polymorphic arrays have wrong bounds

2020-05-26 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to PR95331 - Unlimited polymorphic arrays have wrong bounds. Patch tested only on x86_64-pc-linux-gnu. When iterating over a class array use the bounds provided by the transformed descriptor (in sym->backend_decl) instead of the original bounds of the array (in the

[Patch, fortran] PR fortran/52351, 85868 Wrong array section bounds when passing to an intent-in pointer dummy

2020-05-26 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to PRs 52351, 85868 Wrong array section bounds when passing to an intent-in pointer dummy. Patch tested only on x86_64-pc-linux-gnu. Add code to allow for the creation a new descriptor for array sections with the correct one based indexing. Rework the generated

[Patch, fortran] PR fortran/94022 - Array slices of assumed-size arrays

2020-06-03 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to Bug 94022 - Array slices of assumed-size arrays. Patch tested only on x86_64-pc-linux-gnu. Make sure that when passing array sections of assumed-size arrays to procedures expecting an assumed-rank array the upper bound of the last dimension of the array section does

[Patch, fortran V2] PR fortran/100683 - Array initialization refuses valid

2021-06-14 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Update to a proposed patch to: PR100683 - Array initialization refuses valid due to errors found by Dominique d'Humieres. Patch tested only on x86_64-pc-linux-gnu. Add call to simplify expression before parsing *and* check if the expression is still an array after simplification.

PING: [Patch, fortran v2] PR fortran/92621 Problems with memory handling with allocatable intent(out) arrays with bind(c)

2021-06-14 Thread José Rui Faustino de Sousa via Gcc-patches
*PING* Forwarded Message Subject: [Patch, fortran v2] PR fortran/92621 Problems with memory handling with allocatable intent(out) arrays with bind(c) Date: Mon, 26 Apr 2021 11:21:25 + From: José Rui Faustino de Sousa To: fort...@gcc.gnu.org, gcc-patches@gcc.gnu.org Hi

[Patch, fortran V2] PR fortran/93308/93963/94327/94331/97046 problems raised by descriptor handling

2021-06-14 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Update to a proposed patch to: Bug 93308 - bind(c) subroutine changes lower bound of array argument in caller Bug 93963 - Select rank mishandling allocatable and pointer arguments with bind(c) Bug 94327 - Bind(c) argument attributes are incorrectly set Bug 94331 - Bind(C) corrupts

[Patch, fortran] PR fortran/94104 - Request for diagnostic improvement

2021-06-14 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to: Bug 94104 - Request for diagnostic improvement Patch tested only on x86_64-pc-linux-gnu. Error message improvement. In Fortran 2008 actual arguments to procedures having a pointer, with intent attribute in, formal argument can also have the target attribute not

PING: [Patch, fortran] PR fortran/96870 - Class name on error message

2021-06-16 Thread José Rui Faustino de Sousa via Gcc-patches
*PING* Forwarded Message Subject: [Patch, fortran] PR fortran/96870 - Class name on error message Date: Mon, 31 Aug 2020 16:09:32 + From: José Rui Faustino de Sousa To: fort...@gcc.gnu.org, gcc-patches@gcc.gnu.org Hi all! Proposed patch to PR96870 - Class name on error

[Patch, fortran V2] PR fortran/100097 PR fortran/100098 - [Unlimited] polymorphic pointers and allocatables have incorrect rank

2021-06-16 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to: PR100097 - Unlimited polymorphic pointers and allocatables have incorrect rank PR100098 - Polymorphic pointers and allocatables have incorrect rank Patch tested only on x86_64-pc-linux-gnu. Version 2 no longer re-initializes explicit initialized variables, which

PING: [Patch, fortran] PR fortran/96724 - Bogus warnings with the repeat intrinsic and the flag -Wconversion-extra

2021-06-16 Thread José Rui Faustino de Sousa via Gcc-patches
*PING* Forwarded Message Subject: [Patch, fortran] PR fortran/96724 - Bogus warnings with the repeat intrinsic and the flag -Wconversion-extra Date: Thu, 20 Aug 2020 16:52:10 + From: José Rui Faustino de Sousa To: fort...@gcc.gnu.org, gcc-patches@gcc.gnu.org Hi all!

Re: [Patch, fortran] PR fortran/101047/101048 Pointer explicit initialization

2021-06-13 Thread José Rui Faustino de Sousa via Gcc-patches
On 13/06/21 15:46, José Rui Faustino de Sousa wrote: Hi All! Proposed patch to: And again I forgot to add the patch... Sorry for the inconvenience. Best regards, José Rui diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index 93118ad..5670d18 100644 --- a/gcc/fortran/class.c +++

[Patch, fortran] PR fortran/101047/101048 Pointer explicit initialization

2021-06-13 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to: Bug 101047 - Pointer explicit initialization fails Bug 101048 - Class pointer explicit initialization refuses valid Patch tested only on x86_64-pc-linux-gnu. This patch deals with implementation of explicit initialization for pointer variables. It basically

[Patch, fortran] PR fortran/100948 - [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069

2021-06-13 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed partial patch to: Bug 100948 - [12 Regression] ICE in gfc_conv_expr_val, at fortran/trans-expr.c:9069 Patch tested only on x86_64-pc-linux-gnu. Reuse previously calculated full string length to set string section default upper bound. This patch only fixes the ICE the

[Patch, fortran V3] PR fortran/100683 - Array initialization refuses valid

2021-06-17 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Update to a proposed patch to: PR100683 - Array initialization refuses valid due to more errors being found... Patch tested only on x86_64-pc-linux-gnu. Add call to simplify expression before parsing *and* check *appropriately* if the expression is still an array after

Re: [Patch, fortran V2] PR fortran/93308/93963/94327/94331/97046 problems raised by descriptor handling

2021-06-21 Thread José Rui Faustino de Sousa via Gcc-patches
Hi Tobias, On 21/06/21 16:46, Tobias Burnus wrote: Well, as said: directly into the compiler where currently the call to libgomp is. > I don't think I understand were you mean. You don't mean the includes in "f95-lang.c" do you? Best regards, José Rui

Re: [Patch, fortran V3] PR fortran/100683 - Array initialization refuses valid

2021-06-21 Thread José Rui Faustino de Sousa via Gcc-patches
Hi Tobias, On 21/06/21 12:37, Tobias Burnus wrote: Thus: Do you have a list of patches pending review? > https://gcc.gnu.org/pipermail/fortran/2021-April/055924.html https://gcc.gnu.org/pipermail/fortran/2021-April/055933.html https://gcc.gnu.org/pipermail/fortran/2021-June/056168.html

Re: [Patch, fortran V2] PR fortran/93308/93963/94327/94331/97046 problems raised by descriptor handling

2021-06-21 Thread José Rui Faustino de Sousa via Gcc-patches
On 21/06/21 13:46, Tobias Burnus wrote: Hi José, (in principle, I'd like to have the libgfortran function moved to the compiler proper to avoid some issues, but that's admittedly a task independent of your work.) cfi_desc_to_gfc_desc and gfc_desc_to_cfi_desc from ISO_c_binding.c, right?

[Patch, fortran] PR fortran/100120/100816/100818/100819/100821 problems raised by aggregate data types

2021-05-28 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to: Bug 100120 - associated intrinsic failure Bug 100816 - Wrong span on widechar Bug 100818 - A temporary is passed to associated Bug 100819 - Wrong code generation with unlimited polymorphic objects and character type Bug 100821 - Deferred character with wrong length

[Patch, fortran] PR fortran/100683 - Array initialization refuses valid

2021-05-19 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to: PR100683 - Array initialization refuses valid Patch tested only on x86_64-pc-linux-gnu. Add call to simplify expression before parsing. Thank you very much. Best regards, José Rui Fortran: Fix bogus error gcc/fortran/ChangeLog: PR fortran/100683

[Patch, fortran] PR fortran/93308/93963/94327/94331/97046 problems raised by descriptor handling

2021-05-19 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to: Bug 93308 - bind(c) subroutine changes lower bound of array argument in caller Bug 93963 - Select rank mishandling allocatable and pointer arguments with bind(c) Bug 94327 - Bind(c) argument attributes are incorrectly set Bug 94331 - Bind(C) corrupts array

Re: [Patch, fortran] PR fortran/100683 - Array initialization refuses valid

2021-05-19 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! And yes I forgot the patch... Sorry... Best regards, José Rui On 19/05/21 17:09, José Rui Faustino de Sousa wrote: Hi all! Proposed patch to: PR100683 - Array initialization refuses valid Patch tested only on x86_64-pc-linux-gnu. Add call to simplify expression before parsing.

[Patch, fortran v2] PR fortran/92621 Problems with memory handling with allocatable intent(out) arrays with bind(c)

2021-04-26 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to: PR92621 - Problems with memory handling with allocatable intent(out) arrays with bind(c) Patch tested only on x86_64-pc-linux-gnu. The code currently generated tries to deallocate the undefined artificial cfi.n pointer before it is associated with the allocatable

[Patch, fortran] PR fortran/100245 - ICE on automatic reallocation

2021-04-24 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to: PR100245 - ICE on automatic reallocation. Patch tested only on x86_64-pc-linux-gnu. Add an if clause for handling derived types in the left hand side. Thank you very much. Best regards, José Rui Fortran: Fix ICE with automatic reallocation [PR100136]

[Patch, fortran] PR fortran/82376 - Duplicate function call using -fcheck=pointer

2021-04-22 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to: PR82376 - Duplicate function call using -fcheck=pointer Patch tested only on x86_64-pc-linux-gnu. Evaluate function result and then pass a pointer, instead of a reference to the function itself, thus avoiding multiple evaluations of the function. Thank you very

[Patch, fortran] PR fortran/100029 - ICE on storage_size with polymorphic argument, PR fortran/100040 - Wrong code with intent out assumed-rank allocatable

2021-04-11 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to: PR100040 - Wrong code with intent out assumed-rank allocatable PR100029 - ICE on subroutine call with allocatable polymorphic assumed-rank argument Patch tested only on x86_64-pc-linux-gnu. Made sure the code also recognized assumed-rank arrays as full arrays.

[Patch, fortran] PR fortran/100094 - Undefined pointers have incorrect rank when using optimization

2021-04-15 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to: PR100094 - Undefined pointers have incorrect rank when using optimization Patch tested only on x86_64-pc-linux-gnu. Pointers, and allocatables, must carry TKR information even when undefined. The patch adds code to initialize both pointers and allocatables element

Patch, fortran] PR fortran/100097 PR fortran/100098 - [Unlimited] polymorphic pointers and allocatables have incorrect rank

2021-04-15 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to: PR100097 - Unlimited polymorphic pointers and allocatables have incorrect rank PR100098 - Polymorphic pointers and allocatables have incorrect rank Patch tested only on x86_64-pc-linux-gnu. Pointers, and allocatables, must carry TKR information even when

Patch, fortran] PR fortran/100103 - Automatic reallocation fails inside select rank

2021-04-15 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to: PR100103 - Automatic reallocation fails inside select rank Patch tested only on x86_64-pc-linux-gnu. Add select rank temporary associated names as possible targets of automatic reallocation. The patch depends on PR100097 and PR100098. Thank you very much. Best

[Patch, fortran] PR fortran/100024 PR fortran/100025 ICE on subroutine missing explicit interface

2021-04-10 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to PR100024 & PR100025 - ICE on missing polymorphic argument. Patch tested only on x86_64-pc-linux-gnu. Remove assertion checking for possible assumed rank arrays and added an explicit error message. Change if clause to allow the handling of assumed-rank arrays as

Re: [Patch, fortran] PR fortran/100018 - ICE on missing polymorphic argument

2021-04-10 Thread José Rui Faustino de Sousa via Gcc-patches
On 10/04/21 17:37, Tobias Burnus wrote: And you need an additional single-line summary for git – which should be part of the patch submission. Fortran: Fix ICE due to referencing a NULL pointer [PR100018] gcc/fortran/ChangeLog: PR fortran/100018 * resolve.c: Add association check

[Patch, fortran] PR fortran/84006, PR fortran/100027 - ICE on storage_size with polymorphic argument

2021-04-10 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to: PR84006 - [8/9/10/11 Regression] ICE in storage_size() with CLASS entity PR100027 - ICE on storage_size with polymorphic argument Patch tested only on x86_64-pc-linux-gnu. Add branch to if clause to handle polymorphic objects, not sure if I got all possible

[Patch, fortran] PR fortran/100018 - ICE on missing polymorphic argument

2021-04-10 Thread José Rui Faustino de Sousa via Gcc-patches
Hi all! Proposed patch to PR100018 - ICE on missing polymorphic argument. Patch tested only on x86_64-pc-linux-gnu. Add association check before de-referencing pointer in order to avoid ICE. Thank you very much. Best regards, José Rui 2021-4-10 José Rui Faustino de Sousa

Patch, fortran] PR fortran/100120 - associated intrinsic failure

2021-04-16 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to: PR100120 - associated intrinsic failure Patch tested only on x86_64-pc-linux-gnu. Add code to ensure that pointers have the correct dynamic type. The patch depends on PR100097 and PR100098. Thank you very much. Best regards, José Rui Fortran: Fix associated

[Patch, fortran] PR fortran/100132 - Optimization breaks pointer association

2021-04-17 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to: PR100132 - Optimization breaks pointer association. Patch tested only on x86_64-pc-linux-gnu. Correct pointer attributes when passing polymorphic pointers. Thank you very much. Best regards, José Rui Fortran: Fix function attributes [PR100132]

[Patch, fortran v2] PR fortran/84006, PR fortran/100027 - ICE on storage_size with polymorphic argument

2021-04-16 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to: PR84006 - [8/9/10/11 Regression] ICE in storage_size() with CLASS entity PR100027 - ICE on storage_size with polymorphic argument Patch tested only on x86_64-pc-linux-gnu. Add branch to if clause to handle polymorphic objects, not sure if I got all possible

[Patch, fortran] PR fortran/100136 - ICE, regression, using flag -fcheck=pointer

2021-04-18 Thread José Rui Faustino de Sousa via Gcc-patches
Hi All! Proposed patch to: PR100136 - ICE, regression, using flag -fcheck=pointer Patch tested only on x86_64-pc-linux-gnu. Add handling for pointer expressions. Thank you very much. Best regards, José Rui Fortran: Fix ICE with -fcheck=pointer [PR100136] gcc/fortran/ChangeLog: PR