[gfortran] Updates to ISHFT translation

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Sun Jan 9 17:02:00 GMT 2005


Steven Bosscher wrote:
>>-  /* Right shift if negative.  */
>>-  rshift = convert (type, fold (build2 (RSHIFT_EXPR, utype, arg, width)));
>>+  /* Right shift if negative.
>>+     We convert to an unsigned type because we want a logical shift.
>>+     The standard doesn't define the case of shifting negative
>>+     numbers, and we try to be compatible with other compilers, most
>>+     notably g77, here.  */
>>+  rshift = convert (type, 
>>+                   fold (build2 (RSHIFT_EXPR, utype, 
>>+                                 convert (type, arg), width)));
> 
> 
> Why convert there instead of fold_convert?

Because I wasn't aware of its existence.  Looking at it, I'm not sure what the
comment in front of fold_convert should mean to me:
/* Convert expression ARG to type TYPE.  Used by the middle-end for
   simple conversions in preference to calling the front-end's convert.  */
So, in which ways is this semantically different from convert (type, fold (...))

Anyway, updated patch attached, same ChangeLog, testing in progress.

- Tobi

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 19334.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050109/3f9bb9f6/attachment.ksh>


More information about the Fortran mailing list