aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2019-08-27 17:03:45 -0600
committerJeff Law <law@gcc.gnu.org>2019-08-27 17:03:45 -0600
commit2d8ba44101028f4be534a20a0d2146695e1dc4fd (patch)
tree9ba699bb3eb8b0c9f8d88562019025d8452aea4c /gcc/testsuite/gcc.c-torture
parent2bd86b95f76315f102c52a81453ef375c97e8f1b (diff)
downloadgcc-2d8ba44101028f4be534a20a0d2146695e1dc4fd.zip
gcc-2d8ba44101028f4be534a20a0d2146695e1dc4fd.tar.gz
gcc-2d8ba44101028f4be534a20a0d2146695e1dc4fd.tar.bz2
tree-ssa-strlen.c (printf_strlen_execute): Initialize the loop optimizer and SCEV before sizing ssa_ver_to_stridx.
* tree-ssa-strlen.c (printf_strlen_execute): Initialize the loop optimizer and SCEV before sizing ssa_ver_to_stridx. * gcc.c-torture/compile/20190827-1.c: New test. From-SVN: r274975
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20190827-1.c104
1 files changed, 104 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/20190827-1.c b/gcc/testsuite/gcc.c-torture/compile/20190827-1.c
new file mode 100644
index 0000000..f095617
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20190827-1.c
@@ -0,0 +1,104 @@
+typedef unsigned char __u8;
+typedef __u8 u8;
+typedef u8 u_int8_t;
+typedef unsigned int gfp_t;
+
+struct list_head
+{
+ struct list_head *next, *prev;
+};
+extern int strcmp (const char *, const char *);
+enum
+{
+ NFPROTO_UNSPEC = 0,
+ NFPROTO_INET = 1,
+ NFPROTO_IPV4 = 2,
+ NFPROTO_ARP = 3,
+ NFPROTO_NETDEV = 5,
+ NFPROTO_BRIDGE = 7,
+ NFPROTO_IPV6 = 10,
+ NFPROTO_DECNET = 12,
+ NFPROTO_NUMPROTO,
+};
+
+struct xt_target
+{
+ struct list_head list;
+ const char name[29];
+ u_int8_t revision;
+};
+
+struct xt_af
+{
+ struct list_head target;
+};
+
+static struct xt_af *xt;
+
+struct xt_af * kcalloc (int, int, int);
+
+static int
+target_revfn (u8 af, const char *name, u8 revision, int *bestp)
+{
+ const struct xt_target *t;
+ int have_rev = 0;
+
+ for (t = (
+ {
+ void *__mptr = (void *)((&xt[af].target)->next);
+ ((typeof (*t) *) (__mptr -
+ __builtin_offsetof (typeof (*t), list)));}
+ ); &t->list != (&xt[af].target); t = (
+ {
+ void *__mptr =
+ (void *)((t)->list.next);
+ ((typeof (*(t)) *) (__mptr -
+ __builtin_offsetof
+ (typeof
+ (*(t)),
+ list)));}
+ ))
+ {
+ if (strcmp (t->name, name) == 0)
+ {
+ if (t->revision > *bestp)
+ *bestp = t->revision;
+ if (t->revision == revision)
+ have_rev = 1;
+ }
+ }
+
+ if (af != NFPROTO_UNSPEC && !have_rev)
+ return target_revfn (NFPROTO_UNSPEC, name, revision, bestp);
+
+ return have_rev;
+}
+
+int
+xt_find_revision (u8 af, const char *name, u8 revision, int target, int *err)
+{
+ int have_rev, best = -1;
+
+ have_rev = target_revfn (af, name, revision, &best);
+
+
+ if (best == -1)
+ {
+ *err = -2;
+ return 0;
+ }
+
+}
+
+
+static int __attribute__ ((__section__ (".init.text")))
+ __attribute__ ((__cold__)) xt_init (void)
+{
+ xt =
+ kcalloc (NFPROTO_NUMPROTO, sizeof (struct xt_af),
+ (((gfp_t) (0x400u | 0x800u)) | ((gfp_t) 0x40u) |
+ ((gfp_t) 0x80u)));
+}
+
+int init_module (void) __attribute__ ((__copy__ (xt_init)))
+ __attribute__ ((alias ("xt_init")));;