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]

[gfortran,patch] Fix PR32046 by avoiding mismatched types coming from TYPE_SIZE_UNIT


Hi all,

Attached patch is a fix for PR32046, a 4.3 regression due to a preexisting bug in the front-end, which was exposed on 64-bit platforms by my malloc/free patch (due to the additional optimization done by the middle-end). The bug is actually simple: we build array sizes with TYPE_SIZE_UNIT, which is unsigned, and we multiplied it with the item count (signed) to obtain the size (signed). This simple patch reviews the use of TYPE_SIZE_UNIT in the front-end, and converts it to the signed type every time it will be used for signed calculations.

Bootstrapped and regtested on x86_64-linux, doesn't come with a testcase since there already are two in our testsuite. OK for mainline?


:ADDPATCH fortran:

Attachment: TYPE_SIZE_UNIT.ChangeLog
Description: Binary data

Attachment: TYPE_SIZE_UNIT.diff
Description: Binary data


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