[gfortran,patch] Fix type for LOC function return

FX Coudert fxcoudert@gmail.com
Mon Oct 2 21:59:00 GMT 2006


Asher, everyone,

A series of patches by Andrew Pinski allow the middle-end to spot  
type mismatches emitted by the front-end (see PR 22368 for details).  
Among the problems revealed by this patch is the following code: "loc 
(c) == 0", because the code returned by LOC is unsigned, which is not  
what we should do. Indeed, the documentation states that:

The return value is of type @code{INTEGER(n)}, where @code{n} is the
size (in bytes) of a memory address on the target machine.

So, I propose to change the gfc_trans_intrinsic_loc function to that  
its result is fold_convert'ed to the right integer type. I plan to  
commit the following patch on mainline next week-end unless someone  
objects.

Regtested (with Andrew's patches) on i686-linux.

FX



-------------- next part --------------
A non-text attachment was scrubbed...
Name: loc_type.diff
Type: application/octet-stream
Size: 866 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061002/28846135/attachment.obj>


More information about the Fortran mailing list