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: [fortran, patch] Fix conflict detesction for VOLATILE attribute (PR30520)


Jerry DeLisle wrote:
See wording here:

Tobias Burnus wrote:

!   /* TODO: The following allows multiple VOLATILE statements for
!      use-associated variables and it prevents setting VOLATILE for a host-
!      associated variable which is already marked as VOLATILE in the host.  */

I did not go back and look at the rest of the thread to see if you fixed this already.

So far as I know, no. Tobias and I talked about this on IRC when he was creating the patch, and it's going to be particularly tricky to solve. The problem is that, currently, gfortran assumes that if a given attribute is set on a variable then setting it again is an error. However, this is sometimes true and sometimes not true with VOLATILE, and thus fixing this TODO will require adding machinery for tracking where the attribute was set.


The current patch was a compromise that uses some reasonable guesses to allow the most common sorts of multiple declarations of VOLATILE, while rejecting what I would guess to be the most common forms of incorrect code. The TODO comment documents where those guesses fall short. I think it's a reasonable patch to put into place while waiting for a complete solution.

- Brooks


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