This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Drop TYPE_NEEDS_CONSTRUCTING checks from ipa-pure-const and tree-inline
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org, rguenther at suse dot de
- Date: Mon, 15 Jun 2015 00:30:00 +0200
- Subject: Drop TYPE_NEEDS_CONSTRUCTING checks from ipa-pure-const and tree-inline
- Authentication-results: sourceware.org; auth=none
Hi,
this patch removes last two remaining uses of TYPE_NEEDS_CONSTRUCTING
in the back-end. I believe those are remainders from the time we did not
gimplify as much as we do now. Alias analysis machinery already skips
checks of TYPE_NEEDS_CONSTRUCTING and thus we need to mark tree correctly
as non-readonly if it is constructed.
Incrementally I would like to remove TYPE_NEEDS_CONSTRUCTING streaming
and clear it in free_lang_data.
Bootstrapped/regtested ppc64le-linux, OK?
Honza
* ipa-pure-const.c (check_decl): Do not check TYPE_NEEDS_CONSTRUCTING.
* tree-inline.c (setup_one_parameter): Likewise.
Index: ipa-pure-const.c
===================================================================
--- ipa-pure-const.c (revision 224463)
+++ ipa-pure-const.c (working copy)
@@ -335,7 +335,7 @@
if (DECL_EXTERNAL (t) || TREE_PUBLIC (t))
{
/* Readonly reads are safe. */
- if (TREE_READONLY (t) && !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (t)))
+ if (TREE_READONLY (t))
return; /* Read of a constant, do not change the function state. */
else
{
Index: tree-inline.c
===================================================================
--- tree-inline.c (revision 224463)
+++ tree-inline.c (working copy)
@@ -3151,18 +3151,6 @@
automatically replaced by the VAR_DECL. */
insert_decl_map (id, p, var);
- /* Even if P was TREE_READONLY, the new VAR should not be.
- In the original code, we would have constructed a
- temporary, and then the function body would have never
- changed the value of P. However, now, we will be
- constructing VAR directly. The constructor body may
- change its value multiple times as it is being
- constructed. Therefore, it must not be TREE_READONLY;
- the back-end assumes that TREE_READONLY variable is
- assigned to only once. */
- if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (p)))
- TREE_READONLY (var) = 0;
-
/* If there is no setup required and we are in SSA, take the easy route
replacing all SSA names representing the function parameter by the
SSA name passed to function.