public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/66820] New: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910
@ 2015-07-09  9:47 simon at sconseil dot fr
  2015-07-09  9:48 ` [Bug libgomp/66820] " simon at sconseil dot fr
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: simon at sconseil dot fr @ 2015-07-09  9:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66820

            Bug ID: 66820
           Summary: internal compiler error: in get_expr_operands, at
                    tree-ssa-operands.c:910
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simon at sconseil dot fr
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

Created attachment 35938
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35938&action=edit
Code to reproduce the bug

Hi,
I get this error when compiling a C code using OpenMP, since the upgrade to GCC
5.1, it was compiling without error with GCC 4.9. I'm using Archlinux.
The attached merging.c file is the C code where I removed everything I could to
get a minimal code to reproduce the bug. If I remove the strcat call in the omp
parallel block (and replace it with the commented sprintf) then it compiles.

The C code is wrapped in a python module, below is the compilation log:

$ LANG=C python setup.py build_ext -i 
running build_ext
building 'libCmethods' extension
gcc -pthread -fno-strict-aliasing -march=x86-64 -mtune=generic -O2 -pipe
-fstack-protector-strong --param=ssp-buffer-size=4 -DNDEBUG -march=x86-64
-mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4
-fPIC -I/usr/include/python2.7 -c src/tools.c -o
build/temp.linux-x86_64-2.7/src/tools.o -freport-bug -fopenmp
gcc -pthread -fno-strict-aliasing -march=x86-64 -mtune=generic -O2 -pipe
-fstack-protector-strong --param=ssp-buffer-size=4 -DNDEBUG -march=x86-64
-mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4
-fPIC -I/usr/include/python2.7 -c src/subtract_slice_median.c -o
build/temp.linux-x86_64-2.7/src/subtract_slice_median.o -freport-bug -fopenmp
gcc -pthread -fno-strict-aliasing -march=x86-64 -mtune=generic -O2 -pipe
-fstack-protector-strong --param=ssp-buffer-size=4 -DNDEBUG -march=x86-64
-mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4
-fPIC -I/usr/include/python2.7 -c src/merging.c -o
build/temp.linux-x86_64-2.7/src/merging.o -freport-bug -fopenmp
src/merging.c: In function 'mpdaf_merging_median._omp_fn.0':
src/merging.c:36:1: internal compiler error: in get_expr_operands, at
tree-ssa-operands.c:910
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.
Preprocessed source stored into /tmp/simon/ccsj0rjP.out file, please attach
this to your bugreport.
error: command 'gcc' failed with exit status 1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug libgomp/66820] internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910
  2015-07-09  9:47 [Bug libgomp/66820] New: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910 simon at sconseil dot fr
@ 2015-07-09  9:48 ` simon at sconseil dot fr
  2015-07-09 10:04 ` [Bug libgomp/66820] [5/6 Regression] " mpolacek at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: simon at sconseil dot fr @ 2015-07-09  9:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66820

--- Comment #1 from Simon Conseil <simon at sconseil dot fr> ---
Created attachment 35939
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35939&action=edit
Preprocessed source from -freport-bug


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug libgomp/66820] [5/6 Regression] internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910
  2015-07-09  9:47 [Bug libgomp/66820] New: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910 simon at sconseil dot fr
  2015-07-09  9:48 ` [Bug libgomp/66820] " simon at sconseil dot fr
@ 2015-07-09 10:04 ` mpolacek at gcc dot gnu.org
  2015-07-09 10:16 ` [Bug middle-end/66820] " jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-07-09 10:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66820

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-07-09
                 CC|                            |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |5.3
            Summary|internal compiler error: in |[5/6 Regression] internal
                   |get_expr_operands, at       |compiler error: in
                   |tree-ssa-operands.c:910     |get_expr_operands, at
                   |                            |tree-ssa-operands.c:910
     Ever confirmed|0                           |1

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.  With checking:

$ ./cc1 -quiet ccsj0rjP.out.i -fopenmp
src/merging.c: In function ‘mpdaf_merging_median’:
src/merging.c:35:12: error: non-register as LHS of binary operation
<<< error >>> = &filename + D.2786;
src/merging.c:35:12: error: invalid argument to gimple call
<<< error >>>
__builtin_memcpy (<<< error >>>, "[data]", 7);
src/merging.c:35:12: internal compiler error: verify_gimple failed
0xf63acd verify_gimple_in_seq(gimple_statement_base*)
        /home/marek/src/gcc/gcc/tree-cfg.c:4804
0xe1afd4 execute_function_todo
        /home/marek/src/gcc/gcc/passes.c:1949
0xe1a0ac do_per_function
        /home/marek/src/gcc/gcc/passes.c:1638
0xe1b19f execute_todo
        /home/marek/src/gcc/gcc/passes.c:2004
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
>From gcc-bugs-return-491850-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 09 10:10:07 2015
Return-Path: <gcc-bugs-return-491850-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 53709 invoked by alias); 9 Jul 2015 10:10:07 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 53655 invoked by uid 48); 9 Jul 2015 10:10:03 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgomp/66820] [5/6 Regression] internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910
Date: Thu, 09 Jul 2015 10:10:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libgomp
X-Bugzilla-Version: 5.1.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-66820-4-5yDj2mqo89@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66820-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66820-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-07/txt/msg00740.txt.bz2
Content-length: 143

https://gcc.gnu.org/bugzilla/show_bug.cgi?idf820

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r213753.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/66820] internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910
  2015-07-09  9:47 [Bug libgomp/66820] New: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910 simon at sconseil dot fr
  2015-07-09  9:48 ` [Bug libgomp/66820] " simon at sconseil dot fr
  2015-07-09 10:04 ` [Bug libgomp/66820] [5/6 Regression] " mpolacek at gcc dot gnu.org
@ 2015-07-09 10:16 ` jakub at gcc dot gnu.org
  2015-07-09 10:21 ` [Bug middle-end/66820] [5/6 Regression] " mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-07-09 10:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66820

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |openmp
   Last reconfirmed|2015-07-09 00:00:00         |
          Component|libgomp                     |middle-end
   Target Milestone|5.3                         |5.2
            Summary|[5/6 Regression] internal   |internal compiler error: in
                   |compiler error: in          |get_expr_operands, at
                   |get_expr_operands, at       |tree-ssa-operands.c:910
                   |tree-ssa-operands.c:910     |

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r213753, though more likely OpenMP lowering or expansion bug
somewhere, not handling addressable variables properly.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/66820] [5/6 Regression] internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910
  2015-07-09  9:47 [Bug libgomp/66820] New: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910 simon at sconseil dot fr
                   ` (2 preceding siblings ...)
  2015-07-09 10:16 ` [Bug middle-end/66820] " jakub at gcc dot gnu.org
@ 2015-07-09 10:21 ` mpolacek at gcc dot gnu.org
  2015-07-09 14:34 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-07-09 10:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66820

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I guess related to PR66633.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/66820] [5/6 Regression] internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910
  2015-07-09  9:47 [Bug libgomp/66820] New: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910 simon at sconseil dot fr
                   ` (3 preceding siblings ...)
  2015-07-09 10:21 ` [Bug middle-end/66820] [5/6 Regression] " mpolacek at gcc dot gnu.org
@ 2015-07-09 14:34 ` jakub at gcc dot gnu.org
  2015-07-09 15:14 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-07-09 14:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66820

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, the problem is that the fold_stmt folding added in that revision creates
new decls that it doesn't put into the current gimplification context vars, but
instead creates whole function temporaries.

So we have in *.gimple:
      #pragma omp parallel num_threads(num_nthreads) shared(filenames)
        {
          char * D.2570;
          long unsigned int D.2571;

          {
            char filename[508];
            int i;

            try
              {
                i = 0;
                D.2570 = filenames[i];
                strcpy (&filename, D.2570);
                D.2571 = __builtin_strlen (&filename);
                D.2572 = &filename + D.2571;
                __builtin_memcpy (D.2572, "[data]", 7);
              }
            finally
              {
                filename = {CLOBBER};
              }
          }
where the D.2572 temporary has been created by fold_stmt, but it hasn't been
added into the parallel region (nor has private(D.2572) clause which would work
too).
Right now in gimplify.c maybe_fold_stmt has a hack to avoid folding anything
inside of ORT_TARGET regions, perhaps we should extend that also to
(ctx->region_type & (ORT_PARALLEL | ORT_TASK)) != 0 too (and adjust lower_omp
to fold_stmt accordingly even when taskreg_nesting_level is non-zero).
Or get rid of fold_stmt during gimplification altogether, though that is
supposedly not suitable for gcc 5 (and keep doing it only in forwprop and
later)?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/66820] [5/6 Regression] internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910
  2015-07-09  9:47 [Bug libgomp/66820] New: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910 simon at sconseil dot fr
                   ` (4 preceding siblings ...)
  2015-07-09 14:34 ` jakub at gcc dot gnu.org
@ 2015-07-09 15:14 ` jakub at gcc dot gnu.org
  2015-07-10 10:26 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-07-09 15:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66820

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Note, this is unrelated to PR66633, that one even after the fix is a bug
somewhere in tree-nested.c.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/66820] [5/6 Regression] internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910
  2015-07-09  9:47 [Bug libgomp/66820] New: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910 simon at sconseil dot fr
                   ` (5 preceding siblings ...)
  2015-07-09 15:14 ` jakub at gcc dot gnu.org
@ 2015-07-10 10:26 ` jakub at gcc dot gnu.org
  2015-07-10 14:14 ` jakub at gcc dot gnu.org
  2015-07-10 14:15 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-07-10 10:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66820

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Fri Jul 10 10:26:19 2015
New Revision: 225661

URL: https://gcc.gnu.org/viewcvs?rev=225661&root=gcc&view=rev
Log:
        PR middle-end/66820
        * gimplify.c (maybe_fold_stmt): Don't fold in ORT_PARALLEL
        or ORT_TASK contexts.
        * omp-low.c (lower_omp): Call fold_stmt even if taskreg_nesting_level
        is non-zero.

        * gcc.dg/gomp/pr66820.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/gomp/pr66820.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c
    trunk/gcc/omp-low.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/66820] [5/6 Regression] internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910
  2015-07-09  9:47 [Bug libgomp/66820] New: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910 simon at sconseil dot fr
                   ` (6 preceding siblings ...)
  2015-07-10 10:26 ` jakub at gcc dot gnu.org
@ 2015-07-10 14:14 ` jakub at gcc dot gnu.org
  2015-07-10 14:15 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-07-10 14:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66820

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Fri Jul 10 14:14:18 2015
New Revision: 225678

URL: https://gcc.gnu.org/viewcvs?rev=225678&root=gcc&view=rev
Log:
        PR middle-end/66820
        * gimplify.c (maybe_fold_stmt): Don't fold in ORT_PARALLEL
        or ORT_TASK contexts.
        * omp-low.c (lower_omp): Call fold_stmt even if taskreg_nesting_level
        is non-zero.

        * gcc.dg/gomp/pr66820.c: New test.

Added:
    branches/gcc-5-branch/gcc/testsuite/gcc.dg/gomp/pr66820.c
Modified:
    branches/gcc-5-branch/gcc/ChangeLog
    branches/gcc-5-branch/gcc/gimplify.c
    branches/gcc-5-branch/gcc/omp-low.c
    branches/gcc-5-branch/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/66820] [5/6 Regression] internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910
  2015-07-09  9:47 [Bug libgomp/66820] New: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910 simon at sconseil dot fr
                   ` (7 preceding siblings ...)
  2015-07-10 14:14 ` jakub at gcc dot gnu.org
@ 2015-07-10 14:15 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-07-10 14:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66820

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-07-10 14:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09  9:47 [Bug libgomp/66820] New: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910 simon at sconseil dot fr
2015-07-09  9:48 ` [Bug libgomp/66820] " simon at sconseil dot fr
2015-07-09 10:04 ` [Bug libgomp/66820] [5/6 Regression] " mpolacek at gcc dot gnu.org
2015-07-09 10:16 ` [Bug middle-end/66820] " jakub at gcc dot gnu.org
2015-07-09 10:21 ` [Bug middle-end/66820] [5/6 Regression] " mpolacek at gcc dot gnu.org
2015-07-09 14:34 ` jakub at gcc dot gnu.org
2015-07-09 15:14 ` jakub at gcc dot gnu.org
2015-07-10 10:26 ` jakub at gcc dot gnu.org
2015-07-10 14:14 ` jakub at gcc dot gnu.org
2015-07-10 14:15 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).