]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/37713 (ice for legal code with -O3 on 20080926)
authorRichard Guenther <rguenther@suse.de>
Thu, 2 Oct 2008 13:11:12 +0000 (13:11 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 2 Oct 2008 13:11:12 +0000 (13:11 +0000)
2008-10-02  Richard Guenther  <rguenther@suse.de>

PR middle-end/37713
* tree-ssa.c (useless_type_conversion_p_1): For COMPLEX_TYPE
and VECTOR_TYPE recurse with useless_type_conversion_p which
properly handles void pointer conversion.

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

From-SVN: r140832

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

index 52fe4dc687675781df3ef532aab072747ea1f24c..e46778d7be16c79d7cfd7f512eb19caf055d68ac 100644 (file)
@@ -1,3 +1,10 @@
+2008-10-02  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/37713
+       * tree-ssa.c (useless_type_conversion_p_1): For COMPLEX_TYPE
+       and VECTOR_TYPE recurse with useless_type_conversion_p which
+       properly handles void pointer conversion.
+
 2008-10-02  Danny Smith  <dannysmith@users.sourceforge.net>  
 
        PR target/37528
index f661afde3da6c9db8780041ec3fd40fd3b6ad393..b19e9463a52736fe4608a0c5e6a5b68eb4b060ea 100644 (file)
@@ -1,3 +1,8 @@
+2008-10-02  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/37713
+       * gcc.c-torture/compile/pr37713.c: New testcase.
+
 2008-10-01  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
        * gcc.target/powerpc/altivec-cell-1.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37713.c b/gcc/testsuite/gcc.c-torture/compile/pr37713.c
new file mode 100644 (file)
index 0000000..04b4394
--- /dev/null
@@ -0,0 +1,10 @@
+void add_opush(void)
+{
+    unsigned char formats[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0xff };
+    void *dtds[sizeof(formats)];
+    unsigned int i;
+    unsigned char dtd = 0x08;
+    for (i = 0; i < sizeof(formats); i++)
+       dtds[i] = &dtd;
+    sdp_seq_alloc(dtds);
+}
index 073e1290b3cb475c58ee0bc7e5963bd5a739fb6d..c53c528745388a10368ab82feff91baa7ea0019c 100644 (file)
@@ -1159,15 +1159,15 @@ useless_type_conversion_p_1 (tree outer_type, tree inner_type)
   /* Recurse for complex types.  */
   else if (TREE_CODE (inner_type) == COMPLEX_TYPE
           && TREE_CODE (outer_type) == COMPLEX_TYPE)
-    return useless_type_conversion_p_1 (TREE_TYPE (outer_type),
-                                       TREE_TYPE (inner_type));
+    return useless_type_conversion_p (TREE_TYPE (outer_type),
+                                     TREE_TYPE (inner_type));
 
   /* Recurse for vector types with the same number of subparts.  */
   else if (TREE_CODE (inner_type) == VECTOR_TYPE
           && TREE_CODE (outer_type) == VECTOR_TYPE
           && TYPE_PRECISION (inner_type) == TYPE_PRECISION (outer_type))
-    return useless_type_conversion_p_1 (TREE_TYPE (outer_type),
-                                       TREE_TYPE (inner_type));
+    return useless_type_conversion_p (TREE_TYPE (outer_type),
+                                     TREE_TYPE (inner_type));
 
   /* For aggregates we may need to fall back to structural equality
      checks.  */