------- Comment #10 from mikael at gcc dot gnu dot org 2009-09-11 19:39 ------- (In reply to comment #5) > Can you define what you mean by works? The following change in the provided testcase (fixed form):
--- pr41335.f.old 2009-09-11 23:12:01.000000000 +0200 +++ pr41335.f 2009-09-11 22:32:07.000000000 +0200 @@ -1,6 +1,6 @@ PROGRAM VolatileTest double precision :: uA, uB - volatile double precision a + double precision, volatile :: a double precision :: b double precision :: c produces the following difference in the code generated: --- pr41335.f.003t.original.old 2009-09-11 22:36:44.000000000 +0200 +++ pr41335.f.003t.original 2009-09-11 22:38:02.000000000 +0200 @@ -1,6 +1,6 @@ volatiletest () { - real(kind=4) a; + volatile real(kind=8) a; real(kind=8) b; real(kind=8) c; real(kind=8) ua; @@ -20,9 +20,9 @@ _gfortran_transfer_real (&dt_parm.1, &ub, 8); _gfortran_st_read_done (&dt_parm.1); } - a = (real(kind=4)) (ua * ua); + a = (volatile real(kind=8)) (ua * ua); b = ub * ub; - c = (real(kind=8)) a - b; + c = a - b; { struct __st_parameter_dt dt_parm.2; that is : variable a loses its volatile and double precision attribute In fact, a is implicitly typed ; Adding implicit none, I get : pr41335_test.f:11.9: a = uA*uA 1 Error: Symbol 'a' at (1) has no IMPLICIT type pr41335_test.f:4.35: volatile double precision a 1 Error: Symbol 'doubleprecisiona' at (1) has no IMPLICIT type But I think plain volatile double precision is invalid (f2008) : type-declaration-stmt is declaration-type-spec [ [ , attr-spec ] ... :: ] entity-decl -list Only the comma/double-colon version should be allowed confirmed as diagnostic bug, though I'm wondering if this shouldn't be simply closed as invalid. By the way, ALWAYS USE IMPLICIT NONE! -- mikael at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords| |diagnostic Last reconfirmed|0000-00-00 00:00:00 |2009-09-11 19:39:11 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41335