[Patch, fortran] PR28105 Overflow check for memory allocation

Janne Blomqvist blomqvist.janne@gmail.com
Mon Dec 13 23:00:00 GMT 2010


Hi,

as a result of a recent commit, size_t in the gfortran frontend is now
properly an unsigned type. As a side-effect of this, testing whether a
value of type size_t is negative just generates dead code which is
optimized away. This kind of test was previously used as a crude kind
of overflow check for memory allocation (for the ALLOCATE statement
there is now a proper implementation).

The attached patch removes the generation of this dead code in the first place.

Regtested on x86_64-unknown-linux-gnu, Ok for trunk?

-- 
Janne Blomqvist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ChangeLog.part3
Type: application/octet-stream
Size: 191 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20101213/daec2b8c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: allocate_overflow3.diff
Type: text/x-patch
Size: 5129 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20101213/daec2b8c/attachment.bin>


More information about the Gcc-patches mailing list