public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/53411] New: segfault
@ 2012-05-18 22:03 regehr at cs dot utah.edu
2012-05-20 20:04 ` [Bug middle-end/53411] [4.8 Regression] ICE in move_unallocated_pseudos pinskia at gcc dot gnu.org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: regehr at cs dot utah.edu @ 2012-05-18 22:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53411
Bug #: 53411
Summary: segfault
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: regehr@cs.utah.edu
CC: chenyang@cs.utah.edu
[regehr@dyson r49]$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r187663-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r187663-install
--program-prefix=r187663- --enable-languages=c,c++
Thread model: posix
gcc version 4.8.0 20120518 (experimental) (GCC)
[regehr@dyson r49]$ current-gcc -O3 small.c -c
small.c: In function 'fn4':
small.c:28:1: internal compiler error: Segmentation fault
}
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[regehr@dyson r49]$ cat small.c
int a, b, c, d, e, f, g, h;
void fn1 ();
int fn2 ();
int
fn3 (p1)
{
return a ? 0 : p1;
}
void
fn4 (char p1)
{
int i, j, k;
for (; e; e++)
if (fn2 ())
{
f = 1;
k = 0;
for (; k <= 1; k++)
{
j = ~p1;
i = f * j;
h = (fn3 (i | 0 <= c ^ 9L) != b | d) & 8;
g = p1 | 1;
fn1 ();
}
}
c = p1;
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/53411] [4.8 Regression] ICE in move_unallocated_pseudos
2012-05-18 22:03 [Bug c/53411] New: segfault regehr at cs dot utah.edu
@ 2012-05-20 20:04 ` pinskia at gcc dot gnu.org
2012-05-21 10:15 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-05-20 20:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53411
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Keywords| |ice-on-valid-code, ra
Last reconfirmed| |2012-05-20
Component|c |middle-end
Ever Confirmed|0 |1
Summary|segfault |[4.8 Regression] ICE in
| |move_unallocated_pseudos
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-05-20 19:26:39 UTC ---
Confirmed.
(gdb) p i
$1 = 144
(gdb) l
4004 for (i = first_moveable_pseudo; i < last_moveable_pseudo; i++)
4005 if (reg_renumber[i] < 0)
4006 {
4007 int idx = i - first_moveable_pseudo;
4008 rtx other_reg = VEC_index (rtx, pseudo_replaced_reg, idx);
4009 rtx def_insn = DF_REF_INSN (DF_REG_DEF_CHAIN (i));
144 does not exist in the IR as far as I can tell.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/53411] [4.8 Regression] ICE in move_unallocated_pseudos
2012-05-18 22:03 [Bug c/53411] New: segfault regehr at cs dot utah.edu
2012-05-20 20:04 ` [Bug middle-end/53411] [4.8 Regression] ICE in move_unallocated_pseudos pinskia at gcc dot gnu.org
@ 2012-05-21 10:15 ` jakub at gcc dot gnu.org
2012-05-21 17:48 ` bernds at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-05-21 10:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53411
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.8.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/53411] [4.8 Regression] ICE in move_unallocated_pseudos
2012-05-18 22:03 [Bug c/53411] New: segfault regehr at cs dot utah.edu
2012-05-20 20:04 ` [Bug middle-end/53411] [4.8 Regression] ICE in move_unallocated_pseudos pinskia at gcc dot gnu.org
2012-05-21 10:15 ` jakub at gcc dot gnu.org
@ 2012-05-21 17:48 ` bernds at gcc dot gnu.org
2012-05-21 17:49 ` hjl.tools at gmail dot com
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: bernds at gcc dot gnu.org @ 2012-05-21 17:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53411
--- Comment #3 from Bernd Schmidt <bernds at gcc dot gnu.org> 2012-05-21 16:52:06 UTC ---
Odd. The following is in 190r.asmcons:
(insn 39 51 141 3 (set (reg:DI 135 [ D.1745 ])
(sign_extend:DI (reg:SI 132 [ j ]))) regehr.c:22 122
{*extendsidi2_rex64}
(expr_list:REG_DEAD (reg:SI 132 [ j ])
(expr_list:REG_UNUSED (reg:DI 135 [ D.1745 ])
(nil))))
That insn has no purpose. We then run delete_trivially_dead_insns in IRA... but
it happens after find_moveable_pseudos, and probably needs to happen before as
well.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/53411] [4.8 Regression] ICE in move_unallocated_pseudos
2012-05-18 22:03 [Bug c/53411] New: segfault regehr at cs dot utah.edu
` (2 preceding siblings ...)
2012-05-21 17:48 ` bernds at gcc dot gnu.org
@ 2012-05-21 17:49 ` hjl.tools at gmail dot com
2012-05-25 19:18 ` bernds at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2012-05-21 17:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53411
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bernds at gcc dot gnu.org
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2012-05-21 16:24:58 UTC ---
It is caused by revision 186378:
http://gcc.gnu.org/ml/gcc-cvs/2012-04/msg00329.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/53411] [4.8 Regression] ICE in move_unallocated_pseudos
2012-05-18 22:03 [Bug c/53411] New: segfault regehr at cs dot utah.edu
` (3 preceding siblings ...)
2012-05-21 17:49 ` hjl.tools at gmail dot com
@ 2012-05-25 19:18 ` bernds at gcc dot gnu.org
2012-08-13 10:55 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: bernds at gcc dot gnu.org @ 2012-05-25 19:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53411
--- Comment #4 from Bernd Schmidt <bernds at gcc dot gnu.org> 2012-05-25 18:32:40 UTC ---
Looks like an earlier dce pass (during .ce2) leaves a dead insn lying around.
Bug in DCE?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/53411] [4.8 Regression] ICE in move_unallocated_pseudos
2012-05-18 22:03 [Bug c/53411] New: segfault regehr at cs dot utah.edu
` (4 preceding siblings ...)
2012-05-25 19:18 ` bernds at gcc dot gnu.org
@ 2012-08-13 10:55 ` jakub at gcc dot gnu.org
2012-08-13 11:07 ` bernds at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-08-13 10:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53411
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-08-13 10:55:39 UTC ---
If we want to rely on no dead insns before IRA, it would make no point calling
delete_trivially_dead_insns in it.
*** This bug has been marked as a duplicate of bug 53495 ***
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/53411] [4.8 Regression] ICE in move_unallocated_pseudos
2012-05-18 22:03 [Bug c/53411] New: segfault regehr at cs dot utah.edu
` (5 preceding siblings ...)
2012-08-13 10:55 ` jakub at gcc dot gnu.org
@ 2012-08-13 11:07 ` bernds at gcc dot gnu.org
2012-08-13 11:25 ` jakub at gcc dot gnu.org
2012-08-14 7:43 ` jakub at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: bernds at gcc dot gnu.org @ 2012-08-13 11:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53411
--- Comment #6 from Bernd Schmidt <bernds at gcc dot gnu.org> 2012-08-13 11:07:27 UTC ---
If the call to delete_trivially_dead_insns is supposed to eliminate only
pre-existing dead insns, then just moving it to the beginning of IRA fixes this
bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/53411] [4.8 Regression] ICE in move_unallocated_pseudos
2012-05-18 22:03 [Bug c/53411] New: segfault regehr at cs dot utah.edu
` (6 preceding siblings ...)
2012-08-13 11:07 ` bernds at gcc dot gnu.org
@ 2012-08-13 11:25 ` jakub at gcc dot gnu.org
2012-08-14 7:43 ` jakub at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-08-13 11:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53411
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vmakarov at gcc dot gnu.org
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-08-13 11:24:31 UTC ---
ira itself also removes something, e.g. in
rebuild_jump_labels (get_insns ());
if (purge_all_dead_edges ())
delete_unreachable_blocks ();
so I wouldn't move that
if (delete_trivially_dead_insns (get_insns (), max_reg_num ()))
df_analyze ();
too early in the function. But perhaps it could be moved before the
/* It is not worth to do such improvement when we use a simple
allocation because of -O0 usage or because the function is too
big. */
if (ira_conflicts_p)
find_moveable_pseudos ();
hunk. Vlad, what do you think? There is still ira_flattening that tweaks the
RTL in between, dunno if it could create trivially dead insns or not. Moving
d_t_d_i call before f_m_p call certainly fixes both of the testcases too,
haven't bootstrapped/regtested either of the patches yet.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/53411] [4.8 Regression] ICE in move_unallocated_pseudos
2012-05-18 22:03 [Bug c/53411] New: segfault regehr at cs dot utah.edu
` (7 preceding siblings ...)
2012-08-13 11:25 ` jakub at gcc dot gnu.org
@ 2012-08-14 7:43 ` jakub at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-08-14 7:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53411
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-08-14 07:43:14 UTC ---
Author: jakub
Date: Tue Aug 14 07:43:09 2012
New Revision: 190376
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190376
Log:
PR middle-end/53411
PR rtl-optimization/53495
* ira.c (ira): Move delete_trivially_dead_insns call before
find_moveable_pseudos call.
* gcc.c-torture/compile/pr53411.c: New test.
* gcc.c-torture/compile/pr53495.c: New test.
Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr53411.c
trunk/gcc/testsuite/gcc.c-torture/compile/pr53495.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ira.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-08-14 7:43 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-18 22:03 [Bug c/53411] New: segfault regehr at cs dot utah.edu
2012-05-20 20:04 ` [Bug middle-end/53411] [4.8 Regression] ICE in move_unallocated_pseudos pinskia at gcc dot gnu.org
2012-05-21 10:15 ` jakub at gcc dot gnu.org
2012-05-21 17:48 ` bernds at gcc dot gnu.org
2012-05-21 17:49 ` hjl.tools at gmail dot com
2012-05-25 19:18 ` bernds at gcc dot gnu.org
2012-08-13 10:55 ` jakub at gcc dot gnu.org
2012-08-13 11:07 ` bernds at gcc dot gnu.org
2012-08-13 11:25 ` jakub at gcc dot gnu.org
2012-08-14 7:43 ` jakub at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).