[PATCH, gfortran] PR18878

Paul Thomas paulthomas2@wanadoo.fr
Tue Sep 6 19:41:00 GMT 2005


This problem is best described by the testcase that is proposed to test 
the patch;

==============module_double_reuse.f90=================
! { dg-do run }
!
! Test of fix for PR18878
!
! Based on example in PR by Steve Kargl
!
module a
  integer, parameter :: b = kind(1.d0)
  real(b)            :: z
end module a
program d
  use a, only : e => b, f => b, u => z, v => z
  real(e) x
  real(f) y
  x = 1.e0_e
  y = 1.e0_f
  u = 99.0
  if (kind(x).ne.kind(y)) call abort ()
  if (v.ne.u) call abort ()
end program d
=======================================================

As things stand, gfortran only does one pass for each real name in the 
USE statement. Thus, in the above, the second renaming of b and of z get 
lost.  A fix is to insert another USE a with the missing renames.  This 
patch works by counting the number of instances of each real name and 
ensuring that they are all loaded.

Bublestrapped and regtested on Athlon/FC3.

OK for mainline and 4.0?

Best regards

Paul T


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sb.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050906/bf590922/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sb.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050906/bf590922/attachment.ksh>


More information about the Gcc-patches mailing list