OSDN Git Service

* sem_prag.adb: (Analyze_Pragma, case External): If entity is a
authorbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Oct 2001 00:19:12 +0000 (00:19 +0000)
committerbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Oct 2001 00:19:12 +0000 (00:19 +0000)
constant, do not indicate possible modification, so that gigi can
treat it as a bona fide constant.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46168 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/sem_prag.adb

index 4c595c7..529a6a3 100644 (file)
@@ -1,3 +1,9 @@
+2001-10-10  Ed Schonberg <schonber@gnat.com>
+
+       * sem_prag.adb: (Analyze_Pragma, case External): If entity is a 
+       constant, do not indicate possible modification, so that gigi can 
+       treat it as a bona fide constant.
+
 2001-10-10  Robert Dewar <dewar@gnat.com>
 
        * sem_prag.adb: Add processing for pragma External.
index 73a4b08..3c547c8 100644 (file)
@@ -5021,7 +5021,11 @@ package body Sem_Prag is
             Check_At_Least_N_Arguments (2);
             Check_At_Most_N_Arguments  (4);
             Process_Convention (C, Def_Id);
-            Note_Possible_Modification (Expression (Arg2));
+
+            if Ekind (Def_Id) /= E_Constant then
+               Note_Possible_Modification (Expression (Arg2));
+            end if;
+
             Process_Interface_Name (Def_Id, Arg3, Arg4);
             Set_Exported (Def_Id, Arg2);
          end Export;