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: [PR19351, C++] Fix heap overflow in operator new[]


On Sat, Feb 6, 2010 at 3:13 PM, Florian Weimer <fw@deneb.enyo.de> wrote:
> * Richard Guenther:
>
>> I'd rather have you using something that expands to the saturating
>> SS_PLUS and SS_MULT rtx codes - which means using fixed-point
>> types and adjusting the middle-end to expand saturating operations
>> with generic code sequences if the target does not provide them
>> (with SSE they are for example available on x86_64).
>
> Fixed-point support is broken for me, the <stdfix.h> lacks the proper
> constants. ?It seems to me that the types wouldn't offer sufficient
> precision for this purpose; the scaling factor doesn't appear to be
> suitable.
>
> The C fixed-point ABI is documented to be unstable. ?It would have to
> be set in stone along the process. ?Using fixed-point arithmetic would
> essentially require changing the C++ ABI on some architectures. ?We
> have better options if we want to go that route, but I don't think
> this is acceptable for this kind of change.

Note that it doesn't touch the ABI at all as you only would use
fixed-point types for intermediate computation.  Note that I only
like to see saturating arithmetic used, the suggestion of using
fixed-point types is just that they are the only ones that currently
support that.

> (It's also somewhat unlikely that I'll be able to implement such
> changes to the middle-end, let alone write new expanders for a wide
> range of targets.)

Well.  I suppose you should at least show that for targets where
code size is very important (like arm and for example avr) your
proposed change produces reasonable code (which I doubt).

Thanks,
Richard.


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