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]

Re: PR3609




--On Thursday, August 09, 2001 08:47:37 PM +0200 Jan Hubicka <jh@suse.cz> 
wrote:

> Hi,
> the conclusion that I can access data past end of constant string
> by knowing what compiler does looks wrong to me.

I agree -- and that was my original response to Franz.  But, it's
trickier than that; I don't see anything that makes, say:

  (char*) (((size_t) "foo") + 100)

outright illegal; it's implementation-defined, but I don't think
it's undefined, and I can understand how you could rely on this.

We can't actually tell, at this point, whether there have been
casts, etc., that information is lost, in general.  (We need
to much better specify how that kind of information is represented
in trees.)

So, I'm not sure what to do.

I do know that it's a priority for GCC 3.0.x to try to make it
so that people can upgrade from GCC 2.95.x.  If that means not
having an optimization (that we didn't have in GCC 2.95.x anyway),
I think that's the right tradeoff -- for now.

Later, if we can convince ourselves that this optimization is
important, we can revisit how to get it back.

Of course, I'm open to alternate solutions as well.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


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