Bug 59523 - [4.9 Regression] r205856 caused internal compiler error: verify_ssa failed
Summary: [4.9 Regression] r205856 caused internal compiler error: verify_ssa failed
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 4.9.0
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-16 07:33 UTC by Igor Zamyatin
Modified: 2013-12-24 08:49 UTC (History)
2 users (show)

See Also:
Host:
Target: x86
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-12-16 00:00:00


Attachments
Reduced testcase (805 bytes, text/plain)
2013-12-17 08:20 UTC, Igor Zamyatin
Details
gcc49-pr59523.patch (625 bytes, patch)
2013-12-17 16:00 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Zamyatin 2013-12-16 07:33:23 UTC
Happens for options -Ofast -march=core-avx2

For 176.gcc
global.c: In function 'global_alloc':
global.c:277:1: error: excess use operand for stmt
 global_alloc (file)
 ^
1
if (1 != 0)
global.c:277:1: internal compiler error: verify_ssa failed
0xb4c71c verify_ssa(bool)
        ../../gcc/tree-ssa.c:1096
0xabff64 verify_loop_closed_ssa(bool)
        ../../gcc/tree-ssa-loop-manip.c:601
0xac03a4 gimple_duplicate_loop_to_header_edge(loop*, edge_def*, unsigned int, simple_bitmap_def*, edge_def*, vec<edge_def*, va_heap, vl_ptr>*, int)
        ../../gcc/tree-ssa-loop-manip.c:772
0x669f50 loop_version(loop*, void*, basic_block_def**, unsigned int, unsigned int, unsigned int, bool)
        ../../gcc/cfgloopmanip.c:1714
0xb948dc vect_loop_versioning(_loop_vec_info*, unsigned int, bool)
        ../../gcc/tree-vect-loop-manip.c:2368
0xb83a10 vect_transform_loop(_loop_vec_info*)
        ../../gcc/tree-vect-loop.c:5784
0xba0ce9 vectorize_loops()
        ../../gcc/tree-vectorizer.c:473
Comment 1 H.J. Lu 2013-12-16 12:16:00 UTC
Please provide a testcase.
Comment 2 Igor Zamyatin 2013-12-17 08:20:27 UTC
Created attachment 31454 [details]
Reduced testcase
Comment 3 Jakub Jelinek 2013-12-17 15:51:35 UTC
Reduced testcase:
/* PR tree-optimization/59523 */
/* { dg-do compile } */
/* { dg-options "-Ofast" } */
/* { dg-additional-options "-mavx2" { target { i?86-*-* x86_64-*-* } } } */

int *
foo (int a, int *b, int *c)
{
  int i, *r = __builtin_alloca (a * sizeof (int));
  __builtin_memset (r, 0, a * sizeof (int));
  for (i = 0; i < 64; i++)
    c[i] += b[i];
  for (i = 0; i < a; i++)
    if (r[i] == 0)
      r[i] = 1;
  return r;
}
Comment 4 Jakub Jelinek 2013-12-17 16:00:46 UTC
Created attachment 31460 [details]
gcc49-pr59523.patch

Untested fix.
Comment 5 Jakub Jelinek 2013-12-17 21:36:23 UTC
Author: jakub
Date: Tue Dec 17 21:36:21 2013
New Revision: 206069

URL: http://gcc.gnu.org/viewcvs?rev=206069&root=gcc&view=rev
Log:
	PR tree-optimization/59523
	* tree-vectorizer.c (fold_loop_vectorized_call): Call update_stmt
	on updated stmts.

	* gcc.dg/pr59523.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr59523.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vectorizer.c
Comment 6 Jakub Jelinek 2013-12-17 21:38:19 UTC
Fixed.
Comment 7 Igor Zamyatin 2013-12-24 08:49:34 UTC
Seems to cause PR59591