Re: [PATCH v2 0/3] libgfortran: empty array fixes

2023-11-08 Thread Mikael Morin

Le 07/11/2023 à 19:16, Harald Anlauf a écrit :

Hi Mikael,

this is OK.

Thanks for the patches!

Harald



Patches pushed.
Thanks for the (fruitful) review.


Re: [PATCH v2 0/3] libgfortran: empty array fixes

2023-11-07 Thread Harald Anlauf

Hi Mikael,

this is OK.

Thanks for the patches!

Harald

On 11/7/23 11:24, Mikael Morin wrote:

Hello,

Harald's review of the previous version [1] of these patches spotted a possible
misbehaving case in one patch, and a latent bug in the area of the second
patch.
So here is the second try, bootstraped and regression tested on 
x86_64-pc-linux-gnu.
OK for master?

Mikael

[1]:
https://gcc.gnu.org/pipermail/fortran/2023-November/059896.html
https://gcc.gnu.org/pipermail/gcc-patches/2023-November/635305.html

Changes from version 1:
  * Add patch 1/3 to the series fixing the unallocated empty result issue.
  * In patch 2/3 (formerly 1/2) clamp negative extent to zero.


Mikael Morin (3):
   libgfortran: Don't skip allocation if size is zero [PR112412]
   libgfortran: Remove early return if extent is zero [PR112371]
   libgfortran: Remove empty array descriptor first dimension overwrite
 [PR112371]

  gcc/testsuite/gfortran.dg/allocated_4.f90 | 195 +++
  gcc/testsuite/gfortran.dg/bound_10.f90| 207 
  gcc/testsuite/gfortran.dg/bound_11.f90| 588 ++
  libgfortran/generated/all_l1.c|   9 +-
  libgfortran/generated/all_l16.c   |   9 +-
  libgfortran/generated/all_l2.c|   9 +-
  libgfortran/generated/all_l4.c|   9 +-
  libgfortran/generated/all_l8.c|   9 +-
  libgfortran/generated/any_l1.c|   9 +-
  libgfortran/generated/any_l16.c   |   9 +-
  libgfortran/generated/any_l2.c|   9 +-
  libgfortran/generated/any_l4.c|   9 +-
  libgfortran/generated/any_l8.c|   9 +-
  libgfortran/generated/count_16_l.c|   9 +-
  libgfortran/generated/count_1_l.c |   9 +-
  libgfortran/generated/count_2_l.c |   9 +-
  libgfortran/generated/count_4_l.c |   9 +-
  libgfortran/generated/count_8_l.c |   9 +-
  libgfortran/generated/findloc1_c10.c  |  18 +-
  libgfortran/generated/findloc1_c16.c  |  18 +-
  libgfortran/generated/findloc1_c17.c  |  18 +-
  libgfortran/generated/findloc1_c4.c   |  18 +-
  libgfortran/generated/findloc1_c8.c   |  18 +-
  libgfortran/generated/findloc1_i1.c   |  18 +-
  libgfortran/generated/findloc1_i16.c  |  18 +-
  libgfortran/generated/findloc1_i2.c   |  18 +-
  libgfortran/generated/findloc1_i4.c   |  18 +-
  libgfortran/generated/findloc1_i8.c   |  18 +-
  libgfortran/generated/findloc1_r10.c  |  18 +-
  libgfortran/generated/findloc1_r16.c  |  18 +-
  libgfortran/generated/findloc1_r17.c  |  18 +-
  libgfortran/generated/findloc1_r4.c   |  18 +-
  libgfortran/generated/findloc1_r8.c   |  18 +-
  libgfortran/generated/findloc1_s1.c   |  18 +-
  libgfortran/generated/findloc1_s4.c   |  18 +-
  libgfortran/generated/iall_i1.c   |  30 +-
  libgfortran/generated/iall_i16.c  |  30 +-
  libgfortran/generated/iall_i2.c   |  30 +-
  libgfortran/generated/iall_i4.c   |  30 +-
  libgfortran/generated/iall_i8.c   |  30 +-
  libgfortran/generated/iany_i1.c   |  30 +-
  libgfortran/generated/iany_i16.c  |  30 +-
  libgfortran/generated/iany_i2.c   |  30 +-
  libgfortran/generated/iany_i4.c   |  30 +-
  libgfortran/generated/iany_i8.c   |  30 +-
  libgfortran/generated/iparity_i1.c|  30 +-
  libgfortran/generated/iparity_i16.c   |  30 +-
  libgfortran/generated/iparity_i2.c|  30 +-
  libgfortran/generated/iparity_i4.c|  30 +-
  libgfortran/generated/iparity_i8.c|  30 +-
  libgfortran/generated/maxloc1_16_i1.c |  30 +-
  libgfortran/generated/maxloc1_16_i16.c|  30 +-
  libgfortran/generated/maxloc1_16_i2.c |  30 +-
  libgfortran/generated/maxloc1_16_i4.c |  30 +-
  libgfortran/generated/maxloc1_16_i8.c |  30 +-
  libgfortran/generated/maxloc1_16_r10.c|  30 +-
  libgfortran/generated/maxloc1_16_r16.c|  30 +-
  libgfortran/generated/maxloc1_16_r17.c|  30 +-
  libgfortran/generated/maxloc1_16_r4.c |  30 +-
  libgfortran/generated/maxloc1_16_r8.c |  30 +-
  libgfortran/generated/maxloc1_16_s1.c |  30 +-
  libgfortran/generated/maxloc1_16_s4.c |  30 +-
  libgfortran/generated/maxloc1_4_i1.c  |  30 +-
  libgfortran/generated/maxloc1_4_i16.c |  30 +-
  libgfortran/generated/maxloc1_4_i2.c  |  30 +-
  libgfortran/generated/maxloc1_4_i4.c  |  30 +-
  libgfortran/generated/maxloc1_4_i8.c  |  30 +-
  libgfortran/generated/maxloc1_4_r10.c |  30 +-
  libgfortran/generated/maxloc1_4_r16.c |  30 +-
  libgfortran/generated/maxloc1_4_r17.c |  30 +-
  libgfortran/generated/maxloc1_4_r4.c  |  30 +-
  libgfortran/generated/maxloc1_4_r8.c  |  30 +-
  libgfortran/generated/maxloc1_4_s1.c  |  30 +-
  libgfortran/generated/maxloc1_4_s4.c  |  30 +-
  libgfortran/generated/maxloc1_8_i1.c  |  30 +-
  libgfortran/generated/maxloc1_8_i16.c |  30 +-
  libgfortran/generated/

[PATCH v2 0/3] libgfortran: empty array fixes

2023-11-07 Thread Mikael Morin
Hello,

Harald's review of the previous version [1] of these patches spotted a possible
misbehaving case in one patch, and a latent bug in the area of the second
patch.
So here is the second try, bootstraped and regression tested on 
x86_64-pc-linux-gnu.
OK for master?

Mikael

[1]:
https://gcc.gnu.org/pipermail/fortran/2023-November/059896.html
https://gcc.gnu.org/pipermail/gcc-patches/2023-November/635305.html

Changes from version 1:
 * Add patch 1/3 to the series fixing the unallocated empty result issue.
 * In patch 2/3 (formerly 1/2) clamp negative extent to zero.


Mikael Morin (3):
  libgfortran: Don't skip allocation if size is zero [PR112412]
  libgfortran: Remove early return if extent is zero [PR112371]
  libgfortran: Remove empty array descriptor first dimension overwrite
[PR112371]

 gcc/testsuite/gfortran.dg/allocated_4.f90 | 195 +++
 gcc/testsuite/gfortran.dg/bound_10.f90| 207 
 gcc/testsuite/gfortran.dg/bound_11.f90| 588 ++
 libgfortran/generated/all_l1.c|   9 +-
 libgfortran/generated/all_l16.c   |   9 +-
 libgfortran/generated/all_l2.c|   9 +-
 libgfortran/generated/all_l4.c|   9 +-
 libgfortran/generated/all_l8.c|   9 +-
 libgfortran/generated/any_l1.c|   9 +-
 libgfortran/generated/any_l16.c   |   9 +-
 libgfortran/generated/any_l2.c|   9 +-
 libgfortran/generated/any_l4.c|   9 +-
 libgfortran/generated/any_l8.c|   9 +-
 libgfortran/generated/count_16_l.c|   9 +-
 libgfortran/generated/count_1_l.c |   9 +-
 libgfortran/generated/count_2_l.c |   9 +-
 libgfortran/generated/count_4_l.c |   9 +-
 libgfortran/generated/count_8_l.c |   9 +-
 libgfortran/generated/findloc1_c10.c  |  18 +-
 libgfortran/generated/findloc1_c16.c  |  18 +-
 libgfortran/generated/findloc1_c17.c  |  18 +-
 libgfortran/generated/findloc1_c4.c   |  18 +-
 libgfortran/generated/findloc1_c8.c   |  18 +-
 libgfortran/generated/findloc1_i1.c   |  18 +-
 libgfortran/generated/findloc1_i16.c  |  18 +-
 libgfortran/generated/findloc1_i2.c   |  18 +-
 libgfortran/generated/findloc1_i4.c   |  18 +-
 libgfortran/generated/findloc1_i8.c   |  18 +-
 libgfortran/generated/findloc1_r10.c  |  18 +-
 libgfortran/generated/findloc1_r16.c  |  18 +-
 libgfortran/generated/findloc1_r17.c  |  18 +-
 libgfortran/generated/findloc1_r4.c   |  18 +-
 libgfortran/generated/findloc1_r8.c   |  18 +-
 libgfortran/generated/findloc1_s1.c   |  18 +-
 libgfortran/generated/findloc1_s4.c   |  18 +-
 libgfortran/generated/iall_i1.c   |  30 +-
 libgfortran/generated/iall_i16.c  |  30 +-
 libgfortran/generated/iall_i2.c   |  30 +-
 libgfortran/generated/iall_i4.c   |  30 +-
 libgfortran/generated/iall_i8.c   |  30 +-
 libgfortran/generated/iany_i1.c   |  30 +-
 libgfortran/generated/iany_i16.c  |  30 +-
 libgfortran/generated/iany_i2.c   |  30 +-
 libgfortran/generated/iany_i4.c   |  30 +-
 libgfortran/generated/iany_i8.c   |  30 +-
 libgfortran/generated/iparity_i1.c|  30 +-
 libgfortran/generated/iparity_i16.c   |  30 +-
 libgfortran/generated/iparity_i2.c|  30 +-
 libgfortran/generated/iparity_i4.c|  30 +-
 libgfortran/generated/iparity_i8.c|  30 +-
 libgfortran/generated/maxloc1_16_i1.c |  30 +-
 libgfortran/generated/maxloc1_16_i16.c|  30 +-
 libgfortran/generated/maxloc1_16_i2.c |  30 +-
 libgfortran/generated/maxloc1_16_i4.c |  30 +-
 libgfortran/generated/maxloc1_16_i8.c |  30 +-
 libgfortran/generated/maxloc1_16_r10.c|  30 +-
 libgfortran/generated/maxloc1_16_r16.c|  30 +-
 libgfortran/generated/maxloc1_16_r17.c|  30 +-
 libgfortran/generated/maxloc1_16_r4.c |  30 +-
 libgfortran/generated/maxloc1_16_r8.c |  30 +-
 libgfortran/generated/maxloc1_16_s1.c |  30 +-
 libgfortran/generated/maxloc1_16_s4.c |  30 +-
 libgfortran/generated/maxloc1_4_i1.c  |  30 +-
 libgfortran/generated/maxloc1_4_i16.c |  30 +-
 libgfortran/generated/maxloc1_4_i2.c  |  30 +-
 libgfortran/generated/maxloc1_4_i4.c  |  30 +-
 libgfortran/generated/maxloc1_4_i8.c  |  30 +-
 libgfortran/generated/maxloc1_4_r10.c |  30 +-
 libgfortran/generated/maxloc1_4_r16.c |  30 +-
 libgfortran/generated/maxloc1_4_r17.c |  30 +-
 libgfortran/generated/maxloc1_4_r4.c  |  30 +-
 libgfortran/generated/maxloc1_4_r8.c  |  30 +-
 libgfortran/generated/maxloc1_4_s1.c  |  30 +-
 libgfortran/generated/maxloc1_4_s4.c  |  30 +-
 libgfortran/generated/maxloc1_8_i1.c  |  30 +-
 libgfortran/generated/maxloc1_8_i16.c |  30 +-
 libgfortran/generated/maxloc1_8_i2.c  |  30 +-
 libgfortran/generated/maxloc1_8_i4.c  |  30 +-
 libgfortran/generated/maxloc1_8_i8.c  |  30 +-
 libgfortran/generated/maxloc1_8_r10.c |  30