re PR middle-end/51071 (ICE in gimple_has_side_effects, at gimple.c:2513)

2012-05-22  Richard Guenther  <rguenther@suse.de>

	PR middle-end/51071
	* gcc.dg/torture/pr51071-2.c: New testcase.

From-SVN: r187768
This commit is contained in:
Richard Guenther 2012-05-22 09:35:32 +00:00 committed by Richard Biener
parent 27eb31c9de
commit 633d9236a1
2 changed files with 43 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2012-05-22 Richard Guenther <rguenther@suse.de>
PR middle-end/51071
* gcc.dg/torture/pr51071-2.c: New testcase.
2012-05-22 Paolo Bonzini <bonzini@gnu.org>
PR tree-optimization/53336

View File

@ -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 };