This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: loc_mentioned_in_p invokes undefined behavior
On Nov 7, 2007, Alexandre Oliva <aoliva@redhat.com> wrote:
>> /* Return nonzero if IN contains a piece of rtl that has the address LOC. */
>> int
>> loc_mentioned_in_p (rtx *loc, const_rtx in)
>> means exactly. My interpretation is that the predicate was intended to be
>> generic, in the sense that you woudn't need to overload it
> then it should have taken a void*. But yes, that makes sense.
Except that all 3 uses thereof are really looking for an rtx. So
moving the existing pointer compare could even be a (minor)
performance improvement, in addition to being a beyond-pedantic typing
issue. And then, if we ever want to overload it, it's easy enough to
revert part of this and change the first parameter type to void*.
Given this additional investigation, I propose that the patch goes in
as I first posted it. Ok?
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member http://www.fsfla.org/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}