public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch 3/4] Finally remove tm.,h and options.h as dependencies on tree-core.h and tree.h
@ 2015-06-25 13:24 Andrew MacLeod
  2015-06-25 16:22 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew MacLeod @ 2015-06-25 13:24 UTC (permalink / raw)
  To: gcc-patches

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

This patch turns the cl_optimization structure from an OPTIMIZATION_NODE 
into a pointer inmstead of an actual instance. This is analgous to what 
I did in a previously checked in  patch for target optimizations 
(https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01152.html), I just 
missed this one  then.  This time it really does remove the dependency 
of tree-core.h on optons.h and thus tm.h.

These nodes are not used very much, so I don't expect any performance or 
memory issues.

Bootstraps on x86_64-unknown-linux-gnu with no new regressions. Also 
builds stage 1 on all the targets in config-list.mk.

OK for trunk?

Andrew


[-- Attachment #2: 3-tree-tm.patch --]
[-- Type: text/x-patch, Size: 3057 bytes --]


	* tree-core.h (struct tree_optimization_option): Make opts a pointer to
	struct cl_optimization.
	* tree.h (TREE_OPTIMIZATION): Return the pointer, not the address of it.
	* tree.c (make_node_stat): Allocate cl_optimization struct.
	(copy_node_stat): Allocate and copy cl_optimization struct.

Index: tree-core.h
===================================================================
*** tree-core.h	(revision 224602)
--- tree-core.h	(working copy)
*************** struct GTY(()) tree_optimization_option
*** 1652,1658 ****
    struct tree_common common;
  
    /* The optimization options used by the user.  */
!   struct cl_optimization opts;
  
    /* Target optabs for this set of optimization options.  This is of
       type `struct target_optabs *'.  */
--- 1652,1658 ----
    struct tree_common common;
  
    /* The optimization options used by the user.  */
!   struct cl_optimization *opts;
  
    /* Target optabs for this set of optimization options.  This is of
       type `struct target_optabs *'.  */
Index: tree.h
===================================================================
*** tree.h	(revision 224602)
--- tree.h	(working copy)
*************** extern vec<tree, va_gc> **decl_debug_arg
*** 2827,2833 ****
    (STATEMENT_LIST_CHECK (NODE)->stmt_list.tail)
  
  #define TREE_OPTIMIZATION(NODE) \
!   (&OPTIMIZATION_NODE_CHECK (NODE)->optimization.opts)
  
  #define TREE_OPTIMIZATION_OPTABS(NODE) \
    (OPTIMIZATION_NODE_CHECK (NODE)->optimization.optabs)
--- 2827,2833 ----
    (STATEMENT_LIST_CHECK (NODE)->stmt_list.tail)
  
  #define TREE_OPTIMIZATION(NODE) \
!   (OPTIMIZATION_NODE_CHECK (NODE)->optimization.opts)
  
  #define TREE_OPTIMIZATION_OPTABS(NODE) \
    (OPTIMIZATION_NODE_CHECK (NODE)->optimization.optabs)
Index: tree.c
===================================================================
*** tree.c	(revision 224602)
--- tree.c	(working copy)
*************** along with GCC; see the file COPYING3.
*************** make_node_stat (enum tree_code code MEM_
*** 1095,1103 ****
        break;
  
      case tcc_exceptional:
!       if (code == TARGET_OPTION_NODE)
! 	{
! 	  TREE_TARGET_OPTION(t) = ggc_cleared_alloc<struct cl_target_option> ();
  	}
        break;
  
--- 1094,1113 ----
        break;
  
      case tcc_exceptional:
!       switch (code)
!         {
! 	case TARGET_OPTION_NODE:
! 	  TREE_TARGET_OPTION(t)
! 			    = ggc_cleared_alloc<struct cl_target_option> ();
! 	  break;
! 
! 	case OPTIMIZATION_NODE:
! 	  TREE_OPTIMIZATION (t)
! 			    = ggc_cleared_alloc<struct cl_optimization> ();
! 	  break;
! 
! 	default:
! 	  break;
  	}
        break;
  
*************** copy_node_stat (tree node MEM_STAT_DECL)
*** 1188,1193 ****
--- 1198,1209 ----
  	memcpy (TREE_TARGET_OPTION (t), TREE_TARGET_OPTION (node),
  		sizeof (struct cl_target_option));
        }
+     else if (code == OPTIMIZATION_NODE)
+       {
+ 	TREE_OPTIMIZATION (t) = ggc_alloc<struct cl_optimization>();
+ 	memcpy (TREE_OPTIMIZATION (t), TREE_OPTIMIZATION (node),
+ 		sizeof (struct cl_optimization));
+       }
  
    return t;
  }

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

* Re: [patch 3/4] Finally remove tm.,h and options.h as dependencies on tree-core.h and tree.h
  2015-06-25 13:24 [patch 3/4] Finally remove tm.,h and options.h as dependencies on tree-core.h and tree.h Andrew MacLeod
@ 2015-06-25 16:22 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2015-06-25 16:22 UTC (permalink / raw)
  To: Andrew MacLeod, gcc-patches

On 06/25/2015 07:23 AM, Andrew MacLeod wrote:
> This patch turns the cl_optimization structure from an OPTIMIZATION_NODE
> into a pointer inmstead of an actual instance. This is analgous to what
> I did in a previously checked in  patch for target optimizations
> (https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01152.html), I just
> missed this one  then.  This time it really does remove the dependency
> of tree-core.h on optons.h and thus tm.h.
>
> These nodes are not used very much, so I don't expect any performance or
> memory issues.
>
> Bootstraps on x86_64-unknown-linux-gnu with no new regressions. Also
> builds stage 1 on all the targets in config-list.mk.
>
> OK for trunk?
>
> Andrew
>
>
> 3-tree-tm.patch
>
>
> 	* tree-core.h (struct tree_optimization_option): Make opts a pointer to
> 	struct cl_optimization.
> 	* tree.h (TREE_OPTIMIZATION): Return the pointer, not the address of it.
> 	* tree.c (make_node_stat): Allocate cl_optimization struct.
> 	(copy_node_stat): Allocate and copy cl_optimization struct.
OK.
jeff

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

end of thread, other threads:[~2015-06-25 16:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-25 13:24 [patch 3/4] Finally remove tm.,h and options.h as dependencies on tree-core.h and tree.h Andrew MacLeod
2015-06-25 16:22 ` Jeff Law

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).