From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2904 invoked by alias); 30 Oct 2012 01:24:27 -0000 Received: (qmail 2789 invoked by uid 48); 30 Oct 2012 01:24:10 -0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT Date: Tue, 30 Oct 2012 01:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg02801.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55116 --- Comment #8 from H.J. Lu 2012-10-30 01:24:0= 9 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 op= 0,=20=20 rtx op1) { struct simplify_plus_minus_op_data ops[8]; rtx result, tem; int n_ops =3D 2, input_ops =3D 2; int changed, n_constants =3D 0, canonicalized =3D 0; int i, j; do { changed =3D 0; for (i =3D 0; i < n_ops; i++) { rtx this_op =3D ops[i].op; int this_neg =3D ops[i].neg; enum rtx_code this_code =3D ((enum rtx_code) (this_op)->code); switch (this_code) { case MINUS: if (n_ops =3D=3D 7) return (rtx) 0; n_ops++; input_ops++; changed =3D 1; canonicalized |=3D this_neg;=20 break; } } } while (changed); do=20 { for (i =3D n_ops - 1; j >=3D 0; j--) { rtx lhs =3D ops[j].op, rhs =3D ops[i].op; int lneg =3D ops[j].neg, rneg =3D ops[i].neg; if (lhs !=3D 0 && rhs !=3D 0) { enum rtx_code ncode =3D PLUS; if (((enum rtx_code) (lhs)->code) =3D=3D CONST) tem =3D simplify_binary_operation (ncode, mode, lhs, rhs); if (tem && ! (((enum rtx_code) (tem)->code) =3D=3D CONST && ((((((tem)->u.fld[0]).rt_rtx))->u.fld[0]).rt_rtx) =3D=3D= lhs && ((((((tem)->u.fld[0]).rt_rtx))->u.fld[1]).rt_rtx) =3D=3D= rhs)) { lneg &=3D rneg; ops[i].op =3D tem; ops[i].neg =3D lneg; ops[j].op =3D (rtx) 0; changed =3D 1; canonicalized =3D 1; } } } for (i =3D 0, j =3D 0; j < n_ops; j++) if (ops[j].op) { ops[i] =3D 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=3D= long -S x.cc x.cc: In function =E2=80=98rtx_def* simplify_plus_minus(rtx_code, machine_m= ode, rtx, rtx)=E2=80=99: 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 for instructions. make: *** [x.s] Error 1 [hjl@gnu-tools-1 pr55116]$