Patchwork RFA (middle-end documentation): Require LOCAL_ALIGNMENT et al to be unsigned

login
register
mail settings
Submitter Joern Rennecke
Date Nov. 10, 2010, 12:51 p.m.
Message ID <20101110075137.2tapqbfco4k04wsc-nzlynne@webmail.spamcop.net>
Download mbox | patch
Permalink /patch/70634/
State New
Headers show

Comments

Joern Rennecke - Nov. 10, 2010, 12:51 p.m.
When looking how to fix 44767, I realized that LOCAL_ALIGNMENT is
generally used in an unsigned text.  The one bootstrapping target
which uses a function, i386, also uses a function with unsigned
alignment parameter and return types.

While it would be easy to use casts in the place where the macros
are used, that would be prone to unexpected loss of precision etc,
and defining preferences for the types gets us closer to
hookizing these macros.
2010-11-10  Joern Rennecke  <amylaar@spamcop.net>

	PR bootstrap/44756
	PR build/44767
	* doc/tm.texi.in (LOCAL_ALIGNMENT): State that the type, if any,
	should be unsigned.
	(STACK_SLOT_ALIGNMENT, LOCAL_DECL_ALIGNMENT, PUSH_ROUNDING): Likewise.
	* doc/tm.texi: Regenerate.
Richard Henderson - Nov. 12, 2010, 4:55 p.m.
On 11/10/2010 04:51 AM, Joern Rennecke wrote:
> 	PR bootstrap/44756
> 	PR build/44767
> 	* doc/tm.texi.in (LOCAL_ALIGNMENT): State that the type, if any,
> 	should be unsigned.
> 	(STACK_SLOT_ALIGNMENT, LOCAL_DECL_ALIGNMENT, PUSH_ROUNDING): Likewise.
> 	* doc/tm.texi: Regenerate.

Ok.


r~

Patch

Index: doc/tm.texi
===================================================================
--- doc/tm.texi	(revision 166491)
+++ doc/tm.texi	(working copy)
@@ -1134,6 +1134,8 @@  @defmac LOCAL_ALIGNMENT (@var{type}, @va
 
 One use of this macro is to increase alignment of medium-size data to
 make it all fit in fewer cache lines.
+
+It the value of this macro has a type, it should be an unsigned type.
 @end defmac
 
 @defmac STACK_SLOT_ALIGNMENT (@var{type}, @var{mode}, @var{basic-align})
@@ -1149,6 +1151,8 @@  @defmac STACK_SLOT_ALIGNMENT (@var{type}
 
 This macro is to set alignment of stack slot to the maximum alignment
 of all possible modes which the slot may have.
+
+It the value of this macro has a type, it should be an unsigned type.
 @end defmac
 
 @defmac LOCAL_DECL_ALIGNMENT (@var{decl})
@@ -1161,6 +1165,8 @@  @defmac LOCAL_DECL_ALIGNMENT (@var{decl}
 
 One use of this macro is to increase alignment of medium-size data to
 make it all fit in fewer cache lines.
+
+It the value of this macro has a type, it should be an unsigned type.
 @end defmac
 
 @defmac MINIMUM_ALIGNMENT (@var{exp}, @var{mode}, @var{align})
@@ -3871,6 +3877,8 @@  @defmac PUSH_ROUNDING (@var{npushed})
 @smallexample
 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
 @end smallexample
+
+It the value of this macro has a type, it should be an unsigned type.
 @end defmac
 
 @findex current_function_outgoing_args_size
Index: doc/tm.texi.in
===================================================================
--- doc/tm.texi.in	(revision 166491)
+++ doc/tm.texi.in	(working copy)
@@ -1124,6 +1124,8 @@  @defmac LOCAL_ALIGNMENT (@var{type}, @va
 
 One use of this macro is to increase alignment of medium-size data to
 make it all fit in fewer cache lines.
+
+It the value of this macro has a type, it should be an unsigned type.
 @end defmac
 
 @defmac STACK_SLOT_ALIGNMENT (@var{type}, @var{mode}, @var{basic-align})
@@ -1139,6 +1141,8 @@  @defmac STACK_SLOT_ALIGNMENT (@var{type}
 
 This macro is to set alignment of stack slot to the maximum alignment
 of all possible modes which the slot may have.
+
+It the value of this macro has a type, it should be an unsigned type.
 @end defmac
 
 @defmac LOCAL_DECL_ALIGNMENT (@var{decl})
@@ -1151,6 +1155,8 @@  @defmac LOCAL_DECL_ALIGNMENT (@var{decl}
 
 One use of this macro is to increase alignment of medium-size data to
 make it all fit in fewer cache lines.
+
+It the value of this macro has a type, it should be an unsigned type.
 @end defmac
 
 @defmac MINIMUM_ALIGNMENT (@var{exp}, @var{mode}, @var{align})
@@ -3861,6 +3867,8 @@  @defmac PUSH_ROUNDING (@var{npushed})
 @smallexample
 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
 @end smallexample
+
+It the value of this macro has a type, it should be an unsigned type.
 @end defmac
 
 @findex current_function_outgoing_args_size