[Bug fortran/103287] [12 Regression] ICE in argument_rank_mismatch, at fortran/interface.c:2240

2022-09-16 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103287

--- Comment #9 from anlauf at gcc dot gnu.org ---
*** Bug 100025 has been marked as a duplicate of this bug. ***

[Bug fortran/103287] [12 Regression] ICE in argument_rank_mismatch, at fortran/interface.c:2240

2022-09-16 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103287

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jrfsousa at gcc dot gnu.org

--- Comment #8 from anlauf at gcc dot gnu.org ---
*** Bug 100024 has been marked as a duplicate of this bug. ***

[Bug fortran/103287] [12 Regression] ICE in argument_rank_mismatch, at fortran/interface.c:2240

2022-01-06 Thread sandra at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103287

sandra at gcc dot gnu.org changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #7 from sandra at gcc dot gnu.org ---
Should be fixed now.

[Bug fortran/103287] [12 Regression] ICE in argument_rank_mismatch, at fortran/interface.c:2240

2022-01-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103287

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Sandra Loosemore :

https://gcc.gnu.org/g:8e2771069ed0c157cca825d6af5792e94c4407c1

commit r12-6322-g8e2771069ed0c157cca825d6af5792e94c4407c1
Author: Sandra Loosemore 
Date:   Wed Jan 5 13:18:10 2022 -0800

Fortran: Fix ICE in argument_rank_mismatch [PR103287]

This patch removes an incorrect assertion.  A user-friendly error for this
case is already given elsewhere.

2022-01-05  Steve Kargl  
Sandra Loosemore  

PR fortran/103287

gcc/fortran/
* interface.c (argument_rank_mismatch): Replace incorrect assertion
with return.

gcc/testsuite/
* gfortran.dg/c-interop/pr103287-1.f90: new.
* gfortran.dg/c-interop/pr103287-2.f90: new.

[Bug fortran/103287] [12 Regression] ICE in argument_rank_mismatch, at fortran/interface.c:2240

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

--- Comment #5 from kargl at gcc dot gnu.org ---
(In reply to sandra from comment #4)
> The proposed fix in comment 2 looks OK to me, although I'd like to see a
> comment here like
> 
> "This case corresponds to an assumed-rank actual passed to a function
> without an explicit interface, which is diagnosed in gfc_procedure_use."
> 
> to explain what is going on.

I no longer commit patches.  Feel free to do whatever you want here;
although, I think the comment is unwarranted.

[Bug fortran/103287] [12 Regression] ICE in argument_rank_mismatch, at fortran/interface.c:2240

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

sandra at gcc dot gnu.org changed:

   What|Removed |Added

 CC||sandra at gcc dot gnu.org

--- Comment #4 from sandra at gcc dot gnu.org ---
The proposed fix in comment 2 looks OK to me, although I'd like to see a
comment here like

"This case corresponds to an assumed-rank actual passed to a function without
an explicit interface, which is diagnosed in gfc_procedure_use."

to explain what is going on.

[Bug fortran/103287] [12 Regression] ICE in argument_rank_mismatch, at fortran/interface.c:2240

2021-11-18 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103287

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org,
   ||sandra at codesourcery dot com

--- Comment #3 from Martin Liška  ---
Started with r12-3827-g7a40f2e74815a926, it was rejected before the revision.

[Bug fortran/103287] [12 Regression] ICE in argument_rank_mismatch, at fortran/interface.c:2240

2021-11-17 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103287

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |12.0

[Bug fortran/103287] [12 Regression] ICE in argument_rank_mismatch, at fortran/interface.c:2240

2021-11-16 Thread kargl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103287

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4

[Bug fortran/103287] [12 Regression] ICE in argument_rank_mismatch, at fortran/interface.c:2240

2021-11-16 Thread kargl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103287

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Last reconfirmed||2021-11-16
 Ever confirmed|0   |1
 CC||kargl at gcc dot gnu.org
 Status|UNCONFIRMED |NEW

--- Comment #2 from kargl at gcc dot gnu.org ---
Change an assert to an if-statement and simply return.

diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 30c99ef3938..8bd507be67c 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -2237,7 +2237,9 @@ argument_rank_mismatch (const char *name, locus *where,
 }
   else
 {
-  gcc_assert (rank2 != -1);
+  if (rank2 == -1)
+   return;
+
   if (rank1 == 0)
gfc_error_opt (0, "Rank mismatch between actual argument at %L "
   "and actual argument at %L (scalar and rank-%d)",

[Bug fortran/103287] [12 Regression] ICE in argument_rank_mismatch, at fortran/interface.c:2240

2021-11-16 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103287

G. Steinmetz  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code

--- Comment #1 from G. Steinmetz  ---

It should be added that following variant started with r10,
between 20190908 and 20190915 :


$ cat z2.f90
subroutine g
   call s(1)
end
subroutine h(x)
   integer, pointer :: x(..)
   call s(x)
end