From 84aa7cea8faf45e9a045ceebe7f117d39301ab57 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Sat, 17 Jul 2010 22:51:34 +0000 Subject: [PATCH] re PR target/44805 (FAIL: gcc.c-torture/execute/builtins/strpcpy-2.c execution, at -O1 and above) PR target/44805 * config/pa/pa.h (CONSTANT_ALIGNMENT): Align strings to BITS_PER_WORD on all targets. From-SVN: r162278 --- gcc/ChangeLog | 22 ++++++++++++++++++++++ gcc/config/pa/pa.h | 5 +++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 77938c311f2d..ddfdc912a479 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,25 @@ +2010-07-17 John David Anglin + + PR target/44805 + * config/pa/pa.h (CONSTANT_ALIGNMENT): Align strings to BITS_PER_WORD + on all targets. + +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) \ 2010-07-17 Bernd Schmidt PR target/42235 diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 1bb0f106b301..73116c5383e1 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -316,8 +316,9 @@ typedef struct GTY(()) machine_function #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) \ -- 2.47.2