------- Comment #4 from dick dot hendrickson at gmail dot com 2009-01-19 22:31 ------- Subject: Re: WHERE with multiple elemental defined assignments gives wrong answer
On Mon, Jan 19, 2009 at 4:18 PM, mikael at gcc dot gnu dot org <gcc-bugzi...@gcc.gnu.org> wrote: > > > ------- Comment #3 from mikael at gcc dot gnu dot org 2009-01-19 22:18 > ------- >> > I suspect the following is invalid as the arguments to the defined >> > assignment >> > alias. >> > >> >> Why do you think it is invalid? > Because the arguments to the i_to_t (or l_to_t) alias. They point to the same > data. > I may be wrong however (actually it wouldn't be the first time when arguing > about standard conformance). I'm sure it is wrong with basic subroutines, but > mixing that with where, elemental and defined assignment doesn't make it > clear. Defined assignment is sort of a special case. A statement like A = B is equivalent to CALL DEFINED_ROUTINE ( A, (B) ) The "extra" parenthesis allow something like A = A to work like CALL DEFINED_ROUTINE ( A, (A) ) and it is legal for the first argument to be intent(out) since the first and second arguments are different. See 12.3.2.1.2 in F95 Dick Hendrickson > >> For what it's worth, the test case compiles >> successfully with a different compiler. The larger program compiles with >> several other compilers. > And it compiles with gfortran too ;). > > > -- > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38863 > > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. > -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38863