From patchwork Sat Jul 17 22:59:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [committed] Fix string alignment on hppa64 for builtin stpcpy Date: Sat, 17 Jul 2010 12:59:00 -0000 From: John David Anglin X-Patchwork-Id: 59153 Message-Id: <20100717225900.E9B174CFD@hiauly1.hia.nrc.ca> To: gcc-patches@gcc.gnu.org The enclosed patch fixes string alignment on hppa64 for builtin stpcpy. The change to CONSTANT_ALIGNMENT makes it similar to that for ia64, rs6000, etc. Tested on hppa64-hp-hpux11.11, hppa2.0w-hp-hpux11.11 and hppa-unknown-linux-gnu. Committed to trunk. Dave Index: config/pa/pa.h =================================================================== --- config/pa/pa.h (revision 162277) +++ config/pa/pa.h (working copy) @@ -316,8 +316,9 @@ #define BIGGEST_ALIGNMENT (2 * BITS_PER_WORD) /* Get around hp-ux assembler bug, and make strcpy of constants fast. */ -#define CONSTANT_ALIGNMENT(CODE, TYPEALIGN) \ - ((TYPEALIGN) < 32 ? 32 : (TYPEALIGN)) +#define CONSTANT_ALIGNMENT(EXP, ALIGN) \ + (TREE_CODE (EXP) == STRING_CST \ + && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) /* Make arrays of chars word-aligned for the same reasons. */ #define DATA_ALIGNMENT(TYPE, ALIGN) \