[Patch] Fix PR 30045, ICE in nonnull_arg_p with static chain decl

Andrew Pinski pinskia@gmail.com
Sun Dec 3 09:18:00 GMT 2006


Hi,
  The problem here is since the static chain decl is a PARAM_DECL and is
a pointer type, we go through the look in nonnull_arg_p and we found we
cannot find the argument number so we abort.  We could fix it a couple
of different ways:
1) treat static chain decls as non null as they will always be
deferenced
2) remove the gcc_assert and return false if we don't match the
argument.


I choose 1 because it is safer and it can help code generation even
without the nonnull attribute.

OK? Bootstrapped and tested on i686-linux-gnu with no regressions.

Thanks,
Andrew Pinski


ChangeLog:

	* tree-vrp.c (nonnull_arg_p): Treat the static decl as always
	non null.

	* gcc.dg/pr30045.c: New test.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixpr30045.diff.txt
Type: text/x-patch
Size: 970 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061203/8b72f7f3/attachment.bin>


More information about the Gcc-patches mailing list