Re: Are f.p. manipulation functions only used in initialization?
- From: "James Van Buskirk" <not_valid@xxxxxxxxxxx>
- Date: Sun, 27 Apr 2008 03:32:59 -0600
"Tobias Burnus" <burnus@xxxxxxxx> wrote in message
news:24b0ceab-d3e9-4b68-b578-e4b09d7f893b@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Confirmed. The problem is that in the function "point" a temporary
array is created to contain the repacked data of the dummy argument
"x". Thus, the pointer points to the temporary array and not to the
dummy array.
Solution: Do not repack dummy arguments with the TARGET attribute. I
filled now http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36059
I think that both the actual argument and the dummy argument must
have the target attribute for a problem to arise. If the actual
argument doesn't have the target attribute any pointers that think
they are associated with it have in fact undefined association
status, and same for the dummy. Since the interface must be explicit
if the dummy argument has the target attribute (N1601.pdf, section
12.3.1.1 (2)(a)) the compiler knows when it is deciding whether to
repack the array (i.e. when compiling the caller) whether or not
both actual and dummy arguments have the target attribute.
Another possibility would be to tolerate the nonstandard behavior
but call attention to the possibility in the documentation. There
are examples of compilers that do this. Actually gfortran is more
benign in this regard because the nonstandard switch is not the
default.
Thanks for the bug report. (Maybe I should re-read at some point the
gfortran documentation, there are options I have never heard of.)
Thank you for your attention to this notification. Keep up the
good (volunteer) work.
--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end
.
- References:
- Are f.p. manipulation functions only used in initialization?
- From: James Van Buskirk
- Re: Are f.p. manipulation functions only used in initialization?
- From: Steven G. Kargl
- Re: Are f.p. manipulation functions only used in initialization?
- From: James Van Buskirk
- Re: Are f.p. manipulation functions only used in initialization?
- From: James Van Buskirk
- Re: Are f.p. manipulation functions only used in initialization?
- From: Tobias Burnus
- Are f.p. manipulation functions only used in initialization?
- Prev by Date: Re: Are f.p. manipulation functions only used in initialization?
- Next by Date: Programming Discussion Forum
- Previous by thread: Re: Are f.p. manipulation functions only used in initialization?
- Next by thread: Re: Are f.p. manipulation functions only used in initialization?
- Index(es):
Relevant Pages
|