This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: PR33749 - Wrong evaluation of expressions in lhs of assignment statements


Dear All,

> This bug only appears in -m32 or, rather, it disappears in -m64.  What
> is odd is that an entire block of code produced by the scalarizer
> appears and disappears according to the mode.  What is even odder is
> that I cannot even figure out how the correct code is ever produced.
>
> This:
>
>   integer(4) :: p(4) = (/2,4,1,3/)
>   p(p) = (/(i, i = 1, 4)/)
>   print *, p
> end

The problem is that the expression for the index in p(p) gets
correctly identified as a variable in -m32 but becomes a function in
-m64.  The latter causes  need_tmp to be set, which than "corrects"
this problem.

I have a patch for PR33749 but will have to fix the above first,
otherwise it will lurk undetected and get us in other ways.  I wonder
how often unnecessary temporaries are created in -m64?

Cheers

Paul


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