re PR tree-optimization/86927 (Gcc miscompiles at -O3 on valid code)

2018-08-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/86927
	* tree-vect-loop.c (vect_create_epilog_for_reduction): Properly
	use const cond reduction code.

	* gcc.dg/vect/pr86927.c: New testcase.

From-SVN: r263888
This commit is contained in:
Richard Biener 2018-08-27 14:17:03 +00:00 committed by Richard Biener
parent de5b522863
commit efc3a1a101
4 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2018-08-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/86927
* tree-vect-loop.c (vect_create_epilog_for_reduction): Properly
use const cond reduction code.
2018-08-27 Alexander Monakov <amonakov@ispras.ru>
PR tree-optimization/85758

View File

@ -1,3 +1,8 @@
2018-08-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/86927
* gcc.dg/vect/pr86927.c: New testcase.
2018-08-27 David Malcolm <dmalcolm@redhat.com>
PR 87091

View File

@ -0,0 +1,15 @@
#include "tree-vect.h"
int a[28];
int main()
{
check_vect ();
a[4] = 1;
int c = 1;
for (int b = 0; b < 8; b++)
if (a[b])
c = 0;
if (c)
abort();
return 0;
}

View File

@ -5197,6 +5197,9 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs,
if (STMT_VINFO_VEC_REDUCTION_TYPE (stmt_info)
== INTEGER_INDUC_COND_REDUCTION)
code = induc_code;
else if (STMT_VINFO_VEC_REDUCTION_TYPE (stmt_info)
== CONST_COND_REDUCTION)
code = STMT_VINFO_VEC_CONST_COND_REDUC_CODE (stmt_info);
else
code = MAX_EXPR;
}