[Bug c++/79512] [6/7 Regression] ICE: Segfault in gimple_build_call_1, at gimple.c:218

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

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Thu Feb 16 12:02:24 2017
New Revision: 245504

URL: https://gcc.gnu.org/viewcvs?rev=245504&root=gcc&view=rev
Log:
PR c++/79512
c/
* c-parser.c (c_parser_omp_target): For -fopenmp-simd
ignore #pragma omp target even when not followed by identifier.
cp/
* parser.c (cp_parser_omp_target): For -fopenmp-simd
ignore #pragma omp target even when not followed by identifier.
testsuite/
* c-c++-common/gomp/pr79512.c: New test.

Added:
trunk/gcc/testsuite/c-c++-common/gomp/pr79512.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-parser.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/79512] [6/7 Regression] ICE: Segfault in gimple_build_call_1, at gimple.c:218

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

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #3 from Jakub Jelinek  ---
Created attachment 40747
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40747&action=edit
gcc7-pr79512.patch

Untested fix.

[Bug c++/79512] [6/7 Regression] ICE: Segfault in gimple_build_call_1, at gimple.c:218

2017-02-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79512

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|7.0 |6.4

[Bug c++/79512] [6/7 Regression] ICE: Segfault in gimple_build_call_1, at gimple.c:218

2017-02-15 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79512

--- Comment #2 from Tom de Vries  ---
Created attachment 40743
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40743&action=edit
Demonstrator patch. Uses flag_openmp_simd in DEF_GOMP_BUILTIN

This patch roughly restores the situation from before r224745.

With the patch, and after renaming the test function to main, we get:
...
$ gcc test.c -fopenmp-simd 
/tmp/ccPdaFhw.o: In function `main':
test.c:(.text+0x4e): undefined reference to `GOMP_target_ext'
collect2: error: ld returned 1 exit status
...

Here ( https://gcc.gnu.org/ml/gcc-patches/2013-10/msg02275.html ) I read about
fopenmp-simd:
...
This patch add the new option "-fopenmp-simd", which allows to use OpenMP 4.0's
"simd" pragmas without enabling OpenMP's threading or target features - and,
thus, it also doesn't require linking of libgomp.
...

The fact that libgomp is required by the generated code, seems to mean that the
test-case is not a valid fopenmp-simd testcase. This is confirmed by the fact
that "#pragma omp target teams" is not listed as supported pragma in the
gcc-patches message above.

I think the correct handling in this case would be to ignore the pragmas, which
currently is not done, and that's probably the root cause of the ICE.

[Bug c++/79512] [6/7 Regression] ICE: Segfault in gimple_build_call_1, at gimple.c:218

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

Martin Liška  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-02-14
 CC||marxin at gcc dot gnu.org,
   ||vries at gcc dot gnu.org
   Target Milestone|--- |7.0
Summary|ICE: Segfault in|[6/7 Regression] ICE:
   |gimple_build_call_1, at |Segfault in
   |gimple.c:218|gimple_build_call_1, at
   ||gimple.c:218
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed, started with r224745.