[Bug middle-end/82617] Internal compiler error in expand_expr_real_1 when compiling the attached file

2017-10-20 Thread uberprugelknabe at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82617

--- Comment #3 from Ögmundur Petersson  ---
I fear that it doesn't add any new information but here is my full backtrace:

test.f90:22:0:

   FUNCTION str_words(str,white) RESULT(items)

Error: Local declaration from a different function
..__result
test.f90:27:0:

 items = strwords_impl(str,white)

note: in statement
..__result = ..__result;
test.f90:22:0:

   FUNCTION str_words(str,white) RESULT(items)

Error: Local declaration from a different function
..__result
test.f90:27:0:

 items = strwords_impl(str,white)

note: in statement
_28 = (integer(kind=8)) ..__result;
test.f90:22:0:

   FUNCTION str_words(str,white) RESULT(items)

Error: Local declaration from a different function
..__result
test.f90:27:0:

 items = strwords_impl(str,white)

note: in statement
D.3662 = (sizetype) ..__result;
test.f90:22:0:

   FUNCTION str_words(str,white) RESULT(items)

internal compiler error: verify_gimple failed
0xc330ae verify_gimple_in_cfg(function*, bool)
../../gcc-7.2.0/gcc/tree-cfg.c:5266
0xb15866 execute_function_todo
../../gcc-7.2.0/gcc/passes.c:1966
0xb168b2 execute_todo
../../gcc-7.2.0/gcc/passes.c:2016
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug middle-end/82617] Internal compiler error in expand_expr_real_1 when compiling the attached file

2017-10-19 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82617

--- Comment #2 from Dominique d'Humieres  ---
The ICE depends on the configuration of the compiler:

with --enable-checking=release, I get

during RTL pass: expand
pr82617.f90:27:0:

 items = strwords_impl(str,white)

internal compiler error: in expand_expr_real_1, at expr.c:9862

with --enable-checking=yes, I get the ICE in comment 1.

> These errors appear to be coming from the middle-end.

Yes, but probably because the frontend does do the "right" thing.

[Bug middle-end/82617] Internal compiler error in expand_expr_real_1 when compiling the attached file

2017-10-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82617

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-10-19
 CC||kargl at gcc dot gnu.org
  Component|fortran |middle-end
 Ever confirmed|0   |1

--- Comment #1 from kargl at gcc dot gnu.org ---
Can you post the backtrace you get?  With top of tree, I see

% gfcx -c h.f90
h.f90:22:0:

   FUNCTION str_words(str,white) RESULT(items)

Error: Local declaration from a different function
..__result
h.f90:27:0:

 items = strwords_impl(str,white)

note: in statement
..__result = ..__result;
h.f90:22:0:

   FUNCTION str_words(str,white) RESULT(items)

Error: Local declaration from a different function
..__result
h.f90:27:0:

 items = strwords_impl(str,white)

note: in statement
_28 = (integer(kind=8)) ..__result;
h.f90:22:0:

   FUNCTION str_words(str,white) RESULT(items)

Error: Local declaration from a different function
..__result
h.f90:27:0:

 items = strwords_impl(str,white)

note: in statement
D.3686 = (sizetype) ..__result;
during GIMPLE pass: cfg
h.f90:22:0:

   FUNCTION str_words(str,white) RESULT(items)

internal compiler error: verify_gimple failed
0xda9ea6 verify_gimple_in_cfg(function*, bool)
../../gcc/gcc/tree-cfg.c:5397
0xcb152f execute_function_todo
../../gcc/gcc/passes.c:1992
0xcb234e execute_todo
../../gcc/gcc/passes.c:2046
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

The reduced testcase 

module test

  implicit none

  contains

  function str_words(x,y) result(z)
character(len=:), dimension(:), allocatable :: z
character(len=*), intent(in) :: x, y
z = strwords_impl(x,y)
  end function str_words

  function strwords_impl(a, b) result(c)
character(len=:), dimension(:), allocatable :: c
character(len=*), intent(in) :: a, b
allocate(character(len=0) :: c(0))
  end function strwords_impl

end module test

yields the same result.  These errors appear to be
coming from the middle-end.