[Bug fortran/79685] [9/10/11/12 Regression] ICE on valid code in gfc_match_structur_constructor

2022-01-14 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79685

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 CC||anlauf at gcc dot gnu.org

--- Comment #11 from anlauf at gcc dot gnu.org ---
The following tentative change fixes testcase z1 in comment#5:

diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index 3f01f67cd49..d3729b20446 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -3373,8 +3373,8 @@ gfc_match_structure_constructor (gfc_symbol *sym,
gfc_expr **result)
   e->expr_type = EXPR_FUNCTION;
   e->where = gfc_current_locus;

-  gcc_assert (gfc_fl_struct (sym->attr.flavor)
- && symtree->n.sym->attr.flavor == FL_PROCEDURE);
+  gcc_assert (gfc_fl_struct (sym->attr.flavor));
+//   && symtree->n.sym->attr.flavor == FL_PROCEDURE);
   e->value.function.esym = sym;
   e->symtree->n.sym->attr.generic = 1;

However, it does not fix the example in comment#0.

Playing a little, it seems that commenting the "implicit none" in module foo
then lets the code compile.

Alternative reproducer:

module m
  implicit none
  private
  public :: t
  type t
 integer :: i
  end type
end
module m2
  use m, t2 => t
  implicit none ! <--- Error: Symbol 't' at (1) has no IMPLICIT type
  private
  type(t2), public, protected :: x(2)
  data x(1) /t2(3)/
end
program p
  use m2
  implicit none
  print *, x(1)%i
end program p

So there is more to it...

[Bug fortran/79685] [9/10/11/12 Regression] ICE on valid code in gfc_match_structur_constructor

2021-06-01 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79685

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|9.4 |9.5

--- Comment #10 from Richard Biener  ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

[Bug fortran/79685] [9/10/11/12 Regression] ICE on valid code in gfc_match_structur_constructor

2021-05-14 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79685

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|8.5 |9.4

--- Comment #9 from Jakub Jelinek  ---
GCC 8 branch is being closed.