* [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
2012-10-29 12:34 [Bug middle-end/55116] New: [4.8 Regression] LRA failed to decompose ASHIFT hjl.tools at gmail dot com
@ 2012-10-29 13:14 ` hjl.tools at gmail dot com
2012-10-29 14:52 ` rguenth at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-10-29 13:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-29 13:14:03 UTC ---
ix86_decompose_address has
case ASHIFT:
if (index)
return 0;
index = XEXP (op, 0);
tmp = XEXP (op, 1);
if (!CONST_INT_P (tmp))
return 0;
scale = INTVAL (tmp);
if ((unsigned HOST_WIDE_INT) scale > 3)
return 0;
scale = 1 << scale;
break;
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
2012-10-29 12:34 [Bug middle-end/55116] New: [4.8 Regression] LRA failed to decompose ASHIFT hjl.tools at gmail dot com
2012-10-29 13:14 ` [Bug middle-end/55116] " hjl.tools at gmail dot com
@ 2012-10-29 14:52 ` rguenth at gcc dot gnu.org
2012-10-29 16:37 ` vmakarov at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-10-29 14:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |x32-*-*
Target Milestone|--- |4.8.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
2012-10-29 12:34 [Bug middle-end/55116] New: [4.8 Regression] LRA failed to decompose ASHIFT hjl.tools at gmail dot com
2012-10-29 13:14 ` [Bug middle-end/55116] " hjl.tools at gmail dot com
2012-10-29 14:52 ` rguenth at gcc dot gnu.org
@ 2012-10-29 16:37 ` vmakarov at gcc dot gnu.org
2012-10-29 23:09 ` hjl at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: vmakarov at gcc dot gnu.org @ 2012-10-29 16:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116
--- Comment #2 from Vladimir Makarov <vmakarov at gcc dot gnu.org> 2012-10-29 16:37:08 UTC ---
Author: vmakarov
Date: Mon Oct 29 16:36:57 2012
New Revision: 192949
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192949
Log:
2012-10-29 Vladimir Makarov <vmakarov@redhat.com>
PR middle-end/55116
* rtlanal.c (strip_address_mutation): Add SUBREG case.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/rtlanal.c
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
2012-10-29 12:34 [Bug middle-end/55116] New: [4.8 Regression] LRA failed to decompose ASHIFT hjl.tools at gmail dot com
` (2 preceding siblings ...)
2012-10-29 16:37 ` vmakarov at gcc dot gnu.org
@ 2012-10-29 23:09 ` hjl at gcc dot gnu.org
2012-10-29 23:11 ` hjl.tools at gmail dot com
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl at gcc dot gnu.org @ 2012-10-29 23:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116
--- Comment #3 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> 2012-10-29 23:09:08 UTC ---
Author: hjl
Date: Mon Oct 29 23:09:03 2012
New Revision: 192967
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192967
Log:
Add a testcase for PR middle-end/55116
PR middle-end/55116
* gcc.target/i386/pr55116.c: New file.
Added:
trunk/gcc/testsuite/gcc.target/i386/pr55116.c
Modified:
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
2012-10-29 12:34 [Bug middle-end/55116] New: [4.8 Regression] LRA failed to decompose ASHIFT hjl.tools at gmail dot com
` (3 preceding siblings ...)
2012-10-29 23:09 ` hjl at gcc dot gnu.org
@ 2012-10-29 23:11 ` hjl.tools at gmail dot com
2012-10-30 0:06 ` hjl.tools at gmail dot com
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-10-29 23:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-29 23:11:11 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
2012-10-29 12:34 [Bug middle-end/55116] New: [4.8 Regression] LRA failed to decompose ASHIFT hjl.tools at gmail dot com
` (4 preceding siblings ...)
2012-10-29 23:11 ` hjl.tools at gmail dot com
@ 2012-10-30 0:06 ` hjl.tools at gmail dot com
2012-10-30 0:08 ` hjl.tools at gmail dot com
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-10-30 0:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Last reconfirmed| |2012-10-30
Resolution|FIXED |
Ever Confirmed|0 |1
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-30 00:06:20 UTC ---
The fix is incomplete.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
2012-10-29 12:34 [Bug middle-end/55116] New: [4.8 Regression] LRA failed to decompose ASHIFT hjl.tools at gmail dot com
` (5 preceding siblings ...)
2012-10-30 0:06 ` hjl.tools at gmail dot com
@ 2012-10-30 0:08 ` hjl.tools at gmail dot com
2012-10-30 0:11 ` hjl.tools at gmail dot com
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-10-30 0:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116
--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-30 00:08:28 UTC ---
Created attachment 28566
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28566
A testcase
[hjl@gnu-tools-1 prev-gcc]$ ./xgcc -B./ -O2 -mx32 -S /tmp/x.ii
/tmp/x.ii: In function ‘rtx_def* simplify_binary_operation(rtx_code,
machine_mode, rtx, rtx)’:
/tmp/x.ii:2141:3: internal compiler error: in set_address_base, at
rtlanal.c:5511
}
^
0xc08dbb set_address_base
/export/gnu/import/git/gcc-misc/gcc/rtlanal.c:5509
0xc096c7 decompose_normal_address
/export/gnu/import/git/gcc-misc/gcc/rtlanal.c:5706
0xc097e4 decompose_address(address_info*, rtx_def**, machine_mode, unsigned
char, rtx_code)
/export/gnu/import/git/gcc-misc/gcc/rtlanal.c:5744
0xc0981b decompose_lea_address(address_info*, rtx_def**)
/export/gnu/import/git/gcc-misc/gcc/rtlanal.c:5754
0xb1a515 process_address
/export/gnu/import/git/gcc-misc/gcc/lra-constraints.c:2274
0xb1b1d0 curr_insn_transform
/export/gnu/import/git/gcc-misc/gcc/lra-constraints.c:2658
0xb1d65d lra_constraints(bool)
/export/gnu/import/git/gcc-misc/gcc/lra-constraints.c:3409
0xb0d909 lra(_IO_FILE*)
/export/gnu/import/git/gcc-misc/gcc/lra.c:2281
0xac0ed0 do_reload
/export/gnu/import/git/gcc-misc/gcc/ira.c:4624
0xac10f4 rest_of_handle_reload
/export/gnu/import/git/gcc-misc/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.
[hjl@gnu-tools-1 prev-gcc]$
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
2012-10-29 12:34 [Bug middle-end/55116] New: [4.8 Regression] LRA failed to decompose ASHIFT hjl.tools at gmail dot com
` (6 preceding siblings ...)
2012-10-30 0:08 ` hjl.tools at gmail dot com
@ 2012-10-30 0:11 ` hjl.tools at gmail dot com
2012-10-30 1:24 ` hjl.tools at gmail dot com
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-10-30 0:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116
--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-30 00:10:55 UTC ---
(In reply to comment #6)
> Created attachment 28566 [details]
> A testcase
>
> [hjl@gnu-tools-1 prev-gcc]$ ./xgcc -B./ -O2 -mx32 -S /tmp/x.ii
You need to add -maddress-mode=long.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
2012-10-29 12:34 [Bug middle-end/55116] New: [4.8 Regression] LRA failed to decompose ASHIFT hjl.tools at gmail dot com
` (7 preceding siblings ...)
2012-10-30 0:11 ` hjl.tools at gmail dot com
@ 2012-10-30 1:24 ` hjl.tools at gmail dot com
2012-10-30 1:36 ` hjl.tools at gmail dot com
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-10-30 1:24 UTC (permalink / raw)
To: gcc-bugs
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]$
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
2012-10-29 12:34 [Bug middle-end/55116] New: [4.8 Regression] LRA failed to decompose ASHIFT hjl.tools at gmail dot com
` (8 preceding siblings ...)
2012-10-30 1:24 ` hjl.tools at gmail dot com
@ 2012-10-30 1:36 ` hjl.tools at gmail dot com
2012-10-30 1:52 ` hjl.tools at gmail dot com
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-10-30 1:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116
--- Comment #9 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-30 01:36:26 UTC ---
This helps:
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 43d4cb8..d076ad6 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -5460,6 +5460,7 @@ strip_address_mutations (rtx *loc, enum rtx_code
*outer_code)
/* (and ... (const_int -X)) is used to align to X bytes. */
loc = &XEXP (*loc, 0);
else if (code == SUBREG
+ && GET_MODE (*loc) == Pmode
&& !OBJECT_P (SUBREG_REG (*loc))
&& subreg_lowpart_p (*loc))
/* (subreg (operator ...) ...) inside and is used for mode
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
2012-10-29 12:34 [Bug middle-end/55116] New: [4.8 Regression] LRA failed to decompose ASHIFT hjl.tools at gmail dot com
` (9 preceding siblings ...)
2012-10-30 1:36 ` hjl.tools at gmail dot com
@ 2012-10-30 1:52 ` hjl.tools at gmail dot com
2012-10-30 21:36 ` hjl at gcc dot gnu.org
2012-10-30 22:09 ` hjl.tools at gmail dot com
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-10-30 1:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #28566|0 |1
is obsolete| |
--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-30 01:52:04 UTC ---
Created attachment 28569
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28569
A smaller testcase
A small testcase can be compiled cleanly with -Wall.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
2012-10-29 12:34 [Bug middle-end/55116] New: [4.8 Regression] LRA failed to decompose ASHIFT hjl.tools at gmail dot com
` (10 preceding siblings ...)
2012-10-30 1:52 ` hjl.tools at gmail dot com
@ 2012-10-30 21:36 ` hjl at gcc dot gnu.org
2012-10-30 22:09 ` hjl.tools at gmail dot com
12 siblings, 0 replies; 14+ messages in thread
From: hjl at gcc dot gnu.org @ 2012-10-30 21:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116
--- Comment #11 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> 2012-10-30 21:35:42 UTC ---
Author: hjl
Date: Tue Oct 30 21:35:35 2012
New Revision: 192996
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192996
Log:
Add another testcase for PR middle-end/55116
* gcc.target/i386/pr55116-2.c: New file.
Added:
trunk/gcc/testsuite/gcc.target/i386/pr55116-2.c
Modified:
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/55116] [4.8 Regression] LRA failed to decompose ASHIFT
2012-10-29 12:34 [Bug middle-end/55116] New: [4.8 Regression] LRA failed to decompose ASHIFT hjl.tools at gmail dot com
` (11 preceding siblings ...)
2012-10-30 21:36 ` hjl at gcc dot gnu.org
@ 2012-10-30 22:09 ` hjl.tools at gmail dot com
12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2012-10-30 22:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
--- Comment #12 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-30 22:08:22 UTC ---
Fixed by:
http://gcc.gnu.org/ml/gcc-cvs/2012-10/msg01112.html
^ permalink raw reply [flat|nested] 14+ messages in thread