mirror of git://gcc.gnu.org/git/gcc.git
fe.h (Constant_Value): Declare.
* fe.h (Constant_Value): Declare. * gcc-interface/decl.c (compile_time_known_address_p): Also consider references to constants. From-SVN: r240977
This commit is contained in:
parent
87e25aac8e
commit
abb3ea16fa
|
|
@ -1,3 +1,9 @@
|
||||||
|
2016-10-11 Tristan Gingold <gingold@adacore.com>
|
||||||
|
|
||||||
|
* fe.h (Constant_Value): Declare.
|
||||||
|
* gcc-interface/decl.c (compile_time_known_address_p): Also consider
|
||||||
|
references to constants.
|
||||||
|
|
||||||
2016-10-11 Eric Botcazou <ebotcazou@adacore.com>
|
2016-10-11 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
* gcc-interface/trans.c (gnat_to_gnu) <N_Op_Add>: Adjust comment.
|
* gcc-interface/trans.c (gnat_to_gnu) <N_Op_Add>: Adjust comment.
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
* *
|
* *
|
||||||
* C Header File *
|
* C Header File *
|
||||||
* *
|
* *
|
||||||
* Copyright (C) 1992-2015, Free Software Foundation, Inc. *
|
* Copyright (C) 1992-2016, Free Software Foundation, Inc. *
|
||||||
* *
|
* *
|
||||||
* GNAT is free software; you can redistribute it and/or modify it under *
|
* GNAT is free software; you can redistribute it and/or modify it under *
|
||||||
* terms of the GNU General Public License as published by the Free Soft- *
|
* terms of the GNU General Public License as published by the Free Soft- *
|
||||||
|
|
@ -226,6 +226,7 @@ extern Boolean Is_Others_Aggregate (Node_Id);
|
||||||
/* sem_aux: */
|
/* sem_aux: */
|
||||||
|
|
||||||
#define Ancestor_Subtype sem_aux__ancestor_subtype
|
#define Ancestor_Subtype sem_aux__ancestor_subtype
|
||||||
|
#define Constant_Value sem_aux__constant_value
|
||||||
#define First_Discriminant sem_aux__first_discriminant
|
#define First_Discriminant sem_aux__first_discriminant
|
||||||
#define First_Stored_Discriminant sem_aux__first_stored_discriminant
|
#define First_Stored_Discriminant sem_aux__first_stored_discriminant
|
||||||
#define First_Subtype sem_aux__first_subtype
|
#define First_Subtype sem_aux__first_subtype
|
||||||
|
|
@ -233,6 +234,7 @@ extern Boolean Is_Others_Aggregate (Node_Id);
|
||||||
#define Is_Derived_Type sem_aux__is_derived_type
|
#define Is_Derived_Type sem_aux__is_derived_type
|
||||||
|
|
||||||
extern Entity_Id Ancestor_Subtype (Entity_Id);
|
extern Entity_Id Ancestor_Subtype (Entity_Id);
|
||||||
|
extern Node_Id Constant_Value (Entity_Id);
|
||||||
extern Entity_Id First_Discriminant (Entity_Id);
|
extern Entity_Id First_Discriminant (Entity_Id);
|
||||||
extern Entity_Id First_Stored_Discriminant (Entity_Id);
|
extern Entity_Id First_Stored_Discriminant (Entity_Id);
|
||||||
extern Entity_Id First_Subtype (Entity_Id);
|
extern Entity_Id First_Subtype (Entity_Id);
|
||||||
|
|
|
||||||
|
|
@ -6333,6 +6333,15 @@ array_type_has_nonaliased_component (tree gnu_type, Entity_Id gnat_type)
|
||||||
static bool
|
static bool
|
||||||
compile_time_known_address_p (Node_Id gnat_address)
|
compile_time_known_address_p (Node_Id gnat_address)
|
||||||
{
|
{
|
||||||
|
/* Handle reference to a constant. */
|
||||||
|
if (Is_Entity_Name (gnat_address)
|
||||||
|
&& Ekind (Entity (gnat_address)) == E_Constant)
|
||||||
|
{
|
||||||
|
gnat_address = Constant_Value (Entity (gnat_address));
|
||||||
|
if (No (gnat_address))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/* Catch System'To_Address. */
|
/* Catch System'To_Address. */
|
||||||
if (Nkind (gnat_address) == N_Unchecked_Type_Conversion)
|
if (Nkind (gnat_address) == N_Unchecked_Type_Conversion)
|
||||||
gnat_address = Expression (gnat_address);
|
gnat_address = Expression (gnat_address);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue