From 79855460bdf36dff2eb97a726475e3f1a4eb5331 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 16 Jul 2015 11:51:28 +0000 Subject: [PATCH] Handle unused reduction in create_loads_for_reductions 2015-07-16 Tom de Vries * tree-parloops.c (create_loads_for_reductions): Handle case that reduction is unused. From-SVN: r225872 --- gcc/ChangeLog | 5 +++++ gcc/tree-parloops.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1d5434c3bb9..cfdf5e75747 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-07-16 Tom de Vries + + * tree-parloops.c (create_loads_for_reductions): Handle case that + reduction is unused. + 2015-07-16 Richard Biener PR tree-optimization/66894 diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 036677bb123..2390d9ec505 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1145,6 +1145,10 @@ create_loads_for_reductions (reduction_info **slot, struct clsn_data *clsn_data) tree name; tree x; + /* If there's no exit phi, the result of the reduction is unused. */ + if (red->keep_res == NULL) + return 1; + gsi = gsi_after_labels (clsn_data->load_bb); load_struct = build_simple_mem_ref (clsn_data->load); load_struct = build3 (COMPONENT_REF, type, load_struct, red->field, -- 2.30.2