public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Remove DECL_RESTRICTED_P
@ 2012-11-16 17:19 Eric Botcazou
  2012-11-25 12:48 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Botcazou @ 2012-11-16 17:19 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]

Hi,

that's not really a bugfix, but I don't see the point in keeping this flag, 
which was already dead in 4.7, one more release.

Tested on x86_64-suse-linux, OK for the mainline?


2012-11-16  Eric Botcazou  <ebotcazou@adacore.com>

	* tree.h (DECL_RESTRICTED_P): Delete.
	(DECL_READ_P): Add comment.
	(DECL_NONSHAREABLE): Likewise.
	(struct tree_decl_common): Remove decl_restricted_flag, add decl_flag_3.
	* tree-emutls.c (new_emutls_decl): Do not deal with DECL_RESTRICTED_P.
	* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Likewise.
	* tree-streamer-out.c (pack_ts_decl_common_value_fields): Likewise.
fortran/
	* trans-decl.c (gfc_finish_var_decl): Do not set DECL_RESTRICTED_P.


-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 4497 bytes --]

Index: tree.h
===================================================================
--- tree.h	(revision 193557)
+++ tree.h	(working copy)
@@ -1324,18 +1324,13 @@ extern void omp_clause_range_check_faile
   (TREE_CHECK3 (NODE, VAR_DECL, PARM_DECL, \
 		RESULT_DECL)->decl_common.decl_by_reference_flag)
 
-/* In a RESULT_DECL, PARM_DECL and VAR_DECL, means that this decl
-   can be used as restricted tag to disambiguate against other restrict
-   pointers.  Used by fortran to capture something like non-addressability
-   (which it isn't really because the middle-end does take addresses of
-   such variables).  */
-#define DECL_RESTRICTED_P(NODE) \
-  (TREE_CHECK3 (NODE, VAR_DECL, PARM_DECL, \
-		RESULT_DECL)->decl_common.decl_restricted_flag)
-
+/* In VAR_DECL and PARM_DECL, set when the decl has been used except for
+   being set.  */
 #define DECL_READ_P(NODE) \
   (TREE_CHECK2 (NODE, VAR_DECL, PARM_DECL)->decl_common.decl_read_flag)
 
+/* In VAR_DECL or RESULT_DECL, set when significant code movement precludes
+   attempting to share the stack slot with some other variable.  */
 #define DECL_NONSHAREABLE(NODE) \
   (TREE_CHECK2 (NODE, VAR_DECL, \
 		RESULT_DECL)->decl_common.decl_nonshareable_flag)
@@ -2854,26 +2849,22 @@ struct GTY(()) tree_decl_common {
      In VAR_DECL, PARM_DECL and RESULT_DECL, this is
      DECL_HAS_VALUE_EXPR_P.  */
   unsigned decl_flag_2 : 1;
+  /* 1 bit unused.  */
+  unsigned decl_flag_3 : 1;
   /* Logically, these two would go in a theoretical base shared by var and
      parm decl. */
   unsigned gimple_reg_flag : 1;
   /* In VAR_DECL, PARM_DECL and RESULT_DECL, this is DECL_BY_REFERENCE.  */
   unsigned decl_by_reference_flag : 1;
-  /* In VAR_DECL, PARM_DECL and RESULT_DECL, this is DECL_RESTRICTED_P.  */
-  unsigned decl_restricted_flag : 1;
-
-  /* In VAR_DECL and PARM_DECL set when the decl has been used except for
-     being set.  */
+  /* In a VAR_DECL and PARM_DECL, this is DECL_READ_P.  */
   unsigned decl_read_flag : 1;
-
-  /* In VAR_DECL or RESULT_DECL set when significant code movement precludes
-     attempting to share the stack slot with some other variable.  */
+  /* In a VAR_DECL or RESULT_DECL, this is DECL_NONSHAREABLE.  */
   unsigned decl_nonshareable_flag : 1;
 
   /* DECL_OFFSET_ALIGN, used only for FIELD_DECLs.  */
   unsigned int off_align : 8;
 
-  /* 24-bits unused.  */
+  /* 24 bits unused.  */
 
   /* DECL_ALIGN.  It should have the same size as TYPE_ALIGN.  */
   unsigned int align;
Index: tree-emutls.c
===================================================================
--- tree-emutls.c	(revision 193557)
+++ tree-emutls.c	(working copy)
@@ -295,7 +295,6 @@ new_emutls_decl (tree decl, tree alias_o
   DECL_WEAK (to) = DECL_WEAK (decl);
   DECL_VISIBILITY (to) = DECL_VISIBILITY (decl);
   DECL_VISIBILITY_SPECIFIED (to) = DECL_VISIBILITY_SPECIFIED (decl);
-  DECL_RESTRICTED_P (to) = DECL_RESTRICTED_P (decl);
   DECL_DLLIMPORT_P (to) = DECL_DLLIMPORT_P (decl);
 
   DECL_ATTRIBUTES (to) = targetm.merge_decl_attributes (decl, to);
Index: fortran/trans-decl.c
===================================================================
--- fortran/trans-decl.c	(revision 193557)
+++ fortran/trans-decl.c	(working copy)
@@ -611,12 +611,6 @@ gfc_finish_var_decl (tree decl, gfc_symb
   if (sym->attr.threadprivate
       && (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
     DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
-
-  if (!sym->attr.target
-      && !sym->attr.pointer
-      && !sym->attr.cray_pointee
-      && !sym->attr.proc_pointer)
-    DECL_RESTRICTED_P (decl) = 1;
 }
 
 
Index: tree-streamer-out.c
===================================================================
--- tree-streamer-out.c	(revision 193557)
+++ tree-streamer-out.c	(working copy)
@@ -202,7 +202,6 @@ pack_ts_decl_common_value_fields (struct
       if (TREE_CODE (expr) == VAR_DECL
 	  || TREE_CODE (expr) == PARM_DECL)
 	bp_pack_value (bp, DECL_HAS_VALUE_EXPR_P (expr), 1);
-      bp_pack_value (bp, DECL_RESTRICTED_P (expr), 1);
     }
 }
 
Index: tree-streamer-in.c
===================================================================
--- tree-streamer-in.c	(revision 193557)
+++ tree-streamer-in.c	(working copy)
@@ -236,7 +236,6 @@ unpack_ts_decl_common_value_fields (stru
       if (TREE_CODE (expr) == VAR_DECL
 	  || TREE_CODE (expr) == PARM_DECL)
 	DECL_HAS_VALUE_EXPR_P (expr) = (unsigned) bp_unpack_value (bp, 1);
-      DECL_RESTRICTED_P (expr) = (unsigned) bp_unpack_value (bp, 1);
     }
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Remove DECL_RESTRICTED_P
  2012-11-16 17:19 [patch] Remove DECL_RESTRICTED_P Eric Botcazou
@ 2012-11-25 12:48 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2012-11-25 12:48 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc-patches

On Fri, Nov 16, 2012 at 6:15 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> that's not really a bugfix, but I don't see the point in keeping this flag,
> which was already dead in 4.7, one more release.
>
> Tested on x86_64-suse-linux, OK for the mainline?

Ok.

Thanks,
Richard.

>
> 2012-11-16  Eric Botcazou  <ebotcazou@adacore.com>
>
>         * tree.h (DECL_RESTRICTED_P): Delete.
>         (DECL_READ_P): Add comment.
>         (DECL_NONSHAREABLE): Likewise.
>         (struct tree_decl_common): Remove decl_restricted_flag, add decl_flag_3.
>         * tree-emutls.c (new_emutls_decl): Do not deal with DECL_RESTRICTED_P.
>         * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Likewise.
>         * tree-streamer-out.c (pack_ts_decl_common_value_fields): Likewise.
> fortran/
>         * trans-decl.c (gfc_finish_var_decl): Do not set DECL_RESTRICTED_P.
>
>
> --
> Eric Botcazou

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-25 12:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-16 17:19 [patch] Remove DECL_RESTRICTED_P Eric Botcazou
2012-11-25 12:48 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).