This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc@gcc.gnu.org
- To: Frank Klemm <pfk at fuchs dot offl dot uni-jena dot de>
- Subject: Re: gcc@gcc.gnu.org
- From: Hartmut Schirmer <hartmut dot schirmer at arcormail dot de>
- Date: Sun, 26 Aug 2001 12:42:14 +0200
- Cc: gcc at gnu dot org
- References: <20010825205122.A14018@fuchs.offl.uni-jena.de>
- Reply-To: hartmut dot schirmer at arcormail dot de
Hi Frank,
On Sat, 25 Aug 2001, Frank Klemm wrote:
>How to avoid the silly string alignment:
>
>char string1 [] = "Hello";
>char string2 [] = "world";
>
>Hex dump of the binary:
>
> H e l l o . . . . . . . . . . .
> . . . . . . . . . . . . . . . .
> w o r l d . . . . . . . . . . .
> . . . . . . . . . . . . . . . .
on the Hitachi SH series I did the following
changes to get better string alignment
Hartmut
*** sh.h.orig Tue Jan 9 11:25:22 2001
--- sh.h Wed Jan 10 01:32:11 2001
***************
*** 366,372 ****
/* Make strings word-aligned so strcpy from constants will be faster. */
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
((TREE_CODE (EXP) == STRING_CST \
! && (ALIGN) < FASTEST_ALIGNMENT) \
? FASTEST_ALIGNMENT : (ALIGN))
#ifndef MAX_OFILE_ALIGNMENT
--- 366,373 ----
/* Make strings word-aligned so strcpy from constants will be faster. */
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
((TREE_CODE (EXP) == STRING_CST \
! && (ALIGN) < FASTEST_ALIGNMENT \
! && !TARGET_SMALLCODE) \
? FASTEST_ALIGNMENT : (ALIGN))
#ifndef MAX_OFILE_ALIGNMENT
***************
*** 377,382 ****
--- 378,384 ----
#define DATA_ALIGNMENT(TYPE, ALIGN) \
(TREE_CODE (TYPE) == ARRAY_TYPE \
&& TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
+ && !TARGET_SMALLCODE \
&& (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))
/* Number of bits which any structure or union's size must be a