]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/34127 (ICE: tree-ssa-operands.c:1688)
authorRichard Guenther <rguenther@suse.de>
Sun, 18 Nov 2007 15:49:57 +0000 (15:49 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sun, 18 Nov 2007 15:49:57 +0000 (15:49 +0000)
2007-11-18  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/34127
* tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars):
Make code match up the comments, require compatibility of the
pointed-to types.

* gcc.c-torture/compile/pr34127.c: New testcase.

From-SVN: r130269

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr34127.c [new file with mode: 0644]
gcc/tree-ssa-forwprop.c

index 3151f57deb0615768e7f6aacea75ebfa3d564bf2..da17d5f114a9cd94500cee74157c6b917a148713 100644 (file)
@@ -1,3 +1,10 @@
+2007-11-18  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/34127
+       * tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars):
+       Make code match up the comments, require compatibility of the
+       pointed-to types.
+
 2007-11-17  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/34130
index 62d039e27eb915b90bbfdb880b800c13a7ee2572..2868de085136506624edd848bc3607e8313406fc 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-18  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/34127
+       * gcc.c-torture/compile/pr34127.c: New testcase.
+
 2007-11-18  Ben Elliston  <bje@au.ibm.com>
 
        * gcc.target/powerpc/altivec-23.c: Do not use a typedef name as a
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr34127.c b/gcc/testsuite/gcc.c-torture/compile/pr34127.c
new file mode 100644 (file)
index 0000000..10d41ac
--- /dev/null
@@ -0,0 +1,9 @@
+static void 
+whichtable(char **pfmt)
+{
+  --*pfmt;
+}
+void prepare_s(const char *fmt)
+{
+  whichtable((char **)&fmt);
+}
index 661d3d2a240209e8e1b05ee90c6fa31b2fb8f7d3..3e30454ab9f42eb8f03d4c23f56dd41739a88917 100644 (file)
@@ -959,8 +959,8 @@ tree_ssa_forward_propagate_single_use_vars (void)
                       || TREE_CODE (rhs) == CONVERT_EXPR)
                      && TREE_CODE (TREE_OPERAND (rhs, 0)) == ADDR_EXPR
                      && POINTER_TYPE_P (TREE_TYPE (rhs))
-                     && useless_type_conversion_p (TREE_TYPE (TREE_TYPE (TREE_OPERAND (rhs, 0))),
-                                                   TREE_TYPE (TREE_TYPE (rhs)))))
+                     && types_compatible_p (TREE_TYPE (TREE_TYPE (TREE_OPERAND (rhs, 0))),
+                                            TREE_TYPE (TREE_TYPE (rhs)))))
                {
                  if (forward_propagate_addr_expr (lhs, rhs))
                    {