The testcase I'm attaching shortly will be miscompiled by IPA-SRA.
The problem is, that SRA splits the pointer argument 'c' of mark_cell into
two new parameters, one being a pointer itself, and another int param. But it
doesn't rewrite the attribute list of the fndecl, hence the nonnull attributes
now "apply" to the new parameters. That's of course bogus and results
in a null-pointer check (on c->p) being optimized out by VRP later.
This happens with simply -O2 (on i686 and x86_64, but it's a generic problem).
--
Summary: IPA-SRA doesn't rewrite attributes
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: matz at gcc dot gnu dot org
GCC host triplet: i686-linux
GCC target triplet: i686-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43835