diff options
author | wschmidt <wschmidt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-10 12:16:04 +0000 |
---|---|---|
committer | wschmidt <wschmidt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-10 12:16:04 +0000 |
commit | fd291195fb951dc73ca124b7bac2c44c4717e123 (patch) | |
tree | 10cd6b9145e6556cad83db51fb7aec54601c7deb /gcc | |
parent | 097cb0d99463a6da1a0c28802f93b01b789e1689 (diff) | |
download | gcc-fd291195fb951dc73ca124b7bac2c44c4717e123.tar.gz |
gcc:
2012-08-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR middle-end/54211
* gimple-ssa-strength-reduction.c (analyze_candidates_and_replace):
Use cand_type to determine whether pointer arithmetic will be generated.
gcc/testsuite:
2012-08-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR middle-end/54211
* gcc.dg/tree-ssa/pr54211.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190294 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/gimple-ssa-strength-reduction.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/pr54211.c | 28 |
4 files changed, 40 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1050c568d07..41e0db37413 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2012-08-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + PR middle-end/54211 + * gimple-ssa-strength-reduction.c (analyze_candidates_and_replace): + Use cand_type to determine whether pointer arithmetic will be generated. + +2012-08-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + * doc/sourcebuild.texi: Document long_neq_int effective target. 2012-08-10 Richard Guenther <rguenther@suse.de> diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index ccc361e900a..237c0c9b425 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -2534,7 +2534,7 @@ analyze_candidates_and_replace (void) /* Determine whether we'll be generating pointer arithmetic when replacing candidates. */ address_arithmetic_p = (c->kind == CAND_ADD - && POINTER_TYPE_P (TREE_TYPE (c->base_expr))); + && POINTER_TYPE_P (c->cand_type)); /* If all candidates have already been replaced under other interpretations, nothing remains to be done. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c9e312d0ec5..243f5950fcc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2012-08-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + PR middle-end/54211 + * gcc.dg/tree-ssa/pr54211.c: New test. + +2012-08-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + * lib/target-supports.exp (check_effective_target_long_neq_int): New. * gcc.dg/tree-ssa/slsr-30.c: Check for long_neq_int effective target. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr54211.c b/gcc/testsuite/gcc.dg/tree-ssa/pr54211.c new file mode 100644 index 00000000000..c8a1591b0a9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr54211.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-Os" } */ + +int a, b; +unsigned char e; +void fn1 () +{ + unsigned char *c=0; + for (;; a++) + { + unsigned char d = *(c + b); + for (; &e<&d; c++) + goto Found_Top; + } +Found_Top: + if (0) + goto Empty_Bitmap; + for (;; a++) + { + unsigned char *e = c + b; + for (; c < e; c++) + goto Found_Bottom; + c -= b; + } +Found_Bottom: +Empty_Bitmap: + ; +} |