public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/4] always define HAVE_conditional_execution
  2015-08-21  1:21 [PATCH 0/4] a little bit of ifdef removal tbsaunde+gcc
  2015-08-21  1:21 ` [PATCH 2/4] remove another #if for HAVE_cc0 tbsaunde+gcc
  2015-08-21  1:21 ` [PATCH 4/4] add default for CONSTANT_ALIGNMENT tbsaunde+gcc
@ 2015-08-21  1:21 ` tbsaunde+gcc
  2015-08-21  5:20 ` [PATCH 3/4] always define HAVE_peephole2 tbsaunde+gcc
  3 siblings, 0 replies; 5+ messages in thread
From: tbsaunde+gcc @ 2015-08-21  1:21 UTC (permalink / raw)
  To: gcc-patches

From: tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>

gcc/ChangeLog:

2015-08-20  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* genconfig.c (main): Always define HAVE_CONDITIONAL_EXECUTION.
	* targhooks.c (default_have_conditional_execution): Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227049 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog   | 5 +++++
 gcc/genconfig.c | 2 ++
 gcc/targhooks.c | 4 ----
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 42abb92..87cccef 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-20  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
+	* genconfig.c (main): Always define HAVE_CONDITIONAL_EXECUTION.
+	* targhooks.c (default_have_conditional_execution): Adjust.
+
 2015-08-20  Richard Sandiford  <richard.sandiford@arm.com>
 
 	* rtl.h (rtvec_all_equal_p): Declare.
diff --git a/gcc/genconfig.c b/gcc/genconfig.c
index ac16c5b..acbf381 100644
--- a/gcc/genconfig.c
+++ b/gcc/genconfig.c
@@ -348,6 +348,8 @@ main (int argc, char **argv)
 
   if (have_cond_exec_flag)
     printf ("#define HAVE_conditional_execution 1\n");
+  else
+    printf ("#define HAVE_conditional_execution 0\n");
 
   if (have_lo_sum_flag)
     printf ("#define HAVE_lo_sum 1\n");
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 3eca47e..7238c8f 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -1350,11 +1350,7 @@ default_case_values_threshold (void)
 bool
 default_have_conditional_execution (void)
 {
-#ifdef HAVE_conditional_execution
   return HAVE_conditional_execution;
-#else
-  return false;
-#endif
 }
 
 /* By default we assume that c99 functions are present at the runtime,
-- 
2.4.0

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

* [PATCH 2/4] remove another #if for HAVE_cc0
  2015-08-21  1:21 [PATCH 0/4] a little bit of ifdef removal tbsaunde+gcc
@ 2015-08-21  1:21 ` tbsaunde+gcc
  2015-08-21  1:21 ` [PATCH 4/4] add default for CONSTANT_ALIGNMENT tbsaunde+gcc
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: tbsaunde+gcc @ 2015-08-21  1:21 UTC (permalink / raw)
  To: gcc-patches

From: tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>

gcc/ChangeLog:

2015-08-20  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* reorg.c (relax_delay_slots): Don't use #if to check value of
	HAVE_cc0.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227050 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog | 5 +++++
 gcc/reorg.c   | 8 +++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 87cccef..5debcca 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
 2015-08-20  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
 
+	* reorg.c (relax_delay_slots): Don't use #if to check value of
+	HAVE_cc0.
+
+2015-08-20  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
 	* genconfig.c (main): Always define HAVE_CONDITIONAL_EXECUTION.
 	* targhooks.c (default_have_conditional_execution): Adjust.
 
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 1c60e13..cdaa60c 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -3445,15 +3445,13 @@ relax_delay_slots (rtx_insn *first)
 	  && ! condjump_in_parallel_p (delay_jump_insn)
 	  && prev_active_insn (target_label) == insn
 	  && ! BARRIER_P (prev_nonnote_insn (target_label))
-#if HAVE_cc0
 	  /* If the last insn in the delay slot sets CC0 for some insn,
 	     various code assumes that it is in a delay slot.  We could
 	     put it back where it belonged and delete the register notes,
 	     but it doesn't seem worthwhile in this uncommon case.  */
-	  && ! find_reg_note (XVECEXP (pat, 0, XVECLEN (pat, 0) - 1),
-			      REG_CC_USER, NULL_RTX)
-#endif
-	  )
+	  && (!HAVE_cc0
+	      || ! find_reg_note (XVECEXP (pat, 0, XVECLEN (pat, 0) - 1),
+				  REG_CC_USER, NULL_RTX)))
 	{
 	  rtx_insn *after;
 	  int i;
-- 
2.4.0

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

* [PATCH 4/4] add default for CONSTANT_ALIGNMENT
  2015-08-21  1:21 [PATCH 0/4] a little bit of ifdef removal tbsaunde+gcc
  2015-08-21  1:21 ` [PATCH 2/4] remove another #if for HAVE_cc0 tbsaunde+gcc
@ 2015-08-21  1:21 ` tbsaunde+gcc
  2015-08-21  1:21 ` [PATCH 1/4] always define HAVE_conditional_execution tbsaunde+gcc
  2015-08-21  5:20 ` [PATCH 3/4] always define HAVE_peephole2 tbsaunde+gcc
  3 siblings, 0 replies; 5+ messages in thread
From: tbsaunde+gcc @ 2015-08-21  1:21 UTC (permalink / raw)
  To: gcc-patches

From: tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>

gcc/ChangeLog:

2015-08-20  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* defaults.h (CONSTANT_ALIGNMENT): New macro definition.
	* builtins.c (get_object_alignment_2): Adjust.
	* varasm.c (align_variable): Likewise.
	(get_variable_align): Likewise.
	(build_constant_desc): Likewise.
	(force_const_mem): Likewise.
	* doc/tm.texi.in: Likewise.
	* doc/tm.texi: Regenerate.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227052 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog      | 11 +++++++++++
 gcc/builtins.c     |  6 ++----
 gcc/defaults.h     |  4 ++++
 gcc/doc/tm.texi    |  2 +-
 gcc/doc/tm.texi.in |  2 +-
 gcc/varasm.c       | 17 ++++-------------
 6 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2943501..2063885 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
 2015-08-20  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
 
+	* defaults.h (CONSTANT_ALIGNMENT): New macro definition.
+	* builtins.c (get_object_alignment_2): Adjust.
+	* varasm.c (align_variable): Likewise.
+	(get_variable_align): Likewise.
+	(build_constant_desc): Likewise.
+	(force_const_mem): Likewise.
+	* doc/tm.texi.in: Likewise.
+	* doc/tm.texi: Regenerate.
+
+2015-08-20  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
 	* genconfig.c (main): Always define HAVE_cc0.
 	* recog.c (rest_of_handle_peephole2): Adjust.
 
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 31969ca..635ba54 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -314,10 +314,9 @@ get_object_alignment_2 (tree exp, unsigned int *alignp,
       /* The alignment of a CONST_DECL is determined by its initializer.  */
       exp = DECL_INITIAL (exp);
       align = TYPE_ALIGN (TREE_TYPE (exp));
-#ifdef CONSTANT_ALIGNMENT
       if (CONSTANT_CLASS_P (exp))
 	align = (unsigned) CONSTANT_ALIGNMENT (exp, align);
-#endif
+
       known_alignment = true;
     }
   else if (DECL_P (exp))
@@ -393,10 +392,9 @@ get_object_alignment_2 (tree exp, unsigned int *alignp,
       /* STRING_CST are the only constant objects we allow to be not
          wrapped inside a CONST_DECL.  */
       align = TYPE_ALIGN (TREE_TYPE (exp));
-#ifdef CONSTANT_ALIGNMENT
       if (CONSTANT_CLASS_P (exp))
 	align = (unsigned) CONSTANT_ALIGNMENT (exp, align);
-#endif
+
       known_alignment = true;
     }
 
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 4fe8eb1..d4d3a56 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -1273,6 +1273,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define WORD_REGISTER_OPERATIONS 0
 #endif
 
+#ifndef CONSTANT_ALIGNMENT
+#define CONSTANT_ALIGNMENT(EXP, ALIGN) ALIGN
+#endif
+
 #ifdef GCC_INSN_FLAGS_H
 /* Dependent default target macro definitions
 
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index f95646c..f5a1f84 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -1098,7 +1098,7 @@ that is being placed in memory.  @var{constant} is the constant and
 have.  The value of this macro is used instead of that alignment to
 align the object.
 
-If this macro is not defined, then @var{basic-align} is used.
+The default definition just returns @var{basic-align}.
 
 The typical use of this macro is to increase alignment for string
 constants to be word aligned so that @code{strcpy} calls that copy
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 2383fb9..9d5ac0a 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -1048,7 +1048,7 @@ that is being placed in memory.  @var{constant} is the constant and
 have.  The value of this macro is used instead of that alignment to
 align the object.
 
-If this macro is not defined, then @var{basic-align} is used.
+The default definition just returns @var{basic-align}.
 
 The typical use of this macro is to increase alignment for string
 constants to be word aligned so that @code{strcpy} calls that copy
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 2ebac89..7fa2e7b 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1043,7 +1043,6 @@ align_variable (tree decl, bool dont_output_data)
 	  if (! DECL_THREAD_LOCAL_P (decl) || data_align <= BITS_PER_WORD)
 	    align = data_align;
 #endif
-#ifdef CONSTANT_ALIGNMENT
 	  if (DECL_INITIAL (decl) != 0
 	      /* In LTO we have no errors in program; error_mark_node is used
 		 to mark offlined constructors.  */
@@ -1056,7 +1055,6 @@ align_variable (tree decl, bool dont_output_data)
 	      if (! DECL_THREAD_LOCAL_P (decl) || const_align <= BITS_PER_WORD)
 		align = const_align;
 	    }
-#endif
 	}
     }
 
@@ -1097,7 +1095,6 @@ get_variable_align (tree decl)
       if (! DECL_THREAD_LOCAL_P (decl) || data_align <= BITS_PER_WORD)
 	align = data_align;
 #endif
-#ifdef CONSTANT_ALIGNMENT
       if (DECL_INITIAL (decl) != 0
 	  /* In LTO we have no errors in program; error_mark_node is used
 	     to mark offlined constructors.  */
@@ -1110,7 +1107,6 @@ get_variable_align (tree decl)
 	  if (! DECL_THREAD_LOCAL_P (decl) || const_align <= BITS_PER_WORD)
 	    align = const_align;
 	}
-#endif
     }
 
   return align;
@@ -3286,9 +3282,7 @@ build_constant_desc (tree exp)
      architectures so use DATA_ALIGNMENT as well, except for strings.  */
   if (TREE_CODE (exp) == STRING_CST)
     {
-#ifdef CONSTANT_ALIGNMENT
       DECL_ALIGN (decl) = CONSTANT_ALIGNMENT (exp, DECL_ALIGN (decl));
-#endif
     }
   else
     align_variable (decl, 0);
@@ -3743,13 +3737,10 @@ force_const_mem (machine_mode mode, rtx x)
 
   /* Align the location counter as required by EXP's data type.  */
   align = GET_MODE_ALIGNMENT (mode == VOIDmode ? word_mode : mode);
-#ifdef CONSTANT_ALIGNMENT
-  {
-    tree type = lang_hooks.types.type_for_mode (mode, 0);
-    if (type != NULL_TREE)
-      align = CONSTANT_ALIGNMENT (make_tree (type, x), align);
-  }
-#endif
+
+  tree type = lang_hooks.types.type_for_mode (mode, 0);
+  if (type != NULL_TREE)
+    align = CONSTANT_ALIGNMENT (make_tree (type, x), align);
 
   pool->offset += (align / BITS_PER_UNIT) - 1;
   pool->offset &= ~ ((align / BITS_PER_UNIT) - 1);
-- 
2.4.0

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

* [PATCH 0/4] a little bit of ifdef removal
@ 2015-08-21  1:21 tbsaunde+gcc
  2015-08-21  1:21 ` [PATCH 2/4] remove another #if for HAVE_cc0 tbsaunde+gcc
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: tbsaunde+gcc @ 2015-08-21  1:21 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

Hi,

just more removal of conditional compilation.

series run through config-list.mk, and each patch individually bootstrapped on
x86_64-linux-gnu.  I think this is still preapproved so committed.

Trev


tbsaunde (4):
  always define HAVE_conditional_execution
  remove another #if for HAVE_cc0
  always define HAVE_peephole2
  add default for CONSTANT_ALIGNMENT

 gcc/ChangeLog      | 26 ++++++++++++++++++++++++++
 gcc/builtins.c     |  6 ++----
 gcc/defaults.h     |  4 ++++
 gcc/doc/tm.texi    |  2 +-
 gcc/doc/tm.texi.in |  2 +-
 gcc/genconfig.c    |  7 +++++++
 gcc/recog.c        |  8 +++-----
 gcc/reorg.c        |  8 +++-----
 gcc/targhooks.c    |  4 ----
 gcc/varasm.c       | 17 ++++-------------
 10 files changed, 51 insertions(+), 33 deletions(-)

-- 
2.4.0

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

* [PATCH 3/4] always define HAVE_peephole2
  2015-08-21  1:21 [PATCH 0/4] a little bit of ifdef removal tbsaunde+gcc
                   ` (2 preceding siblings ...)
  2015-08-21  1:21 ` [PATCH 1/4] always define HAVE_conditional_execution tbsaunde+gcc
@ 2015-08-21  5:20 ` tbsaunde+gcc
  3 siblings, 0 replies; 5+ messages in thread
From: tbsaunde+gcc @ 2015-08-21  5:20 UTC (permalink / raw)
  To: gcc-patches

From: tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>

gcc/ChangeLog:

2015-08-20  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* genconfig.c (main): Always define HAVE_cc0.
	* recog.c (rest_of_handle_peephole2): Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227051 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog   | 5 +++++
 gcc/genconfig.c | 5 +++++
 gcc/recog.c     | 8 +++-----
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5debcca..2943501 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
 2015-08-20  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
 
+	* genconfig.c (main): Always define HAVE_cc0.
+	* recog.c (rest_of_handle_peephole2): Adjust.
+
+2015-08-20  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
 	* reorg.c (relax_delay_slots): Don't use #if to check value of
 	HAVE_cc0.
 
diff --git a/gcc/genconfig.c b/gcc/genconfig.c
index acbf381..fc3c1eb 100644
--- a/gcc/genconfig.c
+++ b/gcc/genconfig.c
@@ -372,6 +372,11 @@ main (int argc, char **argv)
       printf ("#define HAVE_peephole2 1\n");
       printf ("#define MAX_INSNS_PER_PEEP2 %d\n", max_insns_per_peep2);
     }
+  else
+    {
+      printf ("#define HAVE_peephole2 0\n");
+      printf ("#define MAX_INSNS_PER_PEEP2 0\n");
+    }
 
   puts ("\n#endif /* GCC_INSN_CONFIG_H */");
 
diff --git a/gcc/recog.c b/gcc/recog.c
index c595bbd..352aec2 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -3018,7 +3018,6 @@ split_all_insns_noflow (void)
   return 0;
 }
 \f
-#ifdef HAVE_peephole2
 struct peep2_insn_data
 {
   rtx_insn *insn;
@@ -3651,7 +3650,6 @@ peephole2_optimize (void)
   if (peep2_do_cleanup_cfg)
     cleanup_cfg (CLEANUP_CFG_CHANGED);
 }
-#endif /* HAVE_peephole2 */
 
 /* Common predicates for use with define_bypass.  */
 
@@ -3804,9 +3802,9 @@ if_test_bypass_p (rtx_insn *out_insn, rtx_insn *in_insn)
 static unsigned int
 rest_of_handle_peephole2 (void)
 {
-#ifdef HAVE_peephole2
-  peephole2_optimize ();
-#endif
+  if (HAVE_peephole2)
+    peephole2_optimize ();
+
   return 0;
 }
 
-- 
2.4.0

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

end of thread, other threads:[~2015-08-21  1:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-21  1:21 [PATCH 0/4] a little bit of ifdef removal tbsaunde+gcc
2015-08-21  1:21 ` [PATCH 2/4] remove another #if for HAVE_cc0 tbsaunde+gcc
2015-08-21  1:21 ` [PATCH 4/4] add default for CONSTANT_ALIGNMENT tbsaunde+gcc
2015-08-21  1:21 ` [PATCH 1/4] always define HAVE_conditional_execution tbsaunde+gcc
2015-08-21  5:20 ` [PATCH 3/4] always define HAVE_peephole2 tbsaunde+gcc

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