function.c (locate_and_pad_parm): Don't align stack unconditionally.

2000-10-17  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>

	* function.c (locate_and_pad_parm): Don't align stack unconditionally.
	Fixes execute/20001017-1.c on pwerpc-linux-gnu.
	* expr.c (store_constructor): Apply MEM_ALIAS_SET to MEMs only.
	* rs6000/rs6000.c (rs6000_hash_constant): use X0INT to access a
	LABEL_REF.
	* rs6000/rs6000.h (NO_DOLLAR_IN_LABEL, DOLLARS_IN_IDENTIFIERS,
	ENCODE_SECTION_INFO, ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Move from
	here...
	* rs6000/aix.h: ...to here.
	* rs6000/linux.h (ASM_APP_ON, ASM_APP_OFF): Define to Linux-style.

From-SVN: r36914
This commit is contained in:
Franz Sirl 2000-10-17 22:17:34 +00:00 committed by Franz Sirl
parent 34137553f9
commit 832ea3b309
7 changed files with 78 additions and 49 deletions

View File

@ -1,3 +1,18 @@
2000-10-17 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* function.c (locate_and_pad_parm): Don't align stack unconditionally.
Fixes execute/20001017-1.c on pwerpc-linux-gnu.
* expr.c (store_constructor): Apply MEM_ALIAS_SET to MEMs only.
* rs6000/rs6000.c (rs6000_hash_constant): use X0INT to access a
LABEL_REF.
* rs6000/rs6000.h (NO_DOLLAR_IN_LABEL, DOLLARS_IN_IDENTIFIERS,
ENCODE_SECTION_INFO, ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Move from
here...
* rs6000/aix.h: ...to here.
* rs6000/linux.h (ASM_APP_ON, ASM_APP_OFF): Define to Linux-style.
2000-10-17 Jakub Jelinek <jakub@redhat.com>
* config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Reload gp if needed.

View File

@ -50,6 +50,17 @@ Boston, MA 02111-1307, USA. */
#define FASCIST_ASSEMBLER
/* We define this to prevent the name mangler from putting dollar signs into
function names. */
#define NO_DOLLAR_IN_LABEL
/* We define this to 0 so that gcc will never accept a dollar sign in a
variable name. This is needed because the AIX assembler will not accept
dollar signs. */
#define DOLLARS_IN_IDENTIFIERS 0
/* AIX does not have any init/fini or ctor/dtor sections, so create
static constructors and destructors as normal functions. */
/* #define ASM_OUTPUT_CONSTRUCTOR(file, name) */
@ -227,6 +238,30 @@ toc_section () \
} \
}
/* Return non-zero if this entry is to be written into the constant
pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF
or a CONST containing one of them. If -mfp-in-toc (the default),
we also do this for floating-point constants. We actually can only
do this if the FP formats of the target and host machines are the
same, but we can't check that since not every file that uses
GO_IF_LEGITIMATE_ADDRESS_P includes real.h. We also do this when
we can write the entry into the TOC and the entry is not larger
than a TOC entry. */
#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \
(TARGET_TOC \
&& (GET_CODE (X) == SYMBOL_REF \
|| (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
&& GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
|| GET_CODE (X) == LABEL_REF \
|| (GET_CODE (X) == CONST_INT \
&& GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \
|| (GET_CODE (X) == CONST_DOUBLE \
&& (TARGET_POWERPC64 \
|| TARGET_MINIMAL_TOC \
|| (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
&& ! TARGET_NO_FP_IN_TOC)))))
/* Select section for constant in constant pool.
On RS/6000, all constants are in the private read-only data area.
@ -240,6 +275,17 @@ toc_section () \
read_only_private_data_section (); \
}
/* If we are referencing a function that is static or is known to be
in this file, make the SYMBOL_REF special. We can use this to indicate
that we can branch to this function without emitting a no-op after the
call. Do not set this flag if the function is weakly defined. */
#define ENCODE_SECTION_INFO(DECL) \
if (TREE_CODE (DECL) == FUNCTION_DECL \
&& (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL)) \
&& ! DECL_WEAK (DECL)) \
SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;
/* Indicate that jump tables go in the text section. */
#define JUMP_TABLES_IN_TEXT_SECTION 1

View File

@ -54,6 +54,14 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)");
/* Override rs6000.h definition. */
#undef ASM_APP_ON
#define ASM_APP_ON "#APP\n"
/* Override rs6000.h definition. */
#undef ASM_APP_OFF
#define ASM_APP_OFF "#NO_APP\n"
#undef DEFAULT_VTABLE_THUNKS
#ifndef USE_GNULIBC_1
#define DEFAULT_VTABLE_THUNKS 1

View File

@ -6556,7 +6556,7 @@ rs6000_hash_constant (k)
int fidx;
if (GET_CODE (k) == LABEL_REF)
return result * 1231 + XINT (XEXP (k, 0), 3);
return result * 1231 + X0INT (XEXP (k, 0), 3);
if (GET_CODE (k) == CONST_DOUBLE)
fidx = 2;

View File

@ -2310,17 +2310,6 @@ extern int rs6000_compare_fp_p;
the end of the line. */
#define ASM_COMMENT_START " #"
/* We define this to prevent the name mangler from putting dollar signs into
function names. */
#define NO_DOLLAR_IN_LABEL
/* We define this to 0 so that gcc will never accept a dollar sign in a
variable name. This is needed because the AIX assembler will not accept
dollar signs. */
#define DOLLARS_IN_IDENTIFIERS 0
/* Implicit library calls should use memcpy, not bcopy, etc. */
#define TARGET_MEM_FUNCTIONS
@ -2331,44 +2320,9 @@ extern int rs6000_compare_fp_p;
#define EXCEPTION_SECTION data_section
/* If we are referencing a function that is static or is known to be
in this file, make the SYMBOL_REF special. We can use this to indicate
that we can branch to this function without emitting a no-op after the
call. Do not set this flag if the function is weakly defined. */
#define ENCODE_SECTION_INFO(DECL) \
if (TREE_CODE (DECL) == FUNCTION_DECL \
&& (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL)) \
&& ! DECL_WEAK (DECL)) \
SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;
/* Flag to say the TOC is initialized */
extern int toc_initialized;
/* Return non-zero if this entry is to be written into the constant
pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF
or a CONST containing one of them. If -mfp-in-toc (the default),
we also do this for floating-point constants. We actually can only
do this if the FP formats of the target and host machines are the
same, but we can't check that since not every file that uses
GO_IF_LEGITIMATE_ADDRESS_P includes real.h. We also do this when
we can write the entry into the TOC and the entry is not larger
than a TOC entry. */
#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \
(TARGET_TOC \
&& (GET_CODE (X) == SYMBOL_REF \
|| (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
&& GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
|| GET_CODE (X) == LABEL_REF \
|| (GET_CODE (X) == CONST_INT \
&& GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \
|| (GET_CODE (X) == CONST_DOUBLE \
&& (TARGET_POWERPC64 \
|| TARGET_MINIMAL_TOC \
|| (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
&& ! TARGET_NO_FP_IN_TOC)))))
/* Macro to output a special constant pool entry. Go to WIN if we output
it. Otherwise, it is written the usual way.

View File

@ -4206,7 +4206,8 @@ store_constructor_field (target, bitsize, bitpos,
plus_constant (XEXP (target, 0),
bitpos / BITS_PER_UNIT));
MEM_ALIAS_SET (target) = alias_set;
if (GET_CODE (target) == MEM)
MEM_ALIAS_SET (target) = alias_set;
store_constructor (exp, target, align, cleared, bitsize / BITS_PER_UNIT);
}
else

View File

@ -5149,7 +5149,12 @@ locate_and_pad_parm (passed_mode, type, in_regs, fndecl,
- offset_ptr->constant);
#else /* !ARGS_GROW_DOWNWARD */
pad_to_arg_alignment (initial_offset_ptr, boundary, alignment_pad);
if (!in_regs
#ifdef REG_PARM_STACK_SPACE
|| REG_PARM_STACK_SPACE (fndecl) > 0
#endif
)
pad_to_arg_alignment (initial_offset_ptr, boundary, alignment_pad);
*offset_ptr = *initial_offset_ptr;
#ifdef PUSH_ROUNDING