This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH RFC: Warn about pointer wraparound with -Wstrict-overflow


Andrew Pinski wrote:
On Tue, Apr 8, 2008 at 12:44 PM, Paul Brook <paul@codesourcery.com> wrote:
 On some targets (e.g. ARM) I believe base+offset addressing modes are
 undefined if the calculation overflows.  So to implement -fwrapv for pointers
 reliably you may need to disable these adressing modes.

HPPA for sure.

That seems like a pretty compelling argument. Wrapping semantics are pretty easy for integers; everyone's hardware works that way. If wrapping semantics are hard to implement for pointers, then maybe we shouldn't try to make -fwrapv work there. In that case, the manual might be improved by saying "... integers (but not pointers)" so that we know that it really means it. We might even have a note that mentions these kinds of hardware platforms.


Thanks,

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]