aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-06-18 14:05:27 +0000
committerRichard Guenther <rguenther@suse.de>2012-06-18 14:05:27 +0000
commit73a1290b28cdc0b5f2e7ccaf9a7cc031298b390e (patch)
tree63fda7b3c2847615a9a2cc1f82d7ccaca1f96618 /gcc/tree-vect-patterns.c
parent850952f0e70529644d41c47c4397ee3a0b73d4be (diff)
2012-06-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53693 * tree-vect-patterns.c (vect_operation_fits_smaller_type): Reject operands with more than one use. * g++.dg/torture/pr53693.C: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@188733 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r--gcc/tree-vect-patterns.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 4138d41c11d..11a5019985c 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -991,6 +991,11 @@ vect_operation_fits_smaller_type (gimple stmt, tree def, tree *new_type,
|| TREE_CODE (const_oprnd) != INTEGER_CST)
return false;
+ /* If oprnd has other uses besides that in stmt we cannot mark it
+ as being part of a pattern only. */
+ if (!has_single_use (oprnd))
+ return false;
+
/* If we are in the middle of a sequence, we use DEF from a previous
statement. Otherwise, OPRND has to be a result of type promotion. */
if (*new_type)