[all-commits] [llvm/llvm-project] d21534: [flang][volatile] Get volatility of designators fr...

Andre Kuhlenschmidt via All-commits all-commits at lists.llvm.org
Fri May 9 17:21:18 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d21534f482f21356531f25671b18ae385e04c296
      https://github.com/llvm/llvm-project/commit/d21534f482f21356531f25671b18ae385e04c296
  Author: Andre Kuhlenschmidt <andre.kuhlenschmidt at gmail.com>
  Date:   2025-05-09 (Fri, 09 May 2025)

  Changed paths:
    M flang/lib/Semantics/pointer-assignment.cpp
    M flang/test/Semantics/assign02.f90

  Log Message:
  -----------
  [flang][volatile] Get volatility of designators from base instead of component symbol (#138611)

The standard says in [8.5.20 VOLATILE attribute]:
If an object has the VOLATILE attribute, then all of its sub-objects
also have the VOLATILE attribute.

This code takes this into account and uses the volatility of the base of
the designator instead of that of the component. In fact, fields in a
structure are not allowed to have the volatile attribute. So given the
code, `A%B => t`, symbol `B` could never directly have the volatile
attribute, and the volatility of `A` indicates the volatility of `B`.


This PR should address [the
comments](https://github.com/llvm/llvm-project/pull/132486#issuecomment-2851313119)
on this PR #132486



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list