Re: Code or compiler bug re: TRANSFER intrinsic?
From: Richard Maine (nospam_at_see.signature)
Date: 08/16/04
- Next message: Kevin G. Rhoads: "Re: Fortran Newbie - Where to start?"
- Previous message: Paul Van Delst: "Re: Code or compiler bug re: TRANSFER intrinsic?"
- In reply to: Paul Van Delst: "Re: Code or compiler bug re: TRANSFER intrinsic?"
- Next in thread: Paul Van Delst: "Re: Code or compiler bug re: TRANSFER intrinsic?"
- Reply: Paul Van Delst: "Re: Code or compiler bug re: TRANSFER intrinsic?"
- Reply: James Van Buskirk: "Re: Code or compiler bug re: TRANSFER intrinsic?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 16 Aug 2004 08:49:44 -0700
Paul Van Delst <paul.vandelst@noaa.gov> writes:
> jan van oosterwijk wrote:
> > Paul Van Delst <paul.vandelst@noaa.gov> wrote in message news:<cfirmp$54a$1@news.nems.noaa.gov>...
> >> Output = TRANSFER( Byte_Equivalent( N:1:-1), Output )
> > IMHO you are using TRANSFER in a totally correct way.
> However, the IBM reply I got was
>
> "It looks like an ambiguity in the definition of what TRANSFER does
> and I don't know whether this is a bug or a different interpretation
> of the fortran standard. TRANSFER is supposed to move bits from the
> first argument to its LHS which is of the same type and kind as the
> second argument. I have not found the ability to move bits in a
> different order (i.e byte flipping) documented."
I don't see a problem with the code either, though I have some
agreement with IBM's statement. I'll note:
1. In earlier days of f90, I used TRANSFER more often, and I found it
to be one of the biggest sources of compiler bugs. Almost every
compiler I tried had a bug relating to it somewhere. That was
a while ago, and I haven't seen those bugs so much recently. I
think that's mostly because the compilers eventually got it under
control, but it might also be partly because I use it so rarely
now that I don't push the compilers as far.
2. Performance of TRANSFER tends to be abysmal. As a result, I've
tended to use EQUIVALENCE tricks instead of transfer tricks. I
don't do a lot of those either, but a few isolated cases.
3. On IBM's comment - I'd interpret the argument to TRANSFER as
being already re-ordered. That would be part of the argument
association process instead of part of TRANSFER itself. But
then, that relates to a separate matter that I've recently
been harping on in J3 - that the standard uses the term "actual
argument" for 2 different things, which causes confusions. One
of those things is what gets written in the "actual argument list";
the other is what gets associated with the dummy argument. In
many cases, the two are the same, but not always. In particular,
when the actual argument is a pointer and the dummy is not, the
dummy gets associated with the target of the actual argument
instead of with the actual argument itself. But other places
in the standard talk about "the actual argument that is associated
with the dummy".
Anyway, in a way I agree that the definition of TRANSFER is a
bit vague in some cases such as this. What is the "bit pattern"
of the actual argument? One could easily imagine the bit paattern
of a contiguous copy of the actual argument... but that business
about making copies is just a common implementation choice rather
than something specified in the standard. I'm not sure what
it means to talk about the bit pattern of a strided array.
-- Richard Maine | Good judgment comes from experience; email: my first.last at org.domain | experience comes from bad judgment. org: nasa, domain: gov | -- Mark Twain
- Next message: Kevin G. Rhoads: "Re: Fortran Newbie - Where to start?"
- Previous message: Paul Van Delst: "Re: Code or compiler bug re: TRANSFER intrinsic?"
- In reply to: Paul Van Delst: "Re: Code or compiler bug re: TRANSFER intrinsic?"
- Next in thread: Paul Van Delst: "Re: Code or compiler bug re: TRANSFER intrinsic?"
- Reply: Paul Van Delst: "Re: Code or compiler bug re: TRANSFER intrinsic?"
- Reply: James Van Buskirk: "Re: Code or compiler bug re: TRANSFER intrinsic?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|