Fix ppc -m64 constant address expression expansion bug.
Oked by Richard Henderson. From-SVN: r103676
This commit is contained in:
parent
f471f0fcc7
commit
dc38a61086
@ -1,3 +1,9 @@
|
||||
2005-08-31 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
* expr.c (expand_expr_real_1): Compare size of address
|
||||
mode to target's address mode size in deciding expansion of
|
||||
the constant address.
|
||||
|
||||
2005-08-31 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR middle-end/23477
|
||||
|
@ -7673,7 +7673,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
|
||||
}
|
||||
|
||||
else if (TREE_CODE (TREE_OPERAND (exp, 1)) == INTEGER_CST
|
||||
&& GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_INT
|
||||
&& GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
|
||||
&& TREE_CONSTANT (TREE_OPERAND (exp, 0)))
|
||||
{
|
||||
rtx constant_part;
|
||||
|
33
gcc/testsuite/gcc.c-torture/execute/const-addr-expr-1.c
Normal file
33
gcc/testsuite/gcc.c-torture/execute/const-addr-expr-1.c
Normal file
@ -0,0 +1,33 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
extern void abort();
|
||||
|
||||
typedef struct foo
|
||||
{
|
||||
int uaattrid;
|
||||
char *name;
|
||||
} FOO;
|
||||
|
||||
FOO Upgrade_items[] =
|
||||
{
|
||||
{1, "1"},
|
||||
{2, "2"},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
int *Upgd_minor_ID =
|
||||
(int *) &((Upgrade_items + 1)->uaattrid);
|
||||
|
||||
int *Upgd_minor_ID1 =
|
||||
(int *) &((Upgrade_items)->uaattrid);
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
if (*Upgd_minor_ID != 2)
|
||||
abort();
|
||||
|
||||
if (*Upgd_minor_ID1 != 1)
|
||||
abort();
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user