assumed size

2024-06-18 Thread Martin Uecker
Hi all, I am working paper for the following syntax extension int a[10]; int (*a)[*] = &a; This would not be a wide pointer, it will just initialize the size of the type from the initializer. This would also work for VM type. So the result is a conventional pointer to an arrays and either a

[PATCH 13/14] OpenACC: Allow implicit uses of assumed-size arrays in offload regions

2023-06-19 Thread Julian Brown
This patch reimplements the functionality of the previously-reverted patch "Assumed-size arrays with non-lexical data mappings". The purpose is to support implicit uses of assumed-size arrays for Fortran when those arrays have already been mapped on the target some other way (e.g. by

[PATCH 01/14] Revert "Assumed-size arrays with non-lexical data mappings"

2023-06-19 Thread Julian Brown
This reverts commit 72733f6e6f6ec1bb9884fea8bfbebd3de03d9374. 2023-06-16 Julian Brown gcc/ Revert: * gimplify.cc (gimplify_adjust_omp_clauses_1): Raise error for assumed-size arrays in map clauses for Fortran/OpenMP. * omp-low.cc (lower_omp_target): Set the

Re: [PATCH] Fortran: rank checking with explicit-/assumed-size arrays and CLASS [PR58331]

2023-03-15 Thread Harald Anlauf via Gcc-patches
Hi Tobias, Am 15.03.23 um 10:10 schrieb Tobias Burnus: Hi Harald, On 14.03.23 20:38, Harald Anlauf wrote: The testcase covers only non-coarray cases, as playing with coarray variants hit pre-exisiting issues in gfortran that are very likely unrelated to the interface checks. I concur (but wou

Re: [PATCH] Fortran: rank checking with explicit-/assumed-size arrays and CLASS [PR58331]

2023-03-15 Thread Tobias Burnus
Hi Harald, On 14.03.23 20:38, Harald Anlauf wrote: The testcase covers only non-coarray cases, as playing with coarray variants hit pre-exisiting issues in gfortran that are very likely unrelated to the interface checks. I concur (but would not rule out additional interface issues). I consider

[PATCH] Fortran: rank checking with explicit-/assumed-size arrays and CLASS [PR58331]

2023-03-14 Thread Harald Anlauf via Gcc-patches
:23:06 +0100 Subject: [PATCH] Fortran: rank checking with explicit-/assumed-size arrays and CLASS [PR58331] gcc/fortran/ChangeLog: PR fortran/58331 * interface.cc (compare_parameter): Adjust check of array dummy arguments to handle the case of CLASS variables. gcc/testsuite/ChangeLog: PR

Re: [PATCH, committed] Fortran: error recovery on invalid assumed size reference [PR104554]

2023-02-15 Thread Steve Kargl via Gcc-patches
On Wed, Feb 15, 2023 at 10:28:00PM +0100, Harald Anlauf via Fortran wrote: > Dear all, > > I've committed the attached obvious and trivial patch for a NULL > pointer dereference on behalf of Steve and after regtesting on > x86_64-pc-linux-gnu as r13-6066-ga418129273725fd02e881e6fb5e0877287a1356c >

[PATCH, committed] Fortran: error recovery on invalid assumed size reference [PR104554]

2023-02-15 Thread Harald Anlauf via Gcc-patches
00:00 2001 From: Steve Kargl Date: Wed, 15 Feb 2023 22:20:22 +0100 Subject: [PATCH] Fortran: error recovery on invalid assumed size reference [PR104554] gcc/fortran/ChangeLog: PR fortran/104554 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer dereference. gcc/testsuite/ChangeLog:

Re: [PATCH] Fortran: improve checking of assumed size array spec [PR102180]

2022-12-12 Thread Steve Kargl via Gcc-patches
if (gfc_peek_ascii_char () == '*') > + { > + /* F2018:R821: "assumed-implied-spec is [ lower-bound : ] *". */ > + gfc_error ("A lower bound must precede colon in " > + "assumed-size array speci

Re: [PATCH] Fortran: improve checking of assumed size array spec [PR102180]

2022-12-12 Thread Harald Anlauf via Gcc-patches
Hi Steve, Am 12.12.22 um 00:52 schrieb Steve Kargl via Gcc-patches: On Sun, Dec 11, 2022 at 11:33:43PM +0100, Harald Anlauf via Fortran wrote: Dear all, the attached patch improves checking of array specs in two ways: - bad assumed size array spec - a bad first array element spec may already

Re: [PATCH] Fortran: improve checking of assumed size array spec [PR102180]

2022-12-11 Thread Steve Kargl via Gcc-patches
On Sun, Dec 11, 2022 at 11:33:43PM +0100, Harald Anlauf via Fortran wrote: > Dear all, > > the attached patch improves checking of array specs in two ways: > - bad assumed size array spec > - a bad first array element spec may already trigger an error, > leading to a more c

[PATCH] Fortran: improve checking of assumed size array spec [PR102180]

2022-12-11 Thread Harald Anlauf via Gcc-patches
Dear all, the attached patch improves checking of array specs in two ways: - bad assumed size array spec - a bad first array element spec may already trigger an error, leading to a more consistent behavior Regtested on x86_64-pc-linux-gnu. OK for mainline? Thanks, Harald From

Re: [Patch] OpenMP/Fortran: Permit assumed-size arrays in uniform clause

2022-07-29 Thread Jakub Jelinek via Gcc-patches
On Fri, Jul 29, 2022 at 11:47:54AM +0200, Tobias Burnus wrote: > Testcase wise, the run-time testcase libgomp.fortran/examples-4/simd-2.f90 > checks essentially the same, except that it uses an array-descriptor array > (assumed shape) while this testcase uses an assumed-size array. >

[Patch] OpenMP/Fortran: Permit assumed-size arrays in uniform clause

2022-07-29 Thread Tobias Burnus
Testcase wise, the run-time testcase libgomp.fortran/examples-4/simd-2.f90 checks essentially the same, except that it uses an array-descriptor array (assumed shape) while this testcase uses an assumed-size array. I decided for an extra compile-time only testcase, but it could be also be moved

Re: [Patch] Fortran: Fix assumed-size to assumed-rank passing [PR94070]

2021-09-28 Thread Harald Anlauf via Gcc-patches
h case (i) for each dim. Thus: > > "If DIM is present, > ARRAY is a whole array, > and either ARRAY is an assumed-size array of rank DIM > or dimension DIM of ARRAY has nonzero extent, > the result has a value equal to the lower bound for subscript DIM of ARRAY. >

Re: [Patch] Fortran: Fix assumed-size to assumed-rank passing [PR94070]

2021-09-28 Thread Thomas Schwinge
ERRORs: Running /scratch/tschwing/build2-trusty-cs/gcc/build/submit-big/source-gcc/gcc/testsuite/gfortran.dg/dg.exp ... +ERROR: c_assumed num=100: x->dim[2].extent = -1 != 0 +ERROR: c_assumed num=100: x->dim[2].extent = -1 != 0 +ERROR: c_assumed num=100: x->dim[2].extent = -1

Re: [committed] libgomp.oacc-fortran/privatized-ref-2.f90: Fix dg-note (was: [Patch] Fortran: Fix assumed-size to assumed-rank passing [PR94070])

2021-09-28 Thread Thomas Schwinge
27;ve pushed to master branch commit a43ae03a053faad871e6f48099d21e64b8e316cf 'Further test case adjustment re "Fortran: Fix assumed-size to assumed-rank passing"', see attached. Grüße Thomas - Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesell

Re: [Patch] Fortran: Fix assumed-size to assumed-rank passing [PR94070]

2021-09-27 Thread Tobias Burnus
nt the following. The case without 'dim' just iterates through case (i) for each dim. Thus: "If DIM is present, ARRAY is a whole array, and either ARRAY is an assumed-size array of rank DIM or dimension DIM of ARRAY has nonzero extent, the result has a value equal to the lower

Re: [Patch] Fortran: Fix assumed-size to assumed-rank passing [PR94070]

2021-09-27 Thread Harald Anlauf via Gcc-patches
has:  'Otherwise, if DIM is present, the result has a value equal to the   number of elements in dimension DIM of ARRAY.' And lbound(a,dim=1) == 1 due to the "otherwise" case of F2018:16.9.109 LBOUND: "Case (i): If DIM is present, ARRAY is a whole array, and either  ARRA

[committed] libgomp.oacc-fortran/privatized-ref-2.f90: Fix dg-note (was: [Patch] Fortran: Fix assumed-size to assumed-rank passing [PR94070])

2021-09-27 Thread Tobias Burnus
On 27.09.21 14:07, Tobias Burnus wrote: now committed r12-3897-g00f6de9c69119594f7dad3bd525937c94c8200d0 I accidentally changed dg-note to dg-message when updating the expected output, as the dump has changed. (Copying seemingly the sorry line instead of the dg-note lines as template.) Changed

Re: [Patch] Fortran: Fix assumed-size to assumed-rank passing [PR94070]

2021-09-27 Thread Tobias Burnus
to the "otherwise" case of F2018:16.9.109 LBOUND: "Case (i): If DIM is present, ARRAY is a whole array, and either ARRAY is an assumed-size array of rank DIM or dimension DIM of ARRAY has nonzero extent, the result has a value equal to the lower bound for subscript DIM of ARRAY. Other

Re: [Patch] Fortran: Fix assumed-size to assumed-rank passing [PR94070]

2021-09-24 Thread Thomas Koenig via Gcc-patches
Hi Tobias, OK for mainline? As promised on IRC, here's the review. Maybe you can add a test case which shows that the call to the size intrinsic really does not happen. OK with that. Thanks for the patch! Best regards Thomas

[Patch] Fortran: Fix assumed-size to assumed-rank passing [PR94070]

2021-09-21 Thread Tobias Burnus
now - and reviewing this patch first makes more sense. size(a,dim=i) of an array is simply: a.dim[i].ubound - a.dim[i].lbound + 1 except that the result is always >= 0, i.e. a(5:-10) has size 0. Assumed-size arrays like as(5, -3:*) can be passed to assumed-rank arrays – but, obviously,

Re: [Patch] Fortran/OpenMP: Fix use_device_{ptr,addr} with assumed-size array [PR98858]

2021-03-12 Thread Jakub Jelinek via Gcc-patches
On Thu, Mar 11, 2021 at 02:44:38PM +0100, Tobias Burnus wrote: > Fortran/OpenMP: Fix use_device_{ptr,addr} with assumed-size array [PR98858] > > gcc/ChangeLog: > > PR fortran/98858 > * gimplify.c (omp_add_variable): Handle NULL_TREE as size > occuring for a

[Patch] Fortran/OpenMP: Fix use_device_{ptr,addr} with assumed-size array [PR98858]

2021-03-11 Thread Tobias Burnus
The ICE occurs because the 't' == NULL for assumed-size arrays. For them, the size is not known – but as this should only occur for use_device_{addr,ptr}, the size is not needed. OK for mainline? Tobias - Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 806

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

2020-08-21 Thread Thomas Koenig via Gcc-patches
Hi Jose, 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. this is OK, but you'll have to adjust

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

2020-08-21 Thread Thomas Koenig via Gcc-patches
Hi Jose, Proposed patch to PR94110 - Passing an assumed-size to an assumed-shape argument should be rejected. OK for master. Thanks a lot for the patch! Best regards Thomas

[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 2020

[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] PR fortran/94022 - Array slices of assumed-size arrays

2020-06-11 Thread Thomas Koenig via Gcc-patches
Hi Jose, Proposed patch to Bug 94022 - Array slices of assumed-size arrays. Patch tested only on x86_64-pc-linux-gnu. Reviewed, regression-tested and commited as r11-1228-g6a07010b774cb5a0b1790b857e69d3d8534eebd2 . Thanks for the patch! Regards Thomas

[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

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

2020-04-22 Thread Thomas Koenig via Gcc-patches
Hi Jose, 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. Done, as https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=808a6eadda1a353ce3a70556feac128580491b24 . Thanks a lot for the patch

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

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

2020-04-21 Thread Thomas Koenig via Gcc-patches
Hi Jose, 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 Looks good. Do you have commit privileges? It not, I can commit it for you. Regards Thomas

[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 assumed

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

2020-04-20 Thread Thomas Koenig via Gcc-patches
the last dimension of an assumed-size array. right? If I have correctly understood the way things are done this is a more general test which is already done at resolve.c around line 4690. I just checked that it works, so I think this is fine. It looks like assumed_size_refs_4.f90 already checks

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

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

2020-04-19 Thread Thomas Koenig via Gcc-patches
Hi Jose, first, thanks for coming on board! A question: Do you have a copyright assignment yet? This patch is probably short enough that it can be accepted without it, but if you're planning to contribute more (which I certainly hope) then it would make sense to do this. Regarding your patch,

[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

[og9] OpenACC assumed-size arrays with non-lexical data mappings

2019-07-09 Thread Julian Brown
cc-gcc-9-branch shortly. Julian ChangeLog 2019-07-10 Cesar Philippidis Thomas Schwinge Julian Brown gcc/ * gimplify.c (gimplify_adjust_omp_clauses_1): Raise error for assumed-size arrays in map clauses for Fortran/OpenMP.

[patch, fortran, committed] Set rank and lower bound for assumed size arguments

2019-05-26 Thread Thomas Koenig
ch as obvious and simple, r271630. Regards Thomas 2019-05-26 Thomas Koenig PR fortran/90539 * trans-types.c (get_formal_from_actual_arglist): Set rank and lower bound for assumed size arguments. Index: trans-ty

Re: *ping* [patch, fortran] Fix handling of assumed-size arrays in inline matmul

2018-02-17 Thread Jerry DeLisle
On 02/17/2018 06:22 AM, Thomas Koenig wrote: Am 12.02.2018 um 11:46 schrieb Thomas Koenig: Hello world, the attached patch fixes a regression where a rejects-valid would be issued. OK for the affected branches, trunk and gcc-7? PING ** (5.D0/7.D0) ? Yes, OK Jerry

*ping* [patch, fortran] Fix handling of assumed-size arrays in inline matmul

2018-02-17 Thread Thomas Koenig
Am 12.02.2018 um 11:46 schrieb Thomas Koenig: Hello world, the attached patch fixes a regression where a rejects-valid would be issued. OK for the affected branches, trunk and gcc-7? PING ** (5.D0/7.D0) ?

[patch, fortran] Fix handling of assumed-size arrays in inline matmul

2018-02-12 Thread Thomas Koenig
assumed size array, leave in the last reference and pass AR_SECTION instead of AR_FULL to gfc_resolve in order to avoid an error. 2018-02-12 Thomas Koenig PR fortran/84270 * gfortran.dg/inline_matmul_22.f90: New test. Index: frontend-passes.c

Re: [gomp4] fix an ICE involving assumed-size arrays

2017-07-03 Thread Thomas Schwinge
case > of assumed-size arrays, the size of the type may be NULL because its > undefined. My fix for this solution is to set the size to one byte if > the size of the type is NULL. This solution at least allows the runtime > the opportunity to remap any data already present on the accelerat

[committed] Disallow explicit or implicit OpenMP mapping of assumed-size arrays (PR fortran/78866)

2016-12-21 Thread Jakub Jelinek
Hi! At least in my reading of the standard OpenMP 4.[05] does not disallow explicit or implicit mapping of assumed-size arrays, but it is IMNSHO a defect in the standard, it is something that can't be really supported because the compiler does not know the size of the assumed size array.

[gomp4] fix an ICE involving assumed-size arrays

2016-08-30 Thread Cesar Philippidis
Usually a data clause would would have OMP_CLAUSE_SIZE set, but not all do. In the latter case, lower_omp_target falls back to using size of the type of the variable specified in the data clause. However, in the case of assumed-size arrays, the size of the type may be NULL because its undefined

[Patch, Fortran, committed] PR 54189: ICE (segfault) with invalid assumed-size dummy

2013-05-30 Thread Janus Weil
Hi all, I have just committed as obvious a small ICE-on-invalid fix: http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=199445 Cheers, Janus