Bug 85879 - [8 Regression] ICE in expand_debug_locations, at cfgexpand.c:5405
Summary: [8 Regression] ICE in expand_debug_locations, at cfgexpand.c:5405
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 9.0
: P2 normal
Target Milestone: 9.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, openacc
Depends on:
Blocks:
 
Reported: 2018-05-22 18:08 UTC by G. Steinmetz
Modified: 2021-05-14 10:46 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 9.0
Known to fail:
Last reconfirmed: 2018-05-23 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description G. Steinmetz 2018-05-22 18:08:07 UTC
A release version needs option -g at -O[gs123] :


$ cat z1.f90
program p
   integer, pointer :: i
   integer, target :: j
   j = 2
   i => j
   !$acc parallel
   j = i
   !$acc end parallel
end


$ gfortran-5 -c z1.f90 -g -O2 -fopenacc
$
$ gfortran-9-20180520 -c z1.f90 -g -O2 -fopenacc
during RTL pass: expand
z1.f90:6:0:

    !$acc parallel

internal compiler error: in expand_debug_locations, at cfgexpand.c:5405
0x80bcca expand_debug_locations
        ../../gcc/cfgexpand.c:5401
0x80bcca execute
        ../../gcc/cfgexpand.c:6444



Configured with --enable-checking=yes :

$ gfortran-9-20180520 -c z1.f90 -g -O2 -fopenacc
z1.f90:7:0:

    j = i

Error: non-trivial conversion at assignment
integer(kind=4)
integer(kind=4) *
i.4 = *D.3808;
during GIMPLE pass: lower
z1.f90:7:0: internal compiler error: verify_gimple failed
0xd3b7bd verify_gimple_in_seq(gimple*)
        ../../gcc/tree-cfg.c:5013
0xc0d220 execute_function_todo
        ../../gcc/passes.c:1996
0xc0daf9 execute_todo
        ../../gcc/passes.c:2048
Comment 1 Richard Biener 2018-05-23 09:14:51 UTC
Confirmed.
Comment 2 Jakub Jelinek 2018-05-30 15:05:26 UTC
Can't get any ICEs with similar OpenMP code.
In a checking compiler this ICEs much earlier though:
Error: non-trivial conversion at assignment
integer(kind=4)
integer(kind=4) *
i.4 = *D.3808;
during GIMPLE pass: lower
Comment 3 cesar 2018-05-30 21:26:25 UTC
I'm testing Chung-Lin's fix for PR77371 from gomp-4_0-branch on trunk. It takes extra care when handling data clauses of Fortran reference-type variables.
Comment 4 cesar 2018-05-31 14:10:42 UTC
Author: cesar
Date: Thu May 31 14:10:10 2018
New Revision: 261025

URL: https://gcc.gnu.org/viewcvs?rev=261025&root=gcc&view=rev
Log:
Fix PR middle-end/85879

	gcc/
	* gimplify.c (gimplify_adjust_omp_clauses): Add 'remove = true'
	when emitting error on private/firstprivate reductions.
	* omp-low.c (lower_omp_target): Avoid reference-type processing
	on pointers for firstprivate clause.

	gcc/testsuite/
	* gfortran.dg/goacc/pr77371-1.f90: New test.
	* gfortran.dg/goacc/pr77371-2.f90: New test.
	* gfortran.dg/goacc/pr85879.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/goacc/pr77371-1.f90
    trunk/gcc/testsuite/gfortran.dg/goacc/pr77371-2.f90
    trunk/gcc/testsuite/gfortran.dg/goacc/pr85879.f90
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c
    trunk/gcc/omp-low.c
    trunk/gcc/testsuite/ChangeLog
Comment 5 Jakub Jelinek 2018-10-26 10:11:06 UTC
GCC 6 branch is being closed
Comment 6 Richard Biener 2019-11-14 07:51:04 UTC
The GCC 7 branch is being closed, re-targeting to GCC 8.4.
Comment 7 Jakub Jelinek 2020-03-04 09:42:56 UTC
GCC 8.4.0 has been released, adjusting target milestone.
Comment 8 Jakub Jelinek 2021-05-14 10:46:11 UTC
The GCC 8 branch is being closed, fixed in GCC 9.1.