RFC: gfc_simplify_transfer implementation.

Brooks Moses brooks.moses@codesourcery.com
Wed Mar 28 00:02:00 GMT 2007


François-Xavier Coudert wrote:
> As soon as I sent the mail, I understood why this sentence is  
> completely wrong. But anyway, is there any reason that the following  
> wouldn't work for taking care of memory representation:
>    - create a constant tree from the constant value
>    - fold_convert the value into the other type of similar length
>    - read back the value from the constant tree
> 
> I guess it's not low overhead, but that way we're relying on the  
> middle-end to get the target memory representation right in all  
> cases :)  And it's probably not so hard to code and test, and then  
> you can refine it if you want to.

Indeed.  That, and your suggestion about using the bit_size fields to 
compute the size, are pretty much the sort of thing I was thinking of 
for how to get the target-memory representation "right" in the 
individual export_expr and import_expr functions, rather than using the 
versions that I've implemented now.  I definitely agree that this sort 
of thing should be pushed off to the middle-end as much as possible.

(Or are you also suggesting that it should be possible to do this for 
the whole expressions, rather than splitting them into components first 
and doing it to the individual components?  That's an interesting 
thought, if true.)

- Brooks



More information about the Fortran mailing list