[Bug fortran/95979] [10/11 Regression] ICE in get_kind, at fortran/simplify.c:129

2020-10-23 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95979

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #8 from anlauf at gcc dot gnu.org ---
Fixed on master for gcc-11, and on 10-branch.  Closing.

Thanks for the report!

[Bug fortran/95979] [10/11 Regression] ICE in get_kind, at fortran/simplify.c:129

2020-10-22 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95979

--- Comment #7 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:90b83a25b3499ff50a9b7afc0e84e1355191c220

commit r10-8939-g90b83a25b3499ff50a9b7afc0e84e1355191c220
Author: Harald Anlauf 
Date:   Fri Oct 16 22:17:46 2020 +0200

PR fortran/95979 - ICE in get_kind, at fortran/simplify.c:129

Simplification of the elemental intrinsic INDEX with constant array-valued
arguments failed with an ICE or did not reduce to a constant array,
depending
also on the presence of the optional KIND argument.  Add a further attempt
of
simplification in the case of elemental intrinsics, and make sure the KIND
argument is not removed prematurely during simplification of INDEX.

gcc/fortran/ChangeLog:

PR fortran/95979
* expr.c (gfc_check_init_expr): Fix check of return code from
gfc_intrinsic_func_interface.
* intrinsic.c (gfc_intrinsic_func_interface): Add further attempt
of simplification of elemental intrinsics with array arguments.
* iresolve.c (gfc_resolve_index_func): Keep optional KIND argument
for simplification of elemental use of INDEX.

gcc/testsuite/ChangeLog:

PR fortran/95979
* gfortran.dg/index_4.f90: New test.

(cherry picked from commit 02629b116eed7c6911ef0eb2ef97e1883e9fb1de)

[Bug fortran/95979] [10/11 Regression] ICE in get_kind, at fortran/simplify.c:129

2020-10-16 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95979

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Harald Anlauf :

https://gcc.gnu.org/g:02629b116eed7c6911ef0eb2ef97e1883e9fb1de

commit r11-4020-g02629b116eed7c6911ef0eb2ef97e1883e9fb1de
Author: Harald Anlauf 
Date:   Fri Oct 16 22:17:46 2020 +0200

PR fortran/95979 - ICE in get_kind, at fortran/simplify.c:129

Simplification of the elemental intrinsic INDEX with constant array-valued
arguments failed with an ICE or did not reduce to a constant array,
depending
also on the presence of the optional KIND argument.  Add a further attempt
of
simplification in the case of elemental intrinsics, and make sure the KIND
argument is not removed prematurely during simplification of INDEX.

gcc/fortran/ChangeLog:

PR fortran/95979
* expr.c (gfc_check_init_expr): Fix check of return code from
gfc_intrinsic_func_interface.
* intrinsic.c (gfc_intrinsic_func_interface): Add further attempt
of simplification of elemental intrinsics with array arguments.
* iresolve.c (gfc_resolve_index_func): Keep optional KIND argument
for simplification of elemental use of INDEX.

gcc/testsuite/ChangeLog:

PR fortran/95979
* gfortran.dg/index_4.f90: New test.

[Bug fortran/95979] [10/11 Regression] ICE in get_kind, at fortran/simplify.c:129

2020-10-08 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95979

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |anlauf at gcc dot 
gnu.org
  Known to work||7.4.1, 8.4.1, 9.3.1
 Status|NEW |ASSIGNED
  Known to fail||10.2.1, 11.0

--- Comment #5 from anlauf at gcc dot gnu.org ---
Patch: https://gcc.gnu.org/pipermail/fortran/2020-October/055162.html

[Bug fortran/95979] [10/11 Regression] ICE in get_kind, at fortran/simplify.c:129

2020-10-05 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95979

--- Comment #4 from anlauf at gcc dot gnu.org ---
(In reply to anlauf from comment #3)
> Maybe the issue is related to PR87711, where the optional KIND argument
> causes havoc with the elementalness of an intrinsic. (There it is LEN_TRIM).

Replying to myself: it seems to be that simplification fails when one of
the arguments to INDEX is array-valued.  Might be a general issue.

[Bug fortran/95979] [10/11 Regression] ICE in get_kind, at fortran/simplify.c:129

2020-08-25 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95979

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||ice-on-valid-code

--- Comment #3 from anlauf at gcc dot gnu.org ---
Only examples z1 and z2 are invalid code, z3 is actually valid code.
Adjusting keywords.

Maybe the issue is related to PR87711, where the optional KIND argument
causes havoc with the elementalness of an intrinsic. (There it is LEN_TRIM).

[Bug fortran/95979] [10/11 Regression] ICE in get_kind, at fortran/simplify.c:129

2020-07-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95979

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|10.2|10.3

--- Comment #2 from Richard Biener  ---
GCC 10.2 is released, adjusting target milestone.

[Bug fortran/95979] [10/11 Regression] ICE in get_kind, at fortran/simplify.c:129

2020-06-29 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95979

--- Comment #1 from Dominique d'Humieres  ---
I don't see the ICE on a standard GCC11, but its instrumented version gives

../../work/gcc/fortran/simplify.c:127:10: runtime error: load of value
4294967295, which is not a valid value for type 'expr_t'
../../work/gcc/fortran/error.c:970:2: runtime error: member access within
misaligned address 0x0002 for type 'struct gfc_linebuf', which requires
8 byte alignment
0x0002: note: pointer points here

../../work/gcc/fortran/error.c:971:46: runtime error: member access within
misaligned address 0x0002 for type 'struct gfc_linebuf', which requires
8 byte alignment
0x0002: note: pointer points here

../../work/gcc/fortran/error.c:979:42: runtime error: member access within
misaligned address 0x0002 for type 'struct gfc_linebuf', which requires
8 byte alignment
0x0002: note: pointer points here

The instrumented GCC9 and 10 give the expected error.

[Bug fortran/95979] [10/11 Regression] ICE in get_kind, at fortran/simplify.c:129

2020-06-29 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95979

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
   Last reconfirmed||2020-06-29
 CC||anlauf at gcc dot gnu.org
   Target Milestone|--- |10.2
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW