aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>2012-08-10 12:16:04 +0000
committerWilliam Schmidt <wschmidt@gcc.gnu.org>2012-08-10 12:16:04 +0000
commit99cababb4b154f763a609127b498a9f0fa99b3f8 (patch)
tree10cd6b9145e6556cad83db51fb7aec54601c7deb
parent75bc384117ffea9d10bc16d98cf6f2ceee9950ae (diff)
downloadgcc-99cababb4b154f763a609127b498a9f0fa99b3f8.zip
gcc-99cababb4b154f763a609127b498a9f0fa99b3f8.tar.gz
gcc-99cababb4b154f763a609127b498a9f0fa99b3f8.tar.bz2
re PR middle-end/54211 (ICE: verify_gimple failed building freetype with -Os)
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. From-SVN: r190294
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimple-ssa-strength-reduction.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr54211.c28
4 files changed, 40 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1050c56..41e0db3 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 ccc361e9..237c0c9 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 c9e312d..243f595 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 0000000..c8a1591
--- /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:
+ ;
+}