r266124 - in /trunk/gcc/ada: ChangeLog exp_attr...

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Wed Nov 14 11:42:00 GMT 2018


Author: pmderodat
Date: Wed Nov 14 11:41:36 2018
New Revision: 266124

URL: https://gcc.gnu.org/viewcvs?rev=266124&root=gcc&view=rev
Log:
[Ada] System'To_Address not always static

System'To_Address is supposed to be static when its parameter is static.
This patch fixes a bug in which it is considered nonstatic when used as
the initial value of a variable with the Thread_Local_Storage aspect, so
the compiler incorrectly gives an error when initializing such a
variable with System'To_Address (0).

2018-11-14  Bob Duff  <duff@adacore.com>

gcc/ada/

	* sem_attr.adb (To_Address): Simplify setting of
	Is_Static_Expression. Remove second (unconditional) call to
	Set_Is_Static_Expression -- surely it's not static if the
	operand is not.  Initialize Static on declaration.  Do not try
	to fold 'To_Address, even though it's static.
	* exp_attr.adb (To_Address): Preserve Is_Static_Expression.
	* sinfo.ads, sem_eval.ads, sem_eval.adb (Is_Static_Expression,
	Is_OK_Static_Expression, Raises_Constraint_Error): Simplify
	documentation.  There was too much repetition and redundancy.

Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/exp_attr.adb
    trunk/gcc/ada/sem_attr.adb
    trunk/gcc/ada/sem_eval.adb
    trunk/gcc/ada/sem_eval.ads
    trunk/gcc/ada/sinfo.ads



More information about the Gcc-cvs mailing list