re PR middle-end/33382 (internal compiler error: in get_constraint_for_component_ref...
authorRichard Guenther <rguenther@suse.de>
Wed, 12 Sep 2007 08:07:12 +0000 (08:07 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 12 Sep 2007 08:07:12 +0000 (08:07 +0000)
2007-09-12  Richard Guenther  <rguenther@suse.de>

PR middle-end/33382
* gcc.c-torture/compile/pr33382.c: New testcase.
* gcc.c-torture/execute/pr33382.c: Likewise.

From-SVN: r128419

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr33382.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr33382.c [new file with mode: 0644]

index dc18e62e9f72678e78846f05756c3b53c1a26522..621d8bd0213592b01a0a504ead33e962ed033337 100644 (file)
@@ -1,3 +1,9 @@
+2007-09-12  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/33382
+       * gcc.c-torture/compile/pr33382.c: New testcase.
+       * gcc.c-torture/execute/pr33382.c: Likewise.
+
 2007-09-12  Christopher D. Rickett  <crickett@lanl.gov>
 
        PR fortran/33395
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr33382.c b/gcc/testsuite/gcc.c-torture/compile/pr33382.c
new file mode 100644 (file)
index 0000000..d83f74e
--- /dev/null
@@ -0,0 +1,95 @@
+typedef unsigned int size_t;
+typedef struct {
+    int disable;
+    char *searchconfig[];
+} config_t;
+typedef struct {
+    void *lng;
+} arglist_t;
+config_t config = {
+    .searchconfig = {
+                    ((void *) 0)}
+};
+
+arglist_t arglist[] = {
+    {
+     &config.searchconfig[0]}
+};
+const int arglistsize = ((int) (sizeof(arglist) / sizeof(arglist_t)));
+void show_configuration(char *arg)
+{
+    int i;
+
+    if (!__extension__( {
+                      size_t
+                      __s1_len,
+                      __s2_len; (__builtin_constant_p(arglist[i].lng)
+                                 && (__s1_len = (!((size_t)
+                                                   (const void *)
+                                                   1)
+                                                 || __s2_len >= 4))
+                                 ? : (__builtin_constant_p(arglist[i].lng)
+                                      && ((size_t)
+                                          (const void *)
+                                          4)
+                                      ? (__builtin_constant_p(arg)
+                                         && ((size_t) (const void *) 1) ?
+                                         : (__extension__( {
+                                                          __const * __s2 =
+                                                          (__const *)
+                                                          (arg);
+                                                          register
+                                                          __result =
+                                                          (((__const
+                                                             *) (arglist
+                                                                 [i].
+                                                                 lng))[0]
+                                                           - __s2[0]);
+                                                          if (__s1_len ==
+                                                              0) {
+                                                          if (__s1_len ==
+                                                              0) {
+                                                          __result =
+                                                          (((__const
+                                                             unsigned char
+                                                             *) (__const
+                                                                 char
+                                                                 *)
+                                                            (arglist[i].
+                                                             lng))[3] -
+                                                           __s2[3]);}
+                                                          }
+                                                          __result;}
+      ))):
+                                      (__builtin_constant_p(arg)
+                                       ?
+                                       (__builtin_constant_p
+                                        (arglist[i].lng)
+                                        ? : (__extension__( {
+                                                           char
+                                                           __result
+                                                           =
+                                                           ((__const
+                                                             unsigned *)
+                                                            (arg))[0];
+                                                           if
+                                                           (__s2_len
+                                                            > 0
+                                                            && __result ==
+                                                            0) {
+                                                           if (__s2_len >
+                                                               1
+                                                               && __result
+                                                               == 0) {
+                                                           }
+                                                           }
+                                                           __result;}
+      ))):
+
+
+
+                                       __builtin_strcmp(arglist[i].lng,
+                                                        arg))));}
+       ))
+       return;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr33382.c b/gcc/testsuite/gcc.c-torture/execute/pr33382.c
new file mode 100644 (file)
index 0000000..ee53964
--- /dev/null
@@ -0,0 +1,21 @@
+struct Foo {
+  int i;
+  int j[];
+};
+
+struct Foo x = { 1, { 2, 0, 2, 3 } };
+
+int foo(void)
+{
+  x.j[0] = 1;
+  return x.j[1];
+}
+
+extern void abort(void);
+
+int main()
+{
+  if (foo() != 0)
+    abort();
+  return 0;
+}