[Bug fortran/103472] ICE in gfc_conv_ss_startstride, at fortran/trans-array.c:4527

2024-03-21 Thread mikael at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103472

Mikael Morin  changed:

   What|Removed |Added

  Known to work||14.0
  Known to fail||13.2.0

--- Comment #3 from Mikael Morin  ---
The example from comment #0 is now rejected, which avoids the problem:

comment_0.f90:3:15:

3 |print *, (a(1:1))
  |   1
Warning: Lower array reference at (1) is out of bounds (1 > 0) in dimension 1
comment_0.f90:3:15:

3 |print *, (a(1:1))
  |   1
Warning: Lower array reference at (1) is out of bounds (1 > 0) in dimension 1
comment_0.f90:3:15:

3 |print *, (a(1:1))
  |   1
Error: index in dimension 1 is out of bounds at (1)

[Bug fortran/103472] ICE in gfc_conv_ss_startstride, at fortran/trans-array.c:4527

2021-12-12 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103472

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

   Last reconfirmed||2021-12-12
 Status|UNCONFIRMED |NEW
   Priority|P3  |P4
 Ever confirmed|0   |1
 CC||anlauf at gcc dot gnu.org

--- Comment #2 from anlauf at gcc dot gnu.org ---
(In reply to Mikael Morin from comment #1)
> We could workaround it by replacing warnings with errors.
> Are there cases where we do want warnings, not errors?

I would consider the testcase as invalid, so an error appears ok.
But technically the lower bound of a is 1 and upper bound is 0,
so the error message is a bit misleading.

E.g. NAG gives:

Error: pr103472-z1.f90, line 2: First subscript (1) is greater than upper bound
(0) for array A

[Bug fortran/103472] ICE in gfc_conv_ss_startstride, at fortran/trans-array.c:4527

2021-12-12 Thread mikael at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103472

Mikael Morin  changed:

   What|Removed |Added

 CC||mikael at gcc dot gnu.org

--- Comment #1 from Mikael Morin  ---
Created attachment 51982
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51982=edit
draft patch

We could workaround it by replacing warnings with errors.
Are there cases where we do want warnings, not errors?