Bug 85488 - segmentation fault when compiling code using the ordered(n) clause in OpenMP 4.5
Summary: segmentation fault when compiling code using the ordered(n) clause in OpenMP 4.5
Status: RESOLVED DUPLICATE of bug 87649
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 7.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: openmp
Depends on:
Blocks:
 
Reported: 2018-04-21 00:56 UTC by Chunhua Liao
Modified: 2019-08-30 11:07 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
this is the input file to trigger the error (1.40 KB, text/x-csrc)
2018-04-21 00:56 UTC, Chunhua Liao
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chunhua Liao 2018-04-21 00:56:15 UTC
Created attachment 44000 [details]
this is the input file to trigger the error

gcc -fopenmp doall2-ordered-orig-no.c


doall2-ordered-orig-no.c: In function ‘main’:
doall2-ordered-orig-no.c:62:9: internal compiler error: Segmentation fault
 #pragma omp parallel for ordered(2)
         ^~~
0x9d0ebf crash_signal
	/nfs/casc/overture/ROSE/opt/rhel7/x86_64/gcc/7.1.0/mpc/1.0/mpfr/3.1.2/gmp//workspace/gcc-7.1.0/gcc/toplev.c:337
0x7adfb0 gsi_for_stmt(gimple*)
	/nfs/casc/overture/ROSE/opt/rhel7/x86_64/gcc/7.1.0/mpc/1.0/mpfr/3.1.2/gmp//workspace/gcc-7.1.0/gcc/gimple-iterator.c:614
0x8d8f42 expand_omp_ordered_source_sink
	/nfs/casc/overture/ROSE/opt/rhel7/x86_64/gcc/7.1.0/mpc/1.0/mpfr/3.1.2/gmp//workspace/gcc-7.1.0/gcc/omp-expand.c:2260
0x8d8f42 expand_omp_for_generic
	/nfs/casc/overture/ROSE/opt/rhel7/x86_64/gcc/7.1.0/mpc/1.0/mpfr/3.1.2/gmp//workspace/gcc-7.1.0/gcc/omp-expand.c:2986
0x8daff3 expand_omp_for
	/nfs/casc/overture/ROSE/opt/rhel7/x86_64/gcc/7.1.0/mpc/1.0/mpfr/3.1.2/gmp//workspace/gcc-7.1.0/gcc/omp-expand.c:5883
0x8dbf2a expand_omp
	/nfs/casc/overture/ROSE/opt/rhel7/x86_64/gcc/7.1.0/mpc/1.0/mpfr/3.1.2/gmp//workspace/gcc-7.1.0/gcc/omp-expand.c:7894
0x8dc6d6 expand_omp
	/nfs/casc/overture/ROSE/opt/rhel7/x86_64/gcc/7.1.0/mpc/1.0/mpfr/3.1.2/gmp//workspace/gcc-7.1.0/gcc/omp-expand.c:7880
0x8de5ad execute_expand_omp
	/nfs/casc/overture/ROSE/opt/rhel7/x86_64/gcc/7.1.0/mpc/1.0/mpfr/3.1.2/gmp//workspace/gcc-7.1.0/gcc/omp-expand.c:8118
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Comment 1 Jakub Jelinek 2018-10-19 09:37:37 UTC
Dup of PR87649.

*** This bug has been marked as a duplicate of bug 87649 ***
Comment 2 Jakub Jelinek 2018-10-19 22:52:38 UTC
Author: jakub
Date: Fri Oct 19 22:52:06 2018
New Revision: 265335

URL: https://gcc.gnu.org/viewcvs?rev=265335&root=gcc&view=rev
Log:
	PR middle-end/85488
	PR middle-end/87649
	* omp-low.c (check_omp_nesting_restrictions): Diagnose ordered without
	depend closely nested inside of loop with ordered clause with
	a parameter.

	* c-c++-common/gomp/doacross-2.c: New test.
	* c-c++-common/gomp/sink-3.c: Expect another error during error
	recovery.

Added:
    trunk/gcc/testsuite/c-c++-common/gomp/doacross-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/omp-low.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/c-c++-common/gomp/sink-3.c
Comment 3 Jakub Jelinek 2018-11-05 14:08:19 UTC
Author: jakub
Date: Mon Nov  5 14:07:47 2018
New Revision: 265801

URL: https://gcc.gnu.org/viewcvs?rev=265801&root=gcc&view=rev
Log:
	Backported from mainline
	2018-10-19  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/85488
	PR middle-end/87649
	* omp-low.c (check_omp_nesting_restrictions): Diagnose ordered without
	depend closely nested inside of loop with ordered clause with
	a parameter.

	* c-c++-common/gomp/doacross-2.c: New test.
	* c-c++-common/gomp/sink-3.c: Expect another error during error
	recovery.

Added:
    branches/gcc-8-branch/gcc/testsuite/c-c++-common/gomp/doacross-2.c
Modified:
    branches/gcc-8-branch/gcc/ChangeLog
    branches/gcc-8-branch/gcc/omp-low.c
    branches/gcc-8-branch/gcc/testsuite/ChangeLog
    branches/gcc-8-branch/gcc/testsuite/c-c++-common/gomp/sink-3.c
Comment 4 Jakub Jelinek 2019-08-30 11:07:54 UTC
Author: jakub
Date: Fri Aug 30 11:07:22 2019
New Revision: 275065

URL: https://gcc.gnu.org/viewcvs?rev=275065&root=gcc&view=rev
Log:
	Backported from mainline
	2018-10-19  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/85488
	PR middle-end/87649
	* omp-low.c (check_omp_nesting_restrictions): Diagnose ordered without
	depend closely nested inside of loop with ordered clause with
	a parameter.

	* c-c++-common/gomp/doacross-2.c: New test.
	* c-c++-common/gomp/sink-3.c: Expect another error during error
	recovery.

Added:
    branches/gcc-7-branch/gcc/testsuite/c-c++-common/gomp/doacross-2.c
Modified:
    branches/gcc-7-branch/gcc/ChangeLog
    branches/gcc-7-branch/gcc/omp-low.c
    branches/gcc-7-branch/gcc/testsuite/ChangeLog
    branches/gcc-7-branch/gcc/testsuite/c-c++-common/gomp/sink-3.c