[Ada] Fix volatile flag setting in gigi

Eric Botcazou ebotcazou@adacore.com
Mon Nov 30 11:59:00 GMT 2015

This fixes the volatile flag issue recently reported by Jan.

Tested on x86_64-suse-linux, applied on the mainline.

2015-11-30  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/gigi.h (create_var_decl): Adjust prototype.
	(create_subprog_decl): Likewise.
	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Rename
	static_p into static_flag and add volatile_flag local variable.
	Do not locally change the type of a volatile object, except for the
	pointed-to type if the object is handled by reference.  Adjust calls
	to create_var_decl.
	<E_Subprogram_Type>: Likewise for const and noreturn subprograms.
	(get_minimal_subprog_decl): Adjust call to create_subprog_decl.
	(elaborate_expression_1): Adjust call to create_var_decl.
	(gnat_to_gnu_field): Minor tweak.
	* gcc-interface/trans.c (gigi): Adjust calls to create_var_decl and
	(build_raise_check): Likewise.
	(Subprogram_Body_to_gnu): Likewise.
	(create_temporary): Likewise.
	(Handled_Sequence_Of_Statements_to_gnu): Likewise.
	(Exception_Handler_to_gnu_gcc): Likewise.
	(Compilation_Unit_to_gnu): Likewise.
	(gnat_to_gnu): Likewise.
	* gcc-interface/utils.c (maybe_pad_type): Likewise.
	(create_var_decl): Add VOLATILE_FLAG parameter and handle it.
	(create_subprog_decl): Add CONST_FLAG and VOLATILE_FLAG parameters and
	handle them.

Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 33929 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151130/abc40f9c/attachment.bin>

More information about the Gcc-patches mailing list