diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 661da35a139..0d21111d526 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-05-22 Richard Guenther + + PR middle-end/51071 + * gcc.dg/torture/pr51071-2.c: New testcase. + 2012-05-22 Paolo Bonzini PR tree-optimization/53336 diff --git a/gcc/testsuite/gcc.dg/torture/pr51071-2.c b/gcc/testsuite/gcc.dg/torture/pr51071-2.c new file mode 100644 index 00000000000..f66a89f3958 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr51071-2.c @@ -0,0 +1,38 @@ +/* { dg-do compile } */ +/* { dg-options "-fno-delete-null-pointer-checks" } */ + +extern struct module __this_module; +static inline void +trace_module_get (struct module *mod, unsigned long ip) { } +struct module; +static inline __attribute__((no_instrument_function)) +int try_module_get(struct module *module) +{ + int ret = 1; + if (module) + { + if (module_is_live(module)) + { + __label__ __here; + asm(""); + __here: + trace_module_get(module, (unsigned long)&&__here); + } + else + ret = 0; + } + return ret; +} +struct net_device; +struct net_device_ops { + int (*ndo_open)(struct net_device *dev); +}; +int t3e3_open(struct net_device *dev) +{ + int ret = hdlc_open(dev); + if (ret) + return ret; + try_module_get((&__this_module)); + return 0; +} +const struct net_device_ops t3e3_ops = { .ndo_open = t3e3_open };