2012-07-30  Vincent Pucci  <pucci@adacore.com>
	* sem_ch9.adb (Allows_Lock_Free_Implementation): Restrict implicit
	dereferences of access values.
From-SVN: r189975
+2012-07-30  Vincent Pucci  <pucci@adacore.com>
+
+       * sem_ch9.adb (Allows_Lock_Free_Implementation): Restrict implicit
+       dereferences of access values.
+
 2012-07-27  Iain Sandoe  <iain@codesourcery.com>
 
        * system-darwin-ppc64.ads: Add Support_Atomic_Primitives, set to True.
 
 
                         return Abandon;
 
-                     --  Explicit dereferences restricted (i.e. dereferences of
-                     --  access values).
+                     --  Dereferences of access values restricted
 
-                     elsif Kind = N_Explicit_Dereference then
+                     elsif Kind = N_Explicit_Dereference
+                       or else (Kind = N_Selected_Component
+                                 and then Is_Access_Type (Etype (Prefix (N))))
+                     then
                         if Lock_Free_Given then
-                           Error_Msg_N ("explicit dereference not allowed", N);
+                           Error_Msg_N ("dereference of access value " &
+                                        "not allowed", N);
                            return Skip;
                         end if;