summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/20030815-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/20030815-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030815-1.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030815-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030815-1.c
new file mode 100644
index 00000000000..13a4917e912
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030815-1.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom3" } */
+
+typedef unsigned int size_t;
+struct rtx_def;
+typedef struct rtx_def *rtx;
+typedef union varray_data_tag
+{
+ struct reg_info_def *reg[1];
+} varray_data;
+struct varray_head_tag
+{
+ size_t num_elements;
+ varray_data data;
+};
+typedef struct varray_head_tag *varray_type;
+typedef struct reg_info_def
+{
+} reg_info;
+extern varray_type reg_n_info;
+static rtx *reg_base_value;
+static rtx *new_reg_base_value;
+static rtx
+blah (unsigned int regno)
+{
+ if (new_reg_base_value[regno] && ((*(
+ {
+ if (regno >=
+ reg_n_info->
+ num_elements)
+ abort ();
+ &reg_n_info->data.reg[regno];}
+ ))))
+ return reg_base_value[regno];
+}
+
+/* If we have more than 1 cast to a struct rtx_def * *, then we failed to
+ eliminate some useless typecasting. The first type cast is needed
+ to convert the unsigned int regno parameter into a struct rtx_def **. */
+/* { dg-final { scan-tree-dump-times "\\(struct rtx_def \\* \\*\\)" 1 "dom3"} } */
+
+