[PATCH] Don't assume that constants can clobber vtbl

Maxim Kuvyrkov maxim@codesourcery.com
Sat Oct 1 00:59:00 GMT 2011


This patch makes detect_type_change analysis assume that only ADDR_EXPRs can be assigned to vtable entries.

Initially, the patch made a less strict assumption that constants are not assigned to vtables.  I then bumped the assumption to "only ADDR_EXPRs can be assigned to vtables".  I have this patch since GCC 4.6 and did not came across a testcase that would invalidate either of the assumptions.

Martin, you are the author of stmt_may_be_vtbl_ptr_store; is there any reason to assume that something other than ADDR_EXPR can be assigned to a vtable?

Bootstrapped and regtested on x86_64-linux-gnu {-m64/-m32} with no regressions.

OK for trunk?

Thank you,

--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics


-------------- next part --------------
A non-text attachment was scrubbed...
Name: fsf-gcc-vtbl-assign.ChangeLog
Type: application/octet-stream
Size: 150 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111001/364aa6cd/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fsf-gcc-vtbl-assign.patch
Type: application/octet-stream
Size: 974 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111001/364aa6cd/attachment-0001.obj>


More information about the Gcc-patches mailing list