This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug ada/37602] New: Renaming of volatile causes variable access


The following procedure generates an access to A because of its renaming as B,
even though no explicit access is made to A or B. I think this violates the
second sentence of C.6(20).

with Interfaces;              use Interfaces;
with System.Storage_Elements; use System.Storage_Elements;

procedure T is

   A : Unsigned_8;
   for A'Address use To_Address (1000);
   pragma Volatile (A);

   B : Unsigned_8 renames A;

begin
   null;
end T;

The generated assembler code (-O3 -fomit-frame-pointer) for this procedure is:

_ada_t:
        subl    $12, %esp
        movzbl  1000, %eax
        addl    $12, %esp
        ret


-- 
           Summary: Renaming of volatile causes variable access
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sam at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37602


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