Commit cb40e807 by Thomas Koenig

re PR fortran/88073 (Internal compiler error compiling WHERE construct with -O or -O2)

2018-11-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/88073
	* frontend-passes.c (combine_array_constructor): Do not do
	anything if in a WHERE statement.

2018-11-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/88073
	* gfortran.dg/where_7.f90: New test.

From-SVN: r266251
parent 9515381d
2018-11-18 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/88073
* frontend-passes.c (combine_array_constructor): Do not do
anything if in a WHERE statement.
2018-11-18 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/70260
* expr.c (gfc_check_assign): Reject assigning to an external
symbol.
......
......@@ -1773,6 +1773,10 @@ combine_array_constructor (gfc_expr *e)
if (iterator_level > 0)
return false;
/* WHERE also doesn't work. */
if (in_where > 0)
return false;
op1 = e->value.op.op1;
op2 = e->value.op.op2;
......
2018-11-18 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/88073
* gfortran.dg/where_7.f90: New test.
2018-11-18 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/70260
* gfortran.dg/proc_ptr_result_5.f90: Add dg-error directive.
* gfortran.dg/protected_4.f90: Split line to allow for extra error.
......
! { dg-do compile }
! { dg-options "-ffrontend-optimize" }
! PR fortran/88073 - this used to ICE with front-end optimization
! Original test case by 'mecej4'
Subroutine tfu (n, x, f)
Implicit None
Integer, Parameter :: double = Kind (0.d0)
Integer, Intent (In) :: n
Real (double), Intent (Out) :: f
Real (double), Intent (In) :: x (n)
Integer :: j
Logical, Dimension(n) :: l1v, l2v, l3v
!
l3v = .False.
l2v = .False.
l1v = (/ (j, j=1, n) /) == 1
Where ( .Not. (l1v))
l2v = (/ (j, j=1, n) /) == n
End Where
Where ( .Not. l1v)
l3v = .Not. l2v
End Where
f = sum (x(1:n), mask=l3v)
Return
end subroutine tfu
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment