backport: re PR fortran/80164 (ICE in gfc_format_decoder at gcc/fortran/error.c:933)
2017-08-18 Jerry DeLisle <jvdelisle@gcc.gnu.org> Backport from trunk PR fortran/80164 * trans-stmt.c (gfc_trans_call): If no code expr, use code->loc as warning/error locus. * gfortran.dg/array_temporaries_4.f90: New test. From-SVN: r251189
This commit is contained in:
parent
30a5b0f9bd
commit
1ddec7a687
@ -1,3 +1,10 @@
|
|||||||
|
2017-08-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
|
Backport from trunk
|
||||||
|
PR fortran/80164
|
||||||
|
* trans-stmt.c (gfc_trans_call): If no code expr, use code->loc
|
||||||
|
as warning/error locus.
|
||||||
|
|
||||||
2017-08-14 Release Manager
|
2017-08-14 Release Manager
|
||||||
|
|
||||||
* GCC 7.2.0 released.
|
* GCC 7.2.0 released.
|
||||||
|
@ -452,7 +452,10 @@ gfc_trans_call (gfc_code * code, bool dependency_check,
|
|||||||
subscripts. This could be prevented in the elemental case
|
subscripts. This could be prevented in the elemental case
|
||||||
as temporaries are handled separatedly
|
as temporaries are handled separatedly
|
||||||
(below in gfc_conv_elemental_dependencies). */
|
(below in gfc_conv_elemental_dependencies). */
|
||||||
gfc_conv_loop_setup (&loop, &code->expr1->where);
|
if (code->expr1)
|
||||||
|
gfc_conv_loop_setup (&loop, &code->expr1->where);
|
||||||
|
else
|
||||||
|
gfc_conv_loop_setup (&loop, &code->loc);
|
||||||
gfc_mark_ss_chain_used (ss, 1);
|
gfc_mark_ss_chain_used (ss, 1);
|
||||||
|
|
||||||
/* Convert the arguments, checking for dependencies. */
|
/* Convert the arguments, checking for dependencies. */
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2017-08-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
|
Backport from trunk
|
||||||
|
PR fortran/80164
|
||||||
|
* gfortran.dg/array_temporaries_4.f90: New test.
|
||||||
|
|
||||||
2017-08-16 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
|
2017-08-16 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
|
||||||
|
|
||||||
Backport from mainline
|
Backport from mainline
|
||||||
|
59
gcc/testsuite/gfortran.dg/array_temporaries_4.f90
Normal file
59
gcc/testsuite/gfortran.dg/array_temporaries_4.f90
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
! { dg-do compile }
|
||||||
|
! { dg-options "-Warray-temporaries" }
|
||||||
|
! Tests the fix for PR80164, in which the compiler segfaulted on this
|
||||||
|
! when using -Warray-temporaries
|
||||||
|
!
|
||||||
|
!******************************************************************************
|
||||||
|
module global
|
||||||
|
type :: a
|
||||||
|
integer :: b
|
||||||
|
character(8):: c
|
||||||
|
end type a
|
||||||
|
interface assignment(=)
|
||||||
|
module procedure a_to_a, c_to_a, a_to_c
|
||||||
|
end interface
|
||||||
|
interface operator(.ne.)
|
||||||
|
module procedure a_ne_a
|
||||||
|
end interface
|
||||||
|
|
||||||
|
type(a) :: x(4), y(4)
|
||||||
|
logical :: l1(4), t = .true., f= .false.
|
||||||
|
contains
|
||||||
|
!******************************************************************************
|
||||||
|
elemental subroutine a_to_a (m, n)
|
||||||
|
type(a), intent(in) :: n
|
||||||
|
type(a), intent(out) :: m
|
||||||
|
m%b = len ( trim(n%c))
|
||||||
|
m%c = n%c
|
||||||
|
end subroutine a_to_a
|
||||||
|
elemental subroutine c_to_a (m, n)
|
||||||
|
character(8), intent(in) :: n
|
||||||
|
type(a), intent(out) :: m
|
||||||
|
m%b = m%b + 1
|
||||||
|
m%c = n
|
||||||
|
end subroutine c_to_a
|
||||||
|
elemental subroutine a_to_c (m, n)
|
||||||
|
type(a), intent(in) :: n
|
||||||
|
character(8), intent(out) :: m
|
||||||
|
m = n%c
|
||||||
|
end subroutine a_to_c
|
||||||
|
!******************************************************************************
|
||||||
|
elemental logical function a_ne_a (m, n)
|
||||||
|
type(a), intent(in) :: n
|
||||||
|
type(a), intent(in) :: m
|
||||||
|
a_ne_a = (m%b .ne. n%b) .or. (m%c .ne. n%c)
|
||||||
|
end function a_ne_a
|
||||||
|
!******************************************************************************
|
||||||
|
elemental function foo (m)
|
||||||
|
type(a) :: foo
|
||||||
|
type(a), intent(in) :: m
|
||||||
|
foo%b = 0
|
||||||
|
foo%c = m%c
|
||||||
|
end function foo
|
||||||
|
end module global
|
||||||
|
!******************************************************************************
|
||||||
|
program test
|
||||||
|
use global
|
||||||
|
x = (/a (0, "one"),a (0, "two"),a (0, "three"),a (0, "four")/) ! { dg-warning "Creating array temporary" }
|
||||||
|
y = x
|
||||||
|
end program test
|
Loading…
Reference in New Issue
Block a user