diff options
author | Richard Guenther <rguenther@suse.de> | 2010-02-19 15:42:31 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-02-19 15:42:31 +0000 |
commit | c7da0354531098a6827b42b00689e92ef61053cd (patch) | |
tree | 4b89e58bc0e9daefe49eba7bec41de25c0c6e3ec | |
parent | e5dfb95fd7d79615a7d6a9573ea6d4aaa6c8d1bc (diff) | |
download | gcc-c7da0354531098a6827b42b00689e92ef61053cd.zip gcc-c7da0354531098a6827b42b00689e92ef61053cd.tar.gz gcc-c7da0354531098a6827b42b00689e92ef61053cd.tar.bz2 |
re PR tree-optimization/42916 ("-fcompare-debug failure" with "-O1 -funroll-loops -ftree-vectorize")
2010-02-19 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42916
* tree-vect-slp.c (vect_slp_analyze_bb): Count only real
instructions.
* gcc.dg/pr42916.c: New testcase.
From-SVN: r156898
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr42916.c | 20 | ||||
-rw-r--r-- | gcc/tree-vect-slp.c | 8 |
4 files changed, 38 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1d230c4..c516bb8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-02-19 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/42916 + * tree-vect-slp.c (vect_slp_analyze_bb): Count only real + instructions. + 2010-02-19 Andreas Schwab <schwab@linux-m68k.org> * configure.ac: Replace all uses of changequote in macro arguments diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 10f8fff..ff44628 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-02-19 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/42916 + * gcc.dg/pr42916.c: New testcase. + 2010-02-18 Jason Merrill <jason@redhat.com> PR c++/42837 diff --git a/gcc/testsuite/gcc.dg/pr42916.c b/gcc/testsuite/gcc.dg/pr42916.c new file mode 100644 index 0000000..d32ba94 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr42916.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -funroll-loops -ftree-vectorize -fcompare-debug" } */ + +int seed; + +static inline int hash(const char *str) +{ + int h = seed++; + int i = 12; + while (i--) + h += (h << 3) ^ *str++; + return h; +} + +void f(const char *str, int *h) +{ + int i = 6; + while (i--) + *h++ = hash(str); +} diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 5a11b84..ee4807a 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1273,7 +1273,13 @@ vect_slp_analyze_bb (basic_block bb) fprintf (vect_dump, "===vect_slp_analyze_bb===\n"); for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) - insns++; + { + gimple stmt = gsi_stmt (gsi); + if (!is_gimple_debug (stmt) + && !gimple_nop_p (stmt) + && !gimple_code (stmt) == GIMPLE_LABEL) + insns++; + } if (insns > PARAM_VALUE (PARAM_SLP_MAX_INSNS_IN_BB)) { |