* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
@ 2013-12-18 13:44 ` schwab@linux-m68k.org
2013-12-18 13:52 ` schwab@linux-m68k.org
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: schwab@linux-m68k.org @ 2013-12-18 13:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
Between r205951 and r205984.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
2013-12-18 13:44 ` [Bug bootstrap/59536] " schwab@linux-m68k.org
@ 2013-12-18 13:52 ` schwab@linux-m68k.org
2013-12-18 14:29 ` schwab@linux-m68k.org
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: schwab@linux-m68k.org @ 2013-12-18 13:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
--- Comment #2 from Andreas Schwab <schwab@linux-m68k.org> ---
Created attachment 31468
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31468&action=edit
Preprocessed source
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
2013-12-18 13:44 ` [Bug bootstrap/59536] " schwab@linux-m68k.org
2013-12-18 13:52 ` schwab@linux-m68k.org
@ 2013-12-18 14:29 ` schwab@linux-m68k.org
2013-12-18 14:30 ` schwab@linux-m68k.org
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: schwab@linux-m68k.org @ 2013-12-18 14:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
Andreas Schwab <schwab@linux-m68k.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target|m68k-linux |m68k-*-*
CC| |amker at gcc dot gnu.org
--- Comment #3 from Andreas Schwab <schwab@linux-m68k.org> ---
c03531c413c501b0033ea2ea3f030cd7e6f66320 is the first bad commit
commit c03531c413c501b0033ea2ea3f030cd7e6f66320
Author: amker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri Dec 13 11:36:22 2013 +0000
PR tree-optimization/58296
PR tree-optimization/41488
* tree-scalar-evolution.c: Include necessary header files.
(simplify_peeled_chrec): New function.
(analyze_evolution_in_loop): New static variable.
Call simplify_peeled_chrec.
* tree-ssa-loop-ivopts.c (mark_bivs): Don't mark peeled IV as biv.
(add_old_iv_candidates): Don't add candidate for peeled IV.
* tree-affine.h (aff_combination_zero_p): New function.
PR tree-optimization/58296
PR tree-optimization/41488
* gcc.dg/tree-ssa/scev-7.c: New test.
* gcc.dg/pr41488.c: New test.
* g++.dg/pr59445.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205959
138bc75d-0d04-0410-961f-82ee72b054a4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
` (2 preceding siblings ...)
2013-12-18 14:29 ` schwab@linux-m68k.org
@ 2013-12-18 14:30 ` schwab@linux-m68k.org
2013-12-18 15:43 ` jakub at gcc dot gnu.org
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: schwab@linux-m68k.org @ 2013-12-18 14:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
Andreas Schwab <schwab@linux-m68k.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-12-18
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
` (3 preceding siblings ...)
2013-12-18 14:30 ` schwab@linux-m68k.org
@ 2013-12-18 15:43 ` jakub at gcc dot gnu.org
2013-12-19 1:11 ` amker.cheng at gmail dot com
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-12-18 15:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Sounds just like uncovering a latent bug in cselib?
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
` (4 preceding siblings ...)
2013-12-18 15:43 ` jakub at gcc dot gnu.org
@ 2013-12-19 1:11 ` amker.cheng at gmail dot com
2013-12-19 2:18 ` amker.cheng at gmail dot com
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: amker.cheng at gmail dot com @ 2013-12-19 1:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
bin.cheng <amker.cheng at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amker.cheng at gmail dot com
--- Comment #5 from bin.cheng <amker.cheng at gmail dot com> ---
I will have a look.
Thanks.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
` (5 preceding siblings ...)
2013-12-19 1:11 ` amker.cheng at gmail dot com
@ 2013-12-19 2:18 ` amker.cheng at gmail dot com
2013-12-19 4:16 ` hjl.tools at gmail dot com
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: amker.cheng at gmail dot com @ 2013-12-19 2:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
--- Comment #6 from bin.cheng <amker.cheng at gmail dot com> ---
Hi,
Sorry I don't have m68k environment to do the bootstrap, could anyone help dump
"-fdump-tree-all-details -fdump-rtl-all-slim" with and without the patch for
me? Otherwise I have to revert the patch and hold it for future.
Hi Jakub, should I revert the patch for now?
Thanks.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
` (6 preceding siblings ...)
2013-12-19 2:18 ` amker.cheng at gmail dot com
@ 2013-12-19 4:16 ` hjl.tools at gmail dot com
2013-12-19 5:20 ` amker.cheng at gmail dot com
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hjl.tools at gmail dot com @ 2013-12-19 4:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to bin.cheng from comment #6)
> Hi,
> Sorry I don't have m68k environment to do the bootstrap, could anyone help
> dump "-fdump-tree-all-details -fdump-rtl-all-slim" with and without the
> patch for me? Otherwise I have to revert the patch and hold it for future.
>
Can't you use cross compiler on preprocessed input to debug it?
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
` (7 preceding siblings ...)
2013-12-19 4:16 ` hjl.tools at gmail dot com
@ 2013-12-19 5:20 ` amker.cheng at gmail dot com
2013-12-19 6:03 ` amker.cheng at gmail dot com
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: amker.cheng at gmail dot com @ 2013-12-19 5:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
--- Comment #8 from bin.cheng <amker.cheng at gmail dot com> ---
(In reply to Andreas Schwab from comment #1)
> Between r205951 and r205984.
(In reply to H.J. Lu from comment #7)
> (In reply to bin.cheng from comment #6)
> > Hi,
> > Sorry I don't have m68k environment to do the bootstrap, could anyone help
> > dump "-fdump-tree-all-details -fdump-rtl-all-slim" with and without the
> > patch for me? Otherwise I have to revert the patch and hold it for future.
> >
>
> Can't you use cross compiler on preprocessed input to debug it?
The bare-metal tool seems not handle the preprocessed file correctly, so am
trying to build cross linux tools. Unfortunately, cross-ng only supports
uclinux for m68k. Given that I am not familiar with m68k-linux, so I am having
difficulty in enabling one for now.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
` (8 preceding siblings ...)
2013-12-19 5:20 ` amker.cheng at gmail dot com
@ 2013-12-19 6:03 ` amker.cheng at gmail dot com
2013-12-19 8:27 ` amker.cheng at gmail dot com
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: amker.cheng at gmail dot com @ 2013-12-19 6:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
--- Comment #9 from bin.cheng <amker.cheng at gmail dot com> ---
Turns out my crossed bare-metal tool works after deleting all preprocessed "#
xxx file" lines, but why these lines matter?
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
` (9 preceding siblings ...)
2013-12-19 6:03 ` amker.cheng at gmail dot com
@ 2013-12-19 8:27 ` amker.cheng at gmail dot com
2013-12-19 8:35 ` amker.cheng at gmail dot com
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: amker.cheng at gmail dot com @ 2013-12-19 8:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
--- Comment #10 from bin.cheng <amker.cheng at gmail dot com> ---
The offending loop before IVOPT is like:
<bb 350>:
# var_index_1889 = PHI <1(924), var_index_983(923)>
# var_index.250_1269 = PHI <1(924), var_index.250_1959(923)>
if (var_index.250_1269 < _1237)
goto <bb 351>;
else
goto <bb 885>;
<bb 351>:
loopi_952 = MEM[(const struct vec
*)pretmp_2270].m_vecdata[var_index.250_1269];
_947 = loopi_952->num;
if (_947 == pretmp_2268)
goto <bb 352>;
else
goto <bb 923>;
<bb 923>:
var_index_983 = var_index_1889 + 1;
var_index.250_1959 = (unsigned int) var_index_983;
goto <bb 350>;
<bb 924>:
goto <bb 350>;
The patch can recognize var_index.250_1269 is an iv with {1, 1}_loop, thus
rewriting the loop into:
<bb 350>:
# var_index_1889 = PHI <1(924), var_index_983(923)>
# ivtmp.1067_1968 = PHI <ivtmp.1067_696(924), ivtmp.1067_884(923)>
var_index.250_1269 = (unsigned int) var_index_1889;
if (var_index_1889 != _958)
goto <bb 351>;
else
goto <bb 885>;
<bb 351>:
_111 = (void *) ivtmp.1067_1968;
loopi_952 = MEM[base: _111, offset: 0B];
ivtmp.1067_884 = ivtmp.1067_1968 + 4;
_947 = loopi_952->num;
if (_947 == pretmp_2268)
goto <bb 352>;
else
goto <bb 923>;
<bb 923>:
var_index_983 = var_index_1889 + 1;
goto <bb 350>;
<bb 924>:
_1542 = pretmp_2270 + 12;
ivtmp.1067_696 = (unsigned int) _1542;
_958 = (int) _1237;
goto <bb 350>;
The transformation looks good and takes advantage of post-increment addressing
mode for memory access "MEM[base: _111, offset: 0B]".
The loop is expanded into rtl like:
4438: L4438:
1814: NOTE_INSN_BASIC_BLOCK 352
1815: r626:SI=r817:SI
1816: cc0=cmp(r817:SI,r492:SI)
1817: pc={(cc0==0)?L4244:pc}
REG_BR_PROB 900
1818: NOTE_INSN_BASIC_BLOCK 353
1819: r490:SI=[r829:SI]
1820: r829:SI=r829:SI+0x4
1821: cc0=cmp([r490:SI],r864:SI)
1822: pc={(cc0!=0)?L4435:pc}
...
4435: L4435:
4436: NOTE_INSN_BASIC_BLOCK 952
4437: r817:SI=r817:SI+0x1
4439: pc=L4438
4440: barrier
4441: L4441:
4442: NOTE_INSN_BASIC_BLOCK 953
4443: r829:SI=r865:SI+0xc
4444: r492:SI=r621:SI
44: r817:SI=0x1
4445: pc=L4438
Then instruction 1819/1820 are combined by auto-inc-dec pass into:
1819: r490:SI=[r829:SI++]
REG_INC r829:SI
1821: cc0=cmp([r490:SI],r864:SI)
REG_DEAD r490:SI
1822: pc={(cc0!=0)?L4435:pc}
REG_BR_PROB 9550
Problem comes from reload which puts both r490 and r829 into %a0 (reg 8?) and
generates below code:
1819: %a0:SI=[%a0:SI++]
REG_INC %a0:SI
1821: cc0=cmp([%a0:SI],%d2:SI)
1822: pc={(cc0!=0)?L4435:pc}
REG_BR_PROB 9550
Insn 1819 is now bogus and causes assertion in cselib.
In IRA, there are dumps like:
Popping a1119(r829,l0: a921(r829,l17)) -- assign reg 8
Popping a1122(r1111,l0: a924(r1111,l17)) -- assign reg 8
Popping a1120(r494,l0: a922(r494,l17)) -- assign reg 9
Popping a1147(r1054,l0: a1006(r1054,l15)) -- assign reg 8
Popping a1157(r490,l0: a1124(r490,l17: a959(r490,l18))) -- assign reg 2
But in reload, there are dumps:
Reloads for insn # 1819
Reload 0: reload_in (SI) = (post_inc:SI (reg:SI 829 [ ivtmp.1067 ]))
reload_out (SI) = (post_inc:SI (reg:SI 829 [ ivtmp.1067 ]))
ADDR_REGS, RELOAD_FOR_OPERAND_ADDRESS (opnum = 1), inc by 4
reload_in_reg: (post_inc:SI (reg:SI 829 [ ivtmp.1067 ]))
reload_reg_rtx: (reg:SI 8 %a0)
Reload 1: reload_out (SI) = (reg/v/f:SI 490 [ loopi ])
GENERAL_REGS, RELOAD_FOR_OUTPUT (opnum = 0), optional
reload_out_reg: (reg/v/f:SI 490 [ loopi ])
Reload 2: reload_in (SI) = (mem/f:SI (post_inc:SI (reg:SI 829 [ ivtmp.1067 ]))
[4 MEM[base: _111, offset: 0B]+0 S4 A16])
GENERAL_REGS, RELOAD_FOR_INPUT (opnum = 1), optional
reload_in_reg: (mem/f:SI (post_inc:SI (reg:SI 829 [ ivtmp.1067 ])) [4
MEM[base: _111, offset: 0B]+0 S4 A16])
So I am not sure if there are some bugs in reload for m68k, or ivopt is doing
something very trick and wrong?
Thanks,
bin
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
` (10 preceding siblings ...)
2013-12-19 8:27 ` amker.cheng at gmail dot com
@ 2013-12-19 8:35 ` amker.cheng at gmail dot com
2013-12-19 8:41 ` schwab@linux-m68k.org
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: amker.cheng at gmail dot com @ 2013-12-19 8:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
bin.cheng <amker.cheng at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bernds at codesourcery dot com,
| |uweigand at de dot ibm.com
--- Comment #11 from bin.cheng <amker.cheng at gmail dot com> ---
Add reload maintainer for some suggestions.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
` (11 preceding siblings ...)
2013-12-19 8:35 ` amker.cheng at gmail dot com
@ 2013-12-19 8:41 ` schwab@linux-m68k.org
2013-12-19 8:49 ` amker.cheng at gmail dot com
2013-12-19 9:02 ` schwab@linux-m68k.org
14 siblings, 0 replies; 16+ messages in thread
From: schwab@linux-m68k.org @ 2013-12-19 8:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
--- Comment #12 from Andreas Schwab <schwab@linux-m68k.org> ---
-fno-auto-inc-dec avoids the crash. Dup of #52306?
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
` (12 preceding siblings ...)
2013-12-19 8:41 ` schwab@linux-m68k.org
@ 2013-12-19 8:49 ` amker.cheng at gmail dot com
2013-12-19 9:02 ` schwab@linux-m68k.org
14 siblings, 0 replies; 16+ messages in thread
From: amker.cheng at gmail dot com @ 2013-12-19 8:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
--- Comment #13 from bin.cheng <amker.cheng at gmail dot com> ---
(In reply to Andreas Schwab from comment #12)
> -fno-auto-inc-dec avoids the crash. Dup of #52306?
It looks like, AFAICT. Only this time it's blocking bootstrap :(
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug bootstrap/59536] [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap
2013-12-17 11:20 [Bug bootstrap/59536] New: [4.9 regression] internal compiler error: in cselib_record_set, at cselib.c:2376 breaks m68k-linux bootstrap mikpelinux at gmail dot com
` (13 preceding siblings ...)
2013-12-19 8:49 ` amker.cheng at gmail dot com
@ 2013-12-19 9:02 ` schwab@linux-m68k.org
14 siblings, 0 replies; 16+ messages in thread
From: schwab@linux-m68k.org @ 2013-12-19 9:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59536
Andreas Schwab <schwab@linux-m68k.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #14 from Andreas Schwab <schwab@linux-m68k.org> ---
As confirmed by comment 9 there.
*** This bug has been marked as a duplicate of bug 52306 ***
^ permalink raw reply [flat|nested] 16+ messages in thread