[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-09-16 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #17 from Jakub Jelinek  ---
Fixed.

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-09-16 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

--- Comment #16 from Jakub Jelinek  ---
Author: jakub
Date: Sat Sep 16 18:37:09 2017
New Revision: 252883

URL: https://gcc.gnu.org/viewcvs?rev=252883=gcc=rev
Log:
Backported from mainline
2017-08-03  Jakub Jelinek  

PR middle-end/81052
* omp-low.c (diagnose_sb_0): Handle flag_openmp_simd like flag_openmp.
(pass_diagnose_omp_blocks::gate): Enable also for flag_openmp_simd.

* c-c++-common/pr81052.c: New test.

Added:
branches/gcc-5-branch/gcc/testsuite/c-c++-common/pr81052.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/omp-low.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-09-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

--- Comment #15 from Jakub Jelinek  ---
Author: jakub
Date: Fri Sep 15 21:34:10 2017
New Revision: 252856

URL: https://gcc.gnu.org/viewcvs?rev=252856=gcc=rev
Log:
Backported from mainline
2017-08-03  Jakub Jelinek  

PR middle-end/81052
* omp-low.c (diagnose_sb_0): Handle flag_openmp_simd like flag_openmp.
(pass_diagnose_omp_blocks::gate): Enable also for flag_openmp_simd.

* c-c++-common/pr81052.c: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/c-c++-common/pr81052.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/omp-low.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-09-13 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

--- Comment #14 from Aldy Hernandez  ---
Author: aldyh
Date: Wed Sep 13 16:24:28 2017
New Revision: 252271

URL: https://gcc.gnu.org/viewcvs?rev=252271=gcc=rev
Log:
PR middle-end/81052
* omp-low.c (diagnose_sb_0): Handle flag_openmp_simd like flag_openmp.
(pass_diagnose_omp_blocks::gate): Enable also for flag_openmp_simd.

* c-c++-common/pr81052.c: New test.

Added:
branches/range-gen2/gcc/testsuite/c-c++-common/pr81052.c
Modified:
branches/range-gen2/gcc/ChangeLog
branches/range-gen2/gcc/omp-low.c
branches/range-gen2/gcc/testsuite/ChangeLog

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-09-07 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

--- Comment #13 from Jakub Jelinek  ---
Author: jakub
Date: Thu Sep  7 20:19:47 2017
New Revision: 251849

URL: https://gcc.gnu.org/viewcvs?rev=251849=gcc=rev
Log:
Backported from mainline
2017-08-03  Jakub Jelinek  

PR middle-end/81052
* omp-low.c (diagnose_sb_0): Handle flag_openmp_simd like flag_openmp.
(pass_diagnose_omp_blocks::gate): Enable also for flag_openmp_simd.

* c-c++-common/pr81052.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/c-c++-common/pr81052.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/omp-low.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-08-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

--- Comment #12 from Jakub Jelinek  ---
Fixed on the trunk so far (by rejecting it).

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-08-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

--- Comment #11 from Jakub Jelinek  ---
Author: jakub
Date: Thu Aug  3 08:34:16 2017
New Revision: 250847

URL: https://gcc.gnu.org/viewcvs?rev=250847=gcc=rev
Log:
PR middle-end/81052
* omp-low.c (diagnose_sb_0): Handle flag_openmp_simd like flag_openmp.
(pass_diagnose_omp_blocks::gate): Enable also for flag_openmp_simd.

* c-c++-common/pr81052.c: New test.

Added:
trunk/gcc/testsuite/c-c++-common/pr81052.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/omp-low.c
trunk/gcc/testsuite/ChangeLog

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-08-02 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

--- Comment #10 from Jakub Jelinek  ---
Created attachment 41892
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41892=edit
gcc8-pr81052.patch

Untested fix.

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-08-02 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org

--- Comment #9 from Jakub Jelinek  ---
Smaller testcase:
int
foo (int x, int y)
{
  int i;
#pragma omp simd
  for (i = x; i < y; ++i)
return 0;
  return 1;
}

template 
T
bar (T x, T y)
{
  T i;
#pragma omp simd
  for (i = x; i < y; ++i)
return 0;
  return 1;
}

int x = bar (1, 7);

at -O2 -fopenmp-simd.  The bug is that we don't diagnose the invalid code with
just -fopenmp-simd, we do with -fopenmp.

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-08-02 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

--- Comment #8 from Jakub Jelinek  ---
(In reply to Alexander Monakov from comment #7)
> As an aside, shouldn't we issue a diagnostic here? OpenMP spec says
> branching in/out of simd regions is not allowed, and I think we already
> diagnose invalid branching for some other constructs.

Well, normally we certainly diagnose that:

template 
int
foo (int x, int y)
{
  int i;
#pragma omp simd
  for (i = x; i < y; ++i)
return 0;
  return 1;
}

I'll see what's going on.

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-08-02 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

--- Comment #7 from Alexander Monakov  ---
As an aside, shouldn't we issue a diagnostic here? OpenMP spec says branching
in/out of simd regions is not allowed, and I think we already diagnose invalid
branching for some other constructs.

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-08-02 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

Martin Liška  changed:

   What|Removed |Added

 CC||amonakov at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org,
   ||tschwinge at gcc dot gnu.org

--- Comment #6 from Martin Liška  ---
Can please someone who is familiar with omplow code take a look?
The function is quite small:

template < db< 1 > cz > bool dc(bi, bl dd, bl de, cz) {
  bl i;
#pragma omp simd
  for (i = dd; i < de; ++i)
return false;
  return true;
}

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-08-02 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

--- Comment #5 from Martin Liška  ---
Created attachment 41888
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41888=edit
Reduced test-case

Adding reduced test-case (it's hard to reduce more). There's ompexp dump:

bool satyr::dc(auto:1, bl, bl, cz) [with cz =
satyr::execute_with_cancel(satyr::n_array_expression) [with long unsigned int da = 2; Evaluator =
satyr::n_array_evaluator; auto:4 = ce]::; auto:1 =
satyr::n_array_expression<2, satyr::dg, satyr::n_array_evaluator,
ce>] (struct n_array_expression D.3331, bl dd, bl de, struct __lambda1 D.3334)
{
  bl i;
  long int de.1;
  long int dd.0;
  bl i;
  bool D.3383;

   [0.00%] [count: INV]:
  dd.0 = dd;
  de.1 = de;
  i = dd.0;
  i = dd.0;
  goto ; [INV] [count: INV]

   [0.00%] [count: INV]:
  D.3383 = 0;
  goto ; [INV] [count: INV]

   [0.00%] [count: INV]:
  if (i < de.1)
goto ; [87.50%] [count: INV]
  else
goto ; [12.50%] [count: INV]

   [0.00%] [count: INV]:
  if (i == de.1)
goto ; [INV] [count: INV]
  else
goto ; [INV] [count: INV]

   [0.00%] [count: INV]:
  i = i;

   [0.00%] [count: INV]:

   [0.00%] [count: INV]:
  D.3383 = 1;

   [0.00%] [count: INV]:
:
  return D.3383;

}

g++ pr81052.cpp  -std=c++1z  -fopenmp-simd -fconcepts -fdump-tree-ompexp
pr81052.cpp: In function ‘bool satyr::dc(auto:1, bl, bl, cz) [with cz =
satyr::execute_with_cancel(satyr::n_array_expression) [with long unsigned int da = 2; Evaluator =
satyr::n_array_evaluator; auto:4 = ce]::; auto:1 =
satyr::n_array_expression<2, satyr::dg, satyr::n_array_evaluator,
ce>]’:
pr81052.cpp:78:30: error: dominator of 8 should be 9, not 2
 template < db< 1 > cz > bool dc(bi, bl dd, bl de, cz) {
  ^~
during GIMPLE pass: ompexp
dump file: pr81052.cpp.012t.ompexp
pr81052.cpp:78:30: internal compiler error: in verify_dominators, at
dominance.c:1184
0x9c7378 verify_dominators(cdi_direction)
../../gcc/dominance.c:1184
0xdee449 checking_verify_dominators
../../gcc/dominance.h:76
0xdee449 cleanup_tree_cfg_noloop
../../gcc/tree-cfgcleanup.c:781
0xdee449 cleanup_tree_cfg()
../../gcc/tree-cfgcleanup.c:899
0xc75c7c execute_expand_omp
../../gcc/omp-expand.c:8134

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-06-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

Martin Liška  changed:

   What|Removed |Added

 Status|WAITING |NEW
  Known to fail||7.1.0, 8.0

--- Comment #4 from Martin Liška  ---
I see, thanks for that.

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-06-12 Thread ryan.burn at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

--- Comment #3 from ryan.burn at gmail dot com ---
The only other gcc I have installed is

g++ (GCC) 7.0.1 20170408 (experimental)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I attached the preprocessed output from that compiler as well if it helps.

[Bug middle-end/81052] ICE in verify_dominators, at dominance.c:1184

2017-06-12 Thread ryan.burn at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81052

--- Comment #2 from ryan.burn at gmail dot com ---
Created attachment 41538
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41538=edit
old compiler preprocessed