mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-21 13:20:05 +08:00
re PR target/10781 (wrong class size and alignment with static class member)
2004-01-17 Andrew Pinski <pinskia@physics.uc.edu> PR target/10781 * config/rs6000/rs6000-protos.h (rs6000_special_round_type_align): Prototype. * config/rs6000/rs6000.c (rs6000_special_round_type_align): New function. * config/rs6000/linux64.h (ROUND_TYPE_ALIGN): Use it. * config/rs6000/aix.h (ROUND_TYPE_ALIGN): Likewise. * config/rs6000/darwin.h (ROUND_TYPE_ALIGN): Likewise. 2004-01-17 Andrew Pinski <pinskia@physics.uc.edu> PR target/10781 * encoding.c (rs6000_special_round_type_align): Define. From-SVN: r76043
This commit is contained in:
parent
4bfaff4d24
commit
95727fb877
@ -1,3 +1,14 @@
|
||||
2004-01-17 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
PR target/10781
|
||||
* config/rs6000/rs6000-protos.h (rs6000_special_round_type_align):
|
||||
Prototype.
|
||||
* config/rs6000/rs6000.c (rs6000_special_round_type_align):
|
||||
New function.
|
||||
* config/rs6000/linux64.h (ROUND_TYPE_ALIGN): Use it.
|
||||
* config/rs6000/aix.h (ROUND_TYPE_ALIGN): Likewise.
|
||||
* config/rs6000/darwin.h (ROUND_TYPE_ALIGN): Likewise.
|
||||
|
||||
2004-01-17 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* toplev.c (rest_of_handle_reorder_blocks): Fix pasto in previous
|
||||
|
@ -139,14 +139,12 @@
|
||||
|
||||
/* AIX increases natural record alignment to doubleword if the first
|
||||
field is an FP double while the FP fields remain word aligned. */
|
||||
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
|
||||
((TREE_CODE (STRUCT) == RECORD_TYPE \
|
||||
|| TREE_CODE (STRUCT) == UNION_TYPE \
|
||||
|| TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
|
||||
&& TYPE_FIELDS (STRUCT) != 0 \
|
||||
&& TARGET_ALIGN_NATURAL == 0 \
|
||||
&& DECL_MODE (TYPE_FIELDS (STRUCT)) == DFmode \
|
||||
? MAX (MAX ((COMPUTED), (SPECIFIED)), 64) \
|
||||
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
|
||||
((TREE_CODE (STRUCT) == RECORD_TYPE \
|
||||
|| TREE_CODE (STRUCT) == UNION_TYPE \
|
||||
|| TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
|
||||
&& TARGET_ALIGN_NATURAL == 0 \
|
||||
? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
|
||||
: MAX ((COMPUTED), (SPECIFIED)))
|
||||
|
||||
/* The AIX ABI isn't explicit on whether aggregates smaller than a
|
||||
|
@ -295,16 +295,14 @@ do { \
|
||||
|
||||
/* Darwin increases natural record alignment to doubleword if the first
|
||||
field is an FP double while the FP fields remain word aligned. */
|
||||
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
|
||||
((TREE_CODE (STRUCT) == RECORD_TYPE \
|
||||
|| TREE_CODE (STRUCT) == UNION_TYPE \
|
||||
|| TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
|
||||
&& TYPE_FIELDS (STRUCT) != 0 \
|
||||
&& TARGET_ALIGN_NATURAL == 0 \
|
||||
&& DECL_MODE (TYPE_FIELDS (STRUCT)) == DFmode \
|
||||
? MAX (MAX ((COMPUTED), (SPECIFIED)), 64) \
|
||||
: (TARGET_ALTIVEC && TREE_CODE (STRUCT) == VECTOR_TYPE) \
|
||||
? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \
|
||||
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
|
||||
((TREE_CODE (STRUCT) == RECORD_TYPE \
|
||||
|| TREE_CODE (STRUCT) == UNION_TYPE \
|
||||
|| TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
|
||||
&& TARGET_ALIGN_NATURAL == 0 \
|
||||
? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
|
||||
: (TARGET_ALTIVEC && TREE_CODE (STRUCT) == VECTOR_TYPE) \
|
||||
? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \
|
||||
: MAX ((COMPUTED), (SPECIFIED)))
|
||||
|
||||
/* XXX: Darwin supports neither .quad, or .llong, but it also doesn't
|
||||
@ -322,3 +320,4 @@ do { \
|
||||
|
||||
#undef REGISTER_TARGET_PRAGMAS
|
||||
#define REGISTER_TARGET_PRAGMAS DARWIN_REGISTER_TARGET_PRAGMAS
|
||||
|
||||
|
@ -224,19 +224,17 @@
|
||||
: (COMPUTED))
|
||||
|
||||
/* PowerPC64 Linux increases natural record alignment to doubleword if
|
||||
the first field is an FP double. */
|
||||
the first field is an FP double, only if in power alignment mode. */
|
||||
#undef ROUND_TYPE_ALIGN
|
||||
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
|
||||
((TARGET_ALTIVEC && TREE_CODE (STRUCT) == VECTOR_TYPE) \
|
||||
? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \
|
||||
: (TARGET_64BIT \
|
||||
&& (TREE_CODE (STRUCT) == RECORD_TYPE \
|
||||
|| TREE_CODE (STRUCT) == UNION_TYPE \
|
||||
|| TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
|
||||
&& TYPE_FIELDS (STRUCT) != 0 \
|
||||
&& TARGET_ALIGN_NATURAL == 0 \
|
||||
&& DECL_MODE (TYPE_FIELDS (STRUCT)) == DFmode) \
|
||||
? MAX (MAX ((COMPUTED), (SPECIFIED)), 64) \
|
||||
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
|
||||
((TARGET_ALTIVEC && TREE_CODE (STRUCT) == VECTOR_TYPE) \
|
||||
? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \
|
||||
: (TARGET_64BIT \
|
||||
&& (TREE_CODE (STRUCT) == RECORD_TYPE \
|
||||
|| TREE_CODE (STRUCT) == UNION_TYPE \
|
||||
|| TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
|
||||
&& TARGET_ALIGN_NATURAL == 0) \
|
||||
? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
|
||||
: MAX ((COMPUTED), (SPECIFIED)))
|
||||
|
||||
/* Indicate that jump tables go in the text section. */
|
||||
|
@ -144,6 +144,7 @@ extern rtx rs6000_machopic_legitimize_pic_address (rtx orig,
|
||||
#endif /* RTX_CODE */
|
||||
|
||||
#ifdef TREE_CODE
|
||||
extern int rs6000_special_round_type_align (tree, int, int);
|
||||
extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
|
||||
tree, int);
|
||||
extern int function_arg_boundary (enum machine_mode, tree);
|
||||
|
@ -2317,6 +2317,28 @@ input_operand (rtx op, enum machine_mode mode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Darwin, AIX increases natural record alignment to doubleword if the first
|
||||
field is an FP double while the FP fields remain word aligned. */
|
||||
|
||||
int
|
||||
rs6000_special_round_type_align (tree type, int computed, int specified)
|
||||
{
|
||||
tree field = TYPE_FIELDS (type);
|
||||
if (!field)
|
||||
return MAX (computed, specified);
|
||||
|
||||
/* Skip all the static variables only if ABI is greater than
|
||||
1 or equal to 0. */
|
||||
while (TREE_CODE (field) == VAR_DECL)
|
||||
field = TREE_CHAIN (field);
|
||||
|
||||
if (field == type || DECL_MODE (field) != DFmode)
|
||||
return MAX (computed, specified);
|
||||
|
||||
return MAX (MAX (computed, specified), 64);
|
||||
}
|
||||
|
||||
/* Return 1 for an operand in small memory on V.4/eabi. */
|
||||
|
||||
int
|
||||
|
@ -1,3 +1,8 @@
|
||||
2004-01-17 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
PR target/10781
|
||||
* encoding.c (rs6000_special_round_type_align): Define.
|
||||
|
||||
2004-01-14 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
PR libobjc/12155
|
||||
|
@ -88,6 +88,17 @@ Boston, MA 02111-1307, USA. */
|
||||
eliminate the warning. */
|
||||
static int __attribute__ ((__unused__)) target_flags = 0;
|
||||
|
||||
|
||||
/* FIXME: while this file has no business including tm.h, this
|
||||
definitely has no business defining this macro but it
|
||||
is only way around without really rewritting this file,
|
||||
should look after the branch of 3.4 to fix this. */
|
||||
#define rs6000_special_round_type_align(STRUCT, COMPUTED, SPECIFIED) \
|
||||
((TYPE_FIELDS (STRUCT) != 0 \
|
||||
&& DECL_MODE (TYPE_FIELDS (STRUCT)) == DFmode) \
|
||||
? MAX (MAX (COMPUTED, SPECIFIED), 64) \
|
||||
: MAX (COMPUTED, SPECIFIED))
|
||||
|
||||
/*
|
||||
return the size of an object specified by type
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user