This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Oct 2012 01:24:09 +0000
- Subject: [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
- Auto-submitted: auto-generated
- References: <bug-55116-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116
--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-30 01:24:09 UTC ---
[hjl@gnu-tools-1 pr55116]$ cat x.cc
typedef struct rtx_def *rtx;
enum machine_mode {
VOIDmode };
enum rtx_code {
CONST_INT, NEG, CONST, PLUS, NOT, MINUS };
enum rtx_class {
RTX_CONST_OBJ };
extern const enum rtx_class rtx_class[4];
union rtunion_def {
rtx rt_rtx;
};
typedef union rtunion_def rtunion;
struct block_symbol {
};
struct rtx_def {
enum rtx_code code: 16;
union u {
rtunion fld[1];
}
u;
};
rtx simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
rtx op0, rtx op1);
struct simplify_plus_minus_op_data {
rtx op;
short neg;
};
rtx simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0,
rtx op1) {
struct simplify_plus_minus_op_data ops[8];
rtx result, tem;
int n_ops = 2, input_ops = 2;
int changed, n_constants = 0, canonicalized = 0;
int i, j;
do
{
changed = 0;
for (i = 0; i < n_ops; i++)
{
rtx this_op = ops[i].op;
int this_neg = ops[i].neg;
enum rtx_code this_code = ((enum rtx_code) (this_op)->code);
switch (this_code)
{
case MINUS:
if (n_ops == 7)
return (rtx) 0;
n_ops++;
input_ops++;
changed = 1;
canonicalized |= this_neg;
break;
}
}
}
while (changed);
do
{
for (i = n_ops - 1; j >= 0; j--)
{
rtx lhs = ops[j].op, rhs = ops[i].op;
int lneg = ops[j].neg, rneg = ops[i].neg;
if (lhs != 0 && rhs != 0)
{
enum rtx_code ncode = PLUS;
if (((enum rtx_code) (lhs)->code) == CONST)
tem = simplify_binary_operation (ncode, mode, lhs, rhs);
if (tem && ! (((enum rtx_code) (tem)->code) == CONST
&& ((((((tem)->u.fld[0]).rt_rtx))->u.fld[0]).rt_rtx) == lhs
&& ((((((tem)->u.fld[0]).rt_rtx))->u.fld[1]).rt_rtx) == rhs))
{
lneg &= rneg;
ops[i].op = tem;
ops[i].neg = lneg;
ops[j].op = (rtx) 0;
changed = 1;
canonicalized = 1;
}
}
}
for (i = 0, j = 0; j < n_ops; j++)
if (ops[j].op)
{
ops[i] = ops[j];
i++;
}
}
while (changed);
}
[hjl@gnu-tools-1 pr55116]$ make
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O2 -mx32 -maddress-mode=long
-S x.cc
x.cc: In function ârtx_def* simplify_plus_minus(rtx_code, machine_mode, rtx,
rtx)â:
x.cc:88:1: internal compiler error: in set_address_base, at rtlanal.c:5514
}
^
0xbaa171 set_address_base
/export/gnu/import/git/gcc/gcc/rtlanal.c:5512
0xbaaa07 decompose_normal_address
/export/gnu/import/git/gcc/gcc/rtlanal.c:5709
0xbaab13 decompose_address(address_info*, rtx_def**, machine_mode, unsigned
char, rtx_code)
/export/gnu/import/git/gcc/gcc/rtlanal.c:5747
0xbaab46 decompose_lea_address(address_info*, rtx_def**)
/export/gnu/import/git/gcc/gcc/rtlanal.c:5757
0xac1fd8 process_address
/export/gnu/import/git/gcc/gcc/lra-constraints.c:2274
0xac2c98 curr_insn_transform
/export/gnu/import/git/gcc/gcc/lra-constraints.c:2658
0xac5099 lra_constraints(bool)
/export/gnu/import/git/gcc/gcc/lra-constraints.c:3409
0xab587f lra(_IO_FILE*)
/export/gnu/import/git/gcc/gcc/lra.c:2281
0xa6b2e6 do_reload
/export/gnu/import/git/gcc/gcc/ira.c:4624
0xa6b4f4 rest_of_handle_reload
/export/gnu/import/git/gcc/gcc/ira.c:4736
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [x.s] Error 1
[hjl@gnu-tools-1 pr55116]$