Commit 7fa6a965 by Prathamesh Kulkarni Committed by Prathamesh Kulkarni

tree.c (build_common_tree_nodes): Initialize ptrdiff_type_node.

2016-11-26  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	* tree.c (build_common_tree_nodes): Initialize ptrdiff_type_node.
	(free_lang_data): Remove assignment to ptrdiff_type_node.
c-family/
	* c-common.c (c_common_nodes_and_builtins): Remove initialization of
	ptrdiff_type_node.
lto/
	* lto-lang.c (lto_init): Remove initialization of ptrdiff_type_node.

From-SVN: r242888
parent 55ab8dbf
2016-11-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* tree.c (build_common_tree_nodes): Initialize ptrdiff_type_node.
(free_lang_data): Remove assignment to ptrdiff_type_node.
2016-11-25 Jakub Jelinek <jakub@redhat.com> 2016-11-25 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/78526 PR rtl-optimization/78526
2016-11-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* c-common.c (c_common_nodes_and_builtins): Remove initialization of
ptrdiff_type_node;
2016-11-23 James Greenhalgh <james.greenhalgh@arm.com> 2016-11-23 James Greenhalgh <james.greenhalgh@arm.com>
* c-common.c (excess_precision_mode_join): New. * c-common.c (excess_precision_mode_join): New.
......
...@@ -4475,8 +4475,6 @@ c_common_nodes_and_builtins (void) ...@@ -4475,8 +4475,6 @@ c_common_nodes_and_builtins (void)
default_function_type default_function_type
= build_varargs_function_type_list (integer_type_node, NULL_TREE); = build_varargs_function_type_list (integer_type_node, NULL_TREE);
ptrdiff_type_node
= TREE_TYPE (identifier_global_value (get_identifier (PTRDIFF_TYPE)));
unsigned_ptrdiff_type_node = c_common_unsigned_type (ptrdiff_type_node); unsigned_ptrdiff_type_node = c_common_unsigned_type (ptrdiff_type_node);
lang_hooks.decls.pushdecl lang_hooks.decls.pushdecl
......
2016-11-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* lto-lang.c (lto_init): Remove initialization of ptrdiff_type_node.
2016-11-23 Richard Biener <rguenther@suse.de> 2016-11-23 Richard Biener <rguenther@suse.de>
PR lto/78472 PR lto/78472
......
...@@ -1271,8 +1271,6 @@ lto_init (void) ...@@ -1271,8 +1271,6 @@ lto_init (void)
gcc_assert (TYPE_MAIN_VARIANT (const_tm_ptr_type_node) gcc_assert (TYPE_MAIN_VARIANT (const_tm_ptr_type_node)
== const_ptr_type_node); == const_ptr_type_node);
ptrdiff_type_node = integer_type_node;
lto_build_c_type_nodes (); lto_build_c_type_nodes ();
gcc_assert (va_list_type_node); gcc_assert (va_list_type_node);
......
...@@ -6006,7 +6006,6 @@ free_lang_data (void) ...@@ -6006,7 +6006,6 @@ free_lang_data (void)
free_lang_data_in_cgraph (); free_lang_data_in_cgraph ();
/* Create gimple variants for common types. */ /* Create gimple variants for common types. */
ptrdiff_type_node = integer_type_node;
fileptr_type_node = ptr_type_node; fileptr_type_node = ptr_type_node;
const_tm_ptr_type_node = const_ptr_type_node; const_tm_ptr_type_node = const_ptr_type_node;
...@@ -10314,6 +10313,30 @@ build_common_tree_nodes (bool signed_char) ...@@ -10314,6 +10313,30 @@ build_common_tree_nodes (bool signed_char)
gcc_unreachable (); gcc_unreachable ();
} }
/* Define what type to use for ptrdiff_t. */
if (strcmp (PTRDIFF_TYPE, "int") == 0)
ptrdiff_type_node = integer_type_node;
else if (strcmp (PTRDIFF_TYPE, "long int") == 0)
ptrdiff_type_node = long_integer_type_node;
else if (strcmp (PTRDIFF_TYPE, "long long int") == 0)
ptrdiff_type_node = long_long_integer_type_node;
else if (strcmp (PTRDIFF_TYPE, "short int") == 0)
ptrdiff_type_node = short_integer_type_node;
else
{
ptrdiff_type_node = NULL_TREE;
for (int i = 0; i < NUM_INT_N_ENTS; i++)
if (int_n_enabled_p[i])
{
char name[50];
sprintf (name, "__int%d", int_n_data[i].bitsize);
if (strcmp (name, PTRDIFF_TYPE) == 0)
ptrdiff_type_node = int_n_trees[i].signed_type;
}
if (ptrdiff_type_node == NULL_TREE)
gcc_unreachable ();
}
/* Fill in the rest of the sized types. Reuse existing type nodes /* Fill in the rest of the sized types. Reuse existing type nodes
when possible. */ when possible. */
intQI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (QImode), 0); intQI_type_node = make_or_reuse_type (GET_MODE_BITSIZE (QImode), 0);
......
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