Bug 68766 - [6 regression] internal compiler error: in expand_LOOP_VECTORIZED, at internal-fn.c:1905
Summary: [6 regression] internal compiler error: in expand_LOOP_VECTORIZED, at interna...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 6.0
: P3 normal
Target Milestone: 6.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-07 13:12 UTC by Ilya Enkovich
Modified: 2015-12-08 09:13 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2015-12-07 00:00:00


Attachments
Reproducer (105 bytes, text/plain)
2015-12-07 13:12 UTC, Ilya Enkovich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Enkovich 2015-12-07 13:12:06 UTC
Created attachment 36942 [details]
Reproducer

>gcc  -O2 -ftree-vectorize -mavx2 -c test.i -fdbg-cnt=vect_loop:1
dbg_cnt 'vect_loop' set to 1
test.i: In function 'fn2':
test.i:10:5: internal compiler error: in expand_LOOP_VECTORIZED, at internal-fn.c:1905
 int fn2() {
     ^~~

0xacb1c3 expand_LOOP_VECTORIZED
        gcc/internal-fn.c:1905
0xacd383 expand_internal_call(internal_fn, gcall*)
        gcc/internal-fn.c:2325
0xacd3ab expand_internal_call(gcall*)
        gcc/internal-fn.c:2333
0x8633da expand_call_stmt
        gcc/cfgexpand.c:2550
0x866a0b expand_gimple_stmt_1
        gcc/cfgexpand.c:3525
0x8670de expand_gimple_stmt
        gcc/cfgexpand.c:3691
0x86e1e9 expand_gimple_basic_block
        gcc/cfgexpand.c:5697
0x86fced execute
        gcc/cfgexpand.c:6312
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.

>gcc -v
Using built-in specs.
COLLECT_GCC=/export/users/ienkovic/issues/avx-512/gcc-build/bin/gcc
COLLECT_LTO_WRAPPER=/export/users/ienkovic/issues/avx-512/gcc-build/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: gcc/configure --prefix=gcc-build --enable-languages=c,c++,fortran --disable-bootstrap --disable-libsanitizer
Thread model: posix
gcc version 6.0.0 20151207 (experimental) (GCC)
Comment 1 Marek Polacek 2015-12-07 13:34:04 UTC
Confirmed, seems to have started with r230100.
Comment 2 Ilya Enkovich 2015-12-07 13:38:26 UTC
This patch helps:

diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index b721c56..c496c4b 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -536,7 +536,13 @@ vectorize_loops (void)
          continue;

         if (!dbg_cnt (vect_loop))
-         break;
+         {
+           /* We may miss some if-converted loops due to
+              debug counter.  Set any_ifcvt_loops to visit
+              them at finalization.  */
+           any_ifcvt_loops = true;
+           break;
+         }

        gimple *loop_vectorized_call = vect_loop_vectorized_call (loop);
        if (loop_vectorized_call)
Comment 3 Jakub Jelinek 2015-12-07 13:50:56 UTC
Preapproved for trunk (with proper ChangeLog entry and testcase added).
Comment 4 Ilya Enkovich 2015-12-08 07:16:36 UTC
Author: ienkovich
Date: Tue Dec  8 07:16:04 2015
New Revision: 231395

URL: https://gcc.gnu.org/viewcvs?rev=231395&root=gcc&view=rev
Log:
gcc/

	PR tree-optimization/68766
	* tree-vectorizer.c (vectorize_loops): Check for
	if-converted loops when debug counters are used.

gcc/testsuite/

	PR tree-optimization/68766
	* gcc.dg/pr68766.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr68766.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vectorizer.c
Comment 5 Ilya Enkovich 2015-12-08 09:13:13 UTC
Fixed