add default for CONSTANT_ALIGNMENT
authorTrevor Saunders <tbsaunde+gcc@tbsaunde.org>
Fri, 21 Aug 2015 01:15:33 +0000 (01:15 +0000)
committerTrevor Saunders <tbsaunde@gcc.gnu.org>
Fri, 21 Aug 2015 01:15:33 +0000 (01:15 +0000)
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.

From-SVN: r227052

gcc/ChangeLog
gcc/builtins.c
gcc/defaults.h
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/varasm.c

index 2943501..2063885 100644 (file)
@@ -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.
 
index 31969ca..635ba54 100644 (file)
@@ -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;
     }
 
index 4fe8eb1..d4d3a56 100644 (file)
@@ -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
 
index f95646c..f5a1f84 100644 (file)
@@ -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
index 2383fb9..9d5ac0a 100644 (file)
@@ -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
index 2ebac89..7fa2e7b 100644 (file)
@@ -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);