public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/4] Replace ENABLE_CHECKING macro with flag_checking in HSA
  2016-02-25 15:35 [PATCH 0/4] Replace remaining ENABLE_CHECKING macros marxin
  2016-02-25 15:35 ` [PATCH 4/4] Poison ENABLE_CHECKING macro marxin
  2016-02-25 15:35 ` [PATCH 3/4] Replace ENABLE_CHECKING with CHECKING_P in dwarf2out marxin
@ 2016-02-25 15:35 ` marxin
  2016-02-25 17:18   ` Martin Jambor
  2016-02-25 15:35 ` [PATCH 2/4] Replace ENABLE_CHECKING macro with flag_checking in GNAT marxin
  3 siblings, 1 reply; 9+ messages in thread
From: marxin @ 2016-02-25 15:35 UTC (permalink / raw)
  To: gcc-patches

gcc/ChangeLog:

2016-02-24  Martin Liska  <mliska@suse.cz>

	* hsa-gen.c (generate_hsa): Replace ENABLE_CHECKING macro
	with flag_checking.
	* hsa-regalloc.c (linear_scan_regalloc): Likewise.
---
 gcc/hsa-gen.c      | 25 +++++++++++++------------
 gcc/hsa-regalloc.c |  7 +++----
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c
index 28e8b6f..8e2144c 100644
--- a/gcc/hsa-gen.c
+++ b/gcc/hsa-gen.c
@@ -6091,21 +6091,22 @@ generate_hsa (bool kernel)
 				 s->m_gridified_kernel_p);
     }
 
-#ifdef ENABLE_CHECKING
-  for (unsigned i = 0; i < hsa_cfun->m_ssa_map.length (); i++)
-    if (hsa_cfun->m_ssa_map[i])
-      hsa_cfun->m_ssa_map[i]->verify_ssa ();
-
-  basic_block bb;
-  FOR_EACH_BB_FN (bb, cfun)
+  if (flag_checking)
     {
-      hsa_bb *hbb = hsa_bb_for_bb (bb);
+      for (unsigned i = 0; i < hsa_cfun->m_ssa_map.length (); i++)
+	if (hsa_cfun->m_ssa_map[i])
+	  hsa_cfun->m_ssa_map[i]->verify_ssa ();
 
-      for (hsa_insn_basic *insn = hbb->m_first_insn; insn; insn = insn->m_next)
-	insn->verify ();
-    }
+      basic_block bb;
+      FOR_EACH_BB_FN (bb, cfun)
+	{
+	  hsa_bb *hbb = hsa_bb_for_bb (bb);
 
-#endif
+	  for (hsa_insn_basic *insn = hbb->m_first_insn; insn;
+	       insn = insn->m_next)
+	    insn->verify ();
+	}
+    }
 
   hsa_regalloc ();
   hsa_brig_emit_function ();
diff --git a/gcc/hsa-regalloc.c b/gcc/hsa-regalloc.c
index f8e83ecf..9437132 100644
--- a/gcc/hsa-regalloc.c
+++ b/gcc/hsa-regalloc.c
@@ -580,10 +580,9 @@ linear_scan_regalloc (struct m_reg_class_desc *classes)
   /* Sort all intervals by increasing start point.  */
   gcc_assert (ind2reg.length () == (size_t) hsa_cfun->m_reg_count);
 
-#ifdef ENABLE_CHECKING
-  for (unsigned i = 0; i < ind2reg.length (); i++)
-    gcc_assert (ind2reg[i]);
-#endif
+  if (flag_checking)
+    for (unsigned i = 0; i < ind2reg.length (); i++)
+      gcc_assert (ind2reg[i]);
 
   ind2reg.qsort (cmp_begin);
   for (i = 0; i < 4; i++)
-- 
2.7.0


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

* [PATCH 4/4] Poison ENABLE_CHECKING macro
  2016-02-25 15:35 [PATCH 0/4] Replace remaining ENABLE_CHECKING macros marxin
@ 2016-02-25 15:35 ` marxin
  2016-02-26 10:43   ` Richard Biener
  2016-02-25 15:35 ` [PATCH 3/4] Replace ENABLE_CHECKING with CHECKING_P in dwarf2out marxin
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: marxin @ 2016-02-25 15:35 UTC (permalink / raw)
  To: gcc-patches

gcc/ChangeLog:

2016-02-25  Martin Liska  <mliska@suse.cz>

	* system.h: Poison ENABLE_CHECKING macro.
---
 gcc/system.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/system.h b/gcc/system.h
index 445073c..cb54541 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -1014,6 +1014,10 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
 #undef rindex
  #pragma GCC poison bcopy bzero bcmp rindex
 
+/* Poison ENABLE_CHECKING macro that should be replaced with
+   'if (flag_checking)', or with CHECKING_P macro.  */
+#pragma GCC poison ENABLE_CHECKING
+
 #endif /* GCC >= 3.0 */
 
 /* This macro allows casting away const-ness to pass -Wcast-qual
-- 
2.7.0

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

* [PATCH 0/4] Replace remaining ENABLE_CHECKING macros
@ 2016-02-25 15:35 marxin
  2016-02-25 15:35 ` [PATCH 4/4] Poison ENABLE_CHECKING macro marxin
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: marxin @ 2016-02-25 15:35 UTC (permalink / raw)
  To: gcc-patches

Hello

Following series removes remaining usage of ENABLE_CHECKING macro, where
the last patch eventually poisons the macro.

The series has been tested in common and survives regbootstrap on
x86_64-linux-gnu with default options (and Ada enabled)
and --enable-checking=none.

Ready for trunk?
Martin

marxin (4):
  Replace ENABLE_CHECKING macro with flag_checking in HSA
  Replace ENABLE_CHECKING macro with flag_checking in GNAT
  Replace ENABLE_CHECKING with CHECKING_P in dwarf2out
  Poison ENABLE_CHECKING macro

 gcc/ada/gcc-interface/utils.c | 12 +++++++-----
 gcc/dwarf2out.c               |  6 +++---
 gcc/dwarf2out.h               |  2 +-
 gcc/hsa-gen.c                 | 25 +++++++++++++------------
 gcc/hsa-regalloc.c            |  7 +++----
 gcc/system.h                  |  4 ++++
 6 files changed, 31 insertions(+), 25 deletions(-)

-- 
2.7.0

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

* [PATCH 3/4] Replace ENABLE_CHECKING with CHECKING_P in dwarf2out
  2016-02-25 15:35 [PATCH 0/4] Replace remaining ENABLE_CHECKING macros marxin
  2016-02-25 15:35 ` [PATCH 4/4] Poison ENABLE_CHECKING macro marxin
@ 2016-02-25 15:35 ` marxin
  2016-02-26 10:43   ` Richard Biener
  2016-02-25 15:35 ` [PATCH 1/4] Replace ENABLE_CHECKING macro with flag_checking in HSA marxin
  2016-02-25 15:35 ` [PATCH 2/4] Replace ENABLE_CHECKING macro with flag_checking in GNAT marxin
  3 siblings, 1 reply; 9+ messages in thread
From: marxin @ 2016-02-25 15:35 UTC (permalink / raw)
  To: gcc-patches

gcc/ChangeLog:

2016-02-25  Martin Liska  <mliska@suse.cz>

	* dwarf2out.c (new_loc_descr): Replace ENABLE_CHECKING with
	CHECKING_P.
	(resolve_args_picking_1): Likewise.
	* dwarf2out.h (struct GTY): Likewise.
---
 gcc/dwarf2out.c | 6 +++---
 gcc/dwarf2out.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 97e192b..a8c21d8 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1325,7 +1325,7 @@ new_loc_descr (enum dwarf_location_atom op, unsigned HOST_WIDE_INT oprnd1,
   dw_loc_descr_ref descr = ggc_cleared_alloc<dw_loc_descr_node> ();
 
   descr->dw_loc_opc = op;
-#if ENABLE_CHECKING
+#if CHECKING_P
   descr->dw_loc_frame_offset = -1;
 #endif
   descr->dw_loc_oprnd1.val_class = dw_val_class_unsigned_const;
@@ -15369,14 +15369,14 @@ resolve_args_picking_1 (dw_loc_descr_ref loc, unsigned initial_frame_offset,
       /* If we already met this node, there is nothing to compute anymore.  */
       if (visited.add (l))
 	{
-#if ENABLE_CHECKING
+#if CHECKING_P
 	  /* Make sure that the stack size is consistent wherever the execution
 	     flow comes from.  */
 	  gcc_assert ((unsigned) l->dw_loc_frame_offset == frame_offset_);
 #endif
 	  break;
 	}
-#if ENABLE_CHECKING
+#if CHECKING_P
       l->dw_loc_frame_offset = frame_offset_;
 #endif
 
diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h
index a96ac38..91b3d6b 100644
--- a/gcc/dwarf2out.h
+++ b/gcc/dwarf2out.h
@@ -239,7 +239,7 @@ struct GTY((chain_next ("%h.dw_loc_next"))) dw_loc_descr_node {
      frame offset.  */
   unsigned int frame_offset_rel : 1;
   int dw_loc_addr;
-#if ENABLE_CHECKING
+#if CHECKING_P
   /* When translating a function into a DWARF procedure, contains the frame
      offset *before* evaluating this operation.  It is -1 when not yet
      initialized.  */
-- 
2.7.0


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

* [PATCH 2/4] Replace ENABLE_CHECKING macro with flag_checking in GNAT
  2016-02-25 15:35 [PATCH 0/4] Replace remaining ENABLE_CHECKING macros marxin
                   ` (2 preceding siblings ...)
  2016-02-25 15:35 ` [PATCH 1/4] Replace ENABLE_CHECKING macro with flag_checking in HSA marxin
@ 2016-02-25 15:35 ` marxin
  2016-02-26 21:28   ` Jeff Law
  3 siblings, 1 reply; 9+ messages in thread
From: marxin @ 2016-02-25 15:35 UTC (permalink / raw)
  To: gcc-patches

gcc/ada/ChangeLog:

2016-02-24  Martin Liska  <mliska@suse.cz>

	* gcc-interface/utils.c (set_reverse_storage_order_on_pad_type):
	Replace ENABLE_CHECKING macro with flag_checking.
---
 gcc/ada/gcc-interface/utils.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index ff21e7b..4f81f1d 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1486,11 +1486,13 @@ set_reverse_storage_order_on_pad_type (tree type)
 {
   tree field, canonical_pad_type;
 
-#ifdef ENABLE_CHECKING
-  /* If the inner type is not scalar then the function does nothing.  */
-  tree inner_type = TREE_TYPE (TYPE_FIELDS (type));
-  gcc_assert (!AGGREGATE_TYPE_P (inner_type) && !VECTOR_TYPE_P (inner_type));
-#endif
+  if (flag_checking)
+    {
+      /* If the inner type is not scalar then the function does nothing.  */
+      tree inner_type = TREE_TYPE (TYPE_FIELDS (type));
+      gcc_assert (!AGGREGATE_TYPE_P (inner_type)
+		  && !VECTOR_TYPE_P (inner_type));
+    }
 
   /* This is required for the canonicalization.  */
   gcc_assert (TREE_CONSTANT (TYPE_SIZE (type)));
-- 
2.7.0


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

* Re: [PATCH 1/4] Replace ENABLE_CHECKING macro with flag_checking in HSA
  2016-02-25 15:35 ` [PATCH 1/4] Replace ENABLE_CHECKING macro with flag_checking in HSA marxin
@ 2016-02-25 17:18   ` Martin Jambor
  0 siblings, 0 replies; 9+ messages in thread
From: Martin Jambor @ 2016-02-25 17:18 UTC (permalink / raw)
  To: marxin; +Cc: gcc-patches

On Wed, Feb 24, 2016 at 02:59:11PM +0100, Martin Liska wrote:
> gcc/ChangeLog:
> 
> 2016-02-24  Martin Liska  <mliska@suse.cz>
> 
> 	* hsa-gen.c (generate_hsa): Replace ENABLE_CHECKING macro
> 	with flag_checking.
> 	* hsa-regalloc.c (linear_scan_regalloc): Likewise.


OK, thanks,

Martin

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

* Re: [PATCH 3/4] Replace ENABLE_CHECKING with CHECKING_P in dwarf2out
  2016-02-25 15:35 ` [PATCH 3/4] Replace ENABLE_CHECKING with CHECKING_P in dwarf2out marxin
@ 2016-02-26 10:43   ` Richard Biener
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Biener @ 2016-02-26 10:43 UTC (permalink / raw)
  To: marxin; +Cc: GCC Patches

On Thu, Feb 25, 2016 at 11:06 AM, marxin <mliska@suse.cz> wrote:
> gcc/ChangeLog:

Ok.

Richard.

> 2016-02-25  Martin Liska  <mliska@suse.cz>
>
>         * dwarf2out.c (new_loc_descr): Replace ENABLE_CHECKING with
>         CHECKING_P.
>         (resolve_args_picking_1): Likewise.
>         * dwarf2out.h (struct GTY): Likewise.
> ---
>  gcc/dwarf2out.c | 6 +++---
>  gcc/dwarf2out.h | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
> index 97e192b..a8c21d8 100644
> --- a/gcc/dwarf2out.c
> +++ b/gcc/dwarf2out.c
> @@ -1325,7 +1325,7 @@ new_loc_descr (enum dwarf_location_atom op, unsigned HOST_WIDE_INT oprnd1,
>    dw_loc_descr_ref descr = ggc_cleared_alloc<dw_loc_descr_node> ();
>
>    descr->dw_loc_opc = op;
> -#if ENABLE_CHECKING
> +#if CHECKING_P
>    descr->dw_loc_frame_offset = -1;
>  #endif
>    descr->dw_loc_oprnd1.val_class = dw_val_class_unsigned_const;
> @@ -15369,14 +15369,14 @@ resolve_args_picking_1 (dw_loc_descr_ref loc, unsigned initial_frame_offset,
>        /* If we already met this node, there is nothing to compute anymore.  */
>        if (visited.add (l))
>         {
> -#if ENABLE_CHECKING
> +#if CHECKING_P
>           /* Make sure that the stack size is consistent wherever the execution
>              flow comes from.  */
>           gcc_assert ((unsigned) l->dw_loc_frame_offset == frame_offset_);
>  #endif
>           break;
>         }
> -#if ENABLE_CHECKING
> +#if CHECKING_P
>        l->dw_loc_frame_offset = frame_offset_;
>  #endif
>
> diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h
> index a96ac38..91b3d6b 100644
> --- a/gcc/dwarf2out.h
> +++ b/gcc/dwarf2out.h
> @@ -239,7 +239,7 @@ struct GTY((chain_next ("%h.dw_loc_next"))) dw_loc_descr_node {
>       frame offset.  */
>    unsigned int frame_offset_rel : 1;
>    int dw_loc_addr;
> -#if ENABLE_CHECKING
> +#if CHECKING_P
>    /* When translating a function into a DWARF procedure, contains the frame
>       offset *before* evaluating this operation.  It is -1 when not yet
>       initialized.  */
> --
> 2.7.0
>
>

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

* Re: [PATCH 4/4] Poison ENABLE_CHECKING macro
  2016-02-25 15:35 ` [PATCH 4/4] Poison ENABLE_CHECKING macro marxin
@ 2016-02-26 10:43   ` Richard Biener
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Biener @ 2016-02-26 10:43 UTC (permalink / raw)
  To: marxin; +Cc: GCC Patches

On Thu, Feb 25, 2016 at 11:11 AM, marxin <mliska@suse.cz> wrote:
> gcc/ChangeLog:

Ok.

Richard.

> 2016-02-25  Martin Liska  <mliska@suse.cz>
>
>         * system.h: Poison ENABLE_CHECKING macro.
> ---
>  gcc/system.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/gcc/system.h b/gcc/system.h
> index 445073c..cb54541 100644
> --- a/gcc/system.h
> +++ b/gcc/system.h
> @@ -1014,6 +1014,10 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
>  #undef rindex
>   #pragma GCC poison bcopy bzero bcmp rindex
>
> +/* Poison ENABLE_CHECKING macro that should be replaced with
> +   'if (flag_checking)', or with CHECKING_P macro.  */
> +#pragma GCC poison ENABLE_CHECKING
> +
>  #endif /* GCC >= 3.0 */
>
>  /* This macro allows casting away const-ness to pass -Wcast-qual
> --
> 2.7.0
>

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

* Re: [PATCH 2/4] Replace ENABLE_CHECKING macro with flag_checking in GNAT
  2016-02-25 15:35 ` [PATCH 2/4] Replace ENABLE_CHECKING macro with flag_checking in GNAT marxin
@ 2016-02-26 21:28   ` Jeff Law
  0 siblings, 0 replies; 9+ messages in thread
From: Jeff Law @ 2016-02-26 21:28 UTC (permalink / raw)
  To: marxin, gcc-patches

On 02/24/2016 07:10 AM, marxin wrote:
> gcc/ada/ChangeLog:
>
> 2016-02-24  Martin Liska  <mliska@suse.cz>
>
> 	* gcc-interface/utils.c (set_reverse_storage_order_on_pad_type):
> 	Replace ENABLE_CHECKING macro with flag_checking.
OK.
jeff

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

end of thread, other threads:[~2016-02-26 21:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-25 15:35 [PATCH 0/4] Replace remaining ENABLE_CHECKING macros marxin
2016-02-25 15:35 ` [PATCH 4/4] Poison ENABLE_CHECKING macro marxin
2016-02-26 10:43   ` Richard Biener
2016-02-25 15:35 ` [PATCH 3/4] Replace ENABLE_CHECKING with CHECKING_P in dwarf2out marxin
2016-02-26 10:43   ` Richard Biener
2016-02-25 15:35 ` [PATCH 1/4] Replace ENABLE_CHECKING macro with flag_checking in HSA marxin
2016-02-25 17:18   ` Martin Jambor
2016-02-25 15:35 ` [PATCH 2/4] Replace ENABLE_CHECKING macro with flag_checking in GNAT marxin
2016-02-26 21:28   ` 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).