This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/81500] [8 Regression] ICE with -O3 in process_use, at tree-vect-stmts.c:506
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 21 Jul 2017 09:36:38 +0000
- Subject: [Bug tree-optimization/81500] [8 Regression] ICE with -O3 in process_use, at tree-vect-stmts.c:506
- Auto-submitted: auto-generated
- References: <bug-81500-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81500
--- Comment #4 from rguenther at suse dot de <rguenther at suse dot de> ---
On Fri, 21 Jul 2017, dcb314 at hotmail dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81500
>
> --- Comment #3 from David Binderman <dcb314 at hotmail dot com> ---
> Possible duplicate for this reduced code:
>
> struct a {
> int b;
> int c
> };
> struct d {
> struct a *e
> } f(struct d *g) {
> int h;
> int b;
> for (; h; ++h) {
> int i = g->e[h].c + 1;
> g->e[h].c = g->e[h].b;
> g->e[h].b = b;
> b = i;
> }
> if (b)
> j();
> }
Yeah. Fix is obvious:
Index: gcc/tree-vect-loop.c
===================================================================
--- gcc/tree-vect-loop.c (revision 250386)
+++ gcc/tree-vect-loop.c (working copy)
@@ -3243,7 +3243,7 @@ pop:
}
/* Check whether the reduction path detected is valid. */
- bool fail = false;
+ bool fail = path.length () == 0;
bool neg = false;
for (unsigned i = 1; i < path.length (); ++i)
{
@@ -3276,9 +3276,7 @@ pop:
if (dump_enabled_p ())
{
- report_vect_op (MSG_MISSED_OPTIMIZATION,
- SSA_NAME_DEF_STMT
- (USE_FROM_PTR (path[path.length ()-1].second)),
+ report_vect_op (MSG_MISSED_OPTIMIZATION, def_stmt,
"reduction: unknown pattern: ");
}