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]

Re: [PATCH] Fold VIEW_CONVERT_EXPR <type, STRING_CST> generated by Fortran FE a lot (PR target/35366)


On Tue, Nov 11, 2008 at 10:54:11AM -0800, Brooks Moses wrote:
> So, given that we seem to have found that the costs of using all 8
> bytes, or 4 bytes, or whatever, are rather higher than otherwise
> expected.  As a result, I suppose that the tradeoff is that we go with
> what might be considered a poor quality of implementation in this case,
> in return for a better quality of implementation in the case of anything
> that uses logical variables sensibly.

As I said earlier, transfer (transfer (234, .false.), 0) is already
identity, as that never goes through middle-end and BOOLEAN_TYPE.
If assigning transfer (234, .false.) to logical is undefined behavior,
then the only problematic case is
integer :: i, j
i = 234
...
j = transfer (transfer (i, .false.), 0)
(when it is non-constant).  Currently the FE expands this as
2 separate transfers and the optimizers will be able to see through them,
but I'd say the FE could look through the
transfer in the first argument and do whatever the standard requires,
before handing it to the middle-end.  In this case change it to
j = transfer (i, 0) (or just i).

	Jakub


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