summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-08-10 09:22:47 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-08-10 09:22:47 +0000
commit4f4e722eb62eaddb1313c09dfc0fa5d094d78148 (patch)
tree0ad55d17f476854e6ffa83832fc420057243cc73 /gcc/testsuite/gcc.c-torture
parent727e85447dbd3342ca487b7179dc8a06a853f681 (diff)
downloadgcc-4f4e722eb62eaddb1313c09dfc0fa5d094d78148.tar.gz
re PR middle-end/41006 (verify_stmts failed: error: non-trivial conversion at assignment)
2009-08-10 Richard Guenther <rguenther@suse.de> PR middle-end/41006 * tree-ssa.c (useless_type_conversion_p_1): Fold into ... (useless_type_conversion_p): ... here. Require pointer targets to be compatible. * gcc.c-torture/compile/pr41006-1.c: New testcase. * gcc.c-torture/compile/pr41006-2.c: Likewise. From-SVN: r150621
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr41006-1.c17
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr41006-2.c15
2 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41006-1.c b/gcc/testsuite/gcc.c-torture/compile/pr41006-1.c
new file mode 100644
index 00000000000..8aef66dbdfe
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr41006-1.c
@@ -0,0 +1,17 @@
+typedef int (*FARPROC)();
+
+typedef int (*LPFN_ACCEPTEX)(void*);
+static LPFN_ACCEPTEX acceptex_fn;
+
+int xWSAIoctl(void*);
+static void get_fn(FARPROC* fn)
+{
+ FARPROC func;
+ if (!xWSAIoctl( &func))
+ *fn = func;
+}
+
+void get_fn_pointers()
+{
+ get_fn((FARPROC*)&acceptex_fn);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41006-2.c b/gcc/testsuite/gcc.c-torture/compile/pr41006-2.c
new file mode 100644
index 00000000000..766778d410f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr41006-2.c
@@ -0,0 +1,15 @@
+typedef int *FARPROC;
+static int * __restrict__ acceptex_fn;
+
+int xWSAIoctl(void*);
+static void get_fn(FARPROC* fn)
+{
+ FARPROC func;
+ if (!xWSAIoctl( &func))
+ *fn = func;
+}
+
+void get_fn_pointers()
+{
+ get_fn((FARPROC*)&acceptex_fn);
+}