Commit 559d6055 by Eric Botcazou Committed by Eric Botcazou

bootstrap-lto.mk (BOOT_ADAFLAGS): Delete.

config/
	* bootstrap-lto.mk (BOOT_ADAFLAGS): Delete.
gcc/
	* tree-nested.c (remap_vla_decls): Fully expand value expressions of
	VLA variables.
gcc/ada/
	* gnatvsn.adb (Version_String): Change type to C-like array of chars.
	(Gnat_Version_String): Adjust to above change.

From-SVN: r167201
parent 3dbe9454
2010-11-27 Eric Botcazou <ebotcazou@adacore.com>
* bootstrap-lto.mk (BOOT_ADAFLAGS): Delete.
2010-11-19 Tobias Grosser <grosser@fim.uni-passau.de> 2010-11-19 Tobias Grosser <grosser@fim.uni-passau.de>
* cloog.m4: Use AS_HELP_STRING and fix help formatting. * cloog.m4: Use AS_HELP_STRING and fix help formatting.
......
...@@ -3,6 +3,3 @@ ...@@ -3,6 +3,3 @@
STAGE2_CFLAGS += -flto=jobserver -fuse-linker-plugin -frandom-seed=1 STAGE2_CFLAGS += -flto=jobserver -fuse-linker-plugin -frandom-seed=1
STAGE3_CFLAGS += -flto=jobserver -fuse-linker-plugin -frandom-seed=1 STAGE3_CFLAGS += -flto=jobserver -fuse-linker-plugin -frandom-seed=1
# Ada fails to build with LTO, turn it off for now.
BOOT_ADAFLAGS += -fno-lto
2010-11-27 Eric Botcazou <ebotcazou@adacore.com>
* tree-nested.c (remap_vla_decls): Fully expand value expressions of
VLA variables.
2010-11-27 Richard Guenther <rguenther@suse.de> 2010-11-27 Richard Guenther <rguenther@suse.de>
* gimple.c (gimple_assign_copy_p): Use gimple_assign_single_p. * gimple.c (gimple_assign_copy_p): Use gimple_assign_single_p.
2010-11-27 Eric Botcazou <ebotcazou@adacore.com>
* gnatvsn.adb (Version_String): Change type to C-like array of chars.
(Gnat_Version_String): Adjust to above change.
2010-11-18 Eric Botcazou <ebotcazou@adacore.com> 2010-11-18 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>: Also * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>: Also
......
...@@ -53,9 +53,10 @@ package body Gnatvsn is ...@@ -53,9 +53,10 @@ package body Gnatvsn is
" FOR A PARTICULAR PURPOSE."; " FOR A PARTICULAR PURPOSE.";
end Gnat_Free_Software; end Gnat_Free_Software;
Version_String : String (1 .. Ver_Len_Max); type char_array is array (Natural range <>) of aliased Character;
Version_String : char_array (0 .. Ver_Len_Max - 1);
-- Import the C string defined in the (language-independent) source file -- Import the C string defined in the (language-independent) source file
-- version.c. -- version.c using the zero-based convention of the C language.
-- The size is not the real one, which does not matter since we will -- The size is not the real one, which does not matter since we will
-- check for the nul character in Gnat_Version_String. -- check for the nul character in Gnat_Version_String.
pragma Import (C, Version_String, "version_string"); pragma Import (C, Version_String, "version_string");
...@@ -65,15 +66,17 @@ package body Gnatvsn is ...@@ -65,15 +66,17 @@ package body Gnatvsn is
------------------------- -------------------------
function Gnat_Version_String return String is function Gnat_Version_String return String is
NUL_Pos : Positive := 1; S : String (1 .. Ver_Len_Max);
Pos : Natural := 0;
begin begin
loop loop
exit when Version_String (NUL_Pos) = ASCII.NUL; exit when Version_String (Pos) = ASCII.NUL;
NUL_Pos := NUL_Pos + 1; S (Pos + 1) := Version_String (Pos);
Pos := Pos + 1;
end loop; end loop;
return Version_String (1 .. NUL_Pos - 1); return S (1 .. Pos);
end Gnat_Version_String; end Gnat_Version_String;
end Gnatvsn; end Gnatvsn;
...@@ -2192,18 +2192,21 @@ remap_vla_decls (tree block, struct nesting_info *root) ...@@ -2192,18 +2192,21 @@ remap_vla_decls (tree block, struct nesting_info *root)
remap_vla_decls (subblock, root); remap_vla_decls (subblock, root);
for (var = BLOCK_VARS (block); var; var = DECL_CHAIN (var)) for (var = BLOCK_VARS (block); var; var = DECL_CHAIN (var))
{ if (TREE_CODE (var) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (var))
if (TREE_CODE (var) == VAR_DECL {
&& variably_modified_type_p (TREE_TYPE (var), NULL) val = DECL_VALUE_EXPR (var);
&& DECL_HAS_VALUE_EXPR_P (var)) type = TREE_TYPE (var);
{
type = TREE_TYPE (var); if (!(TREE_CODE (val) == INDIRECT_REF
val = DECL_VALUE_EXPR (var); && TREE_CODE (TREE_OPERAND (val, 0)) == VAR_DECL
if (walk_tree (&type, contains_remapped_vars, root, NULL) != NULL && variably_modified_type_p (type, NULL)))
|| walk_tree (&val, contains_remapped_vars, root, NULL) != NULL) continue;
break;
} if (pointer_map_contains (root->var_map, TREE_OPERAND (val, 0))
} || walk_tree (&type, contains_remapped_vars, root, NULL))
break;
}
if (var == NULL_TREE) if (var == NULL_TREE)
return; return;
...@@ -2213,17 +2216,22 @@ remap_vla_decls (tree block, struct nesting_info *root) ...@@ -2213,17 +2216,22 @@ remap_vla_decls (tree block, struct nesting_info *root)
id.root = root; id.root = root;
for (; var; var = DECL_CHAIN (var)) for (; var; var = DECL_CHAIN (var))
if (TREE_CODE (var) == VAR_DECL if (TREE_CODE (var) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (var))
&& variably_modified_type_p (TREE_TYPE (var), NULL)
&& DECL_HAS_VALUE_EXPR_P (var))
{ {
struct nesting_info *i; struct nesting_info *i;
tree newt, t, context; tree newt, context;
void **slot;
t = type = TREE_TYPE (var);
val = DECL_VALUE_EXPR (var); val = DECL_VALUE_EXPR (var);
if (walk_tree (&type, contains_remapped_vars, root, NULL) == NULL type = TREE_TYPE (var);
&& walk_tree (&val, contains_remapped_vars, root, NULL) == NULL)
if (!(TREE_CODE (val) == INDIRECT_REF
&& TREE_CODE (TREE_OPERAND (val, 0)) == VAR_DECL
&& variably_modified_type_p (type, NULL)))
continue;
slot = pointer_map_contains (root->var_map, TREE_OPERAND (val, 0));
if (!slot && !walk_tree (&type, contains_remapped_vars, root, NULL))
continue; continue;
context = decl_function_context (var); context = decl_function_context (var);
...@@ -2234,6 +2242,15 @@ remap_vla_decls (tree block, struct nesting_info *root) ...@@ -2234,6 +2242,15 @@ remap_vla_decls (tree block, struct nesting_info *root)
if (i == NULL) if (i == NULL)
continue; continue;
/* Fully expand value expressions. This avoids having debug variables
only referenced from them and that can be swept during GC. */
if (slot)
{
tree t = (tree) *slot;
gcc_assert (DECL_P (t) && DECL_HAS_VALUE_EXPR_P (t));
val = build1 (INDIRECT_REF, TREE_TYPE (val), DECL_VALUE_EXPR (t));
}
id.cb.src_fn = i->context; id.cb.src_fn = i->context;
id.cb.dst_fn = i->context; id.cb.dst_fn = i->context;
id.cb.src_cfun = DECL_STRUCT_FUNCTION (root->context); id.cb.src_cfun = DECL_STRUCT_FUNCTION (root->context);
...@@ -2242,13 +2259,13 @@ remap_vla_decls (tree block, struct nesting_info *root) ...@@ -2242,13 +2259,13 @@ remap_vla_decls (tree block, struct nesting_info *root)
while (POINTER_TYPE_P (newt) && !TYPE_NAME (newt)) while (POINTER_TYPE_P (newt) && !TYPE_NAME (newt))
{ {
newt = TREE_TYPE (newt); newt = TREE_TYPE (newt);
t = TREE_TYPE (t); type = TREE_TYPE (type);
} }
if (TYPE_NAME (newt) if (TYPE_NAME (newt)
&& TREE_CODE (TYPE_NAME (newt)) == TYPE_DECL && TREE_CODE (TYPE_NAME (newt)) == TYPE_DECL
&& DECL_ORIGINAL_TYPE (TYPE_NAME (newt)) && DECL_ORIGINAL_TYPE (TYPE_NAME (newt))
&& newt != t && newt != type
&& TYPE_NAME (newt) == TYPE_NAME (t)) && TYPE_NAME (newt) == TYPE_NAME (type))
TYPE_NAME (newt) = remap_decl (TYPE_NAME (newt), &id.cb); TYPE_NAME (newt) = remap_decl (TYPE_NAME (newt), &id.cb);
walk_tree (&val, copy_tree_body_r, &id.cb, NULL); walk_tree (&val, copy_tree_body_r, &id.cb, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment