public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/18270] New: internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146
@ 2004-11-02 7:33 lucier at math dot purdue dot edu
2004-11-02 13:35 ` [Bug middle-end/18270] [4.0 Regression] " pinskia at gcc dot gnu dot org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: lucier at math dot purdue dot edu @ 2004-11-02 7:33 UTC (permalink / raw)
To: gcc-bugs
[descartes:~/programs/gambc40b11/lib] lucier% gcc -I../include -I.
-no-cpp-precomp -Wall -W -Wno-unused -O1 -fno-math-errno -fschedule-insns2
-fno-trapping-math -fno-strict-aliasing -fomit-frame-pointer -fPIC -fno-common
-DHAVE_CONFIG_H -D___PRIMAL -D___LIBRARY -D___GAMBCDIR=\"/usr/local/Gambit-C\"
-c _kernel.c -save-temps
gcc: unrecognized option `-no-cpp-precomp'
In file included from os.h:185,
from _kernel.c:1557:
/usr/include/dlfcn.h:35:2: warning: #warning "You are using dlopen(), a legacy
API. Please use the Mach-O dylib loading APIs if at all possible"
_kernel.c: In function '___H__20___kernel':
_kernel.c:1584: internal compiler error: in tree_redirect_edge_and_branch, at
tree-cfg.c:4146
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
[descartes:~/programs/gambc40b11/lib] lucier% gcc -v
Reading specs from /pkgs/gcc-mainline/lib/gcc/powerpc-apple-darwin7.5.0/4.0.0/specs
Configured with: ../configure --prefix=/pkgs/gcc-mainline
--with-gmp=/pkgs/gmp-4.1.3 --with-mpfr=/pkgs/gmp-4.1.3
Thread model: posix
gcc version 4.0.0 20041102 (experimental)
The preprocessed input file is at
http://www.math.purdue.edu/~lucier/GNATS/GNATS-14/_kernel.i.gz
--
Summary: internal compiler error: in
tree_redirect_edge_and_branch, at tree-cfg.c:4146
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lucier at math dot purdue dot edu
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: powerpc-apple-darwin7.5.0
GCC host triplet: powerpc-apple-darwin7.5.0
GCC target triplet: powerpc-apple-darwin7.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18270
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/18270] [4.0 Regression] internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146
2004-11-02 7:33 [Bug middle-end/18270] New: internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146 lucier at math dot purdue dot edu
@ 2004-11-02 13:35 ` pinskia at gcc dot gnu dot org
2004-11-02 13:48 ` [Bug rtl-optimization/18270] " reichelt at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-02 13:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-02 13:35 -------
I think it was caused by:
2004-11-01 Andrew MacLeod <amacleod@redhat.com>
PR tree-optimization/16447
* tree-cfg.c (bsi_commit_one_edge_insert): Rename from
bsi_commit_edge_inserts_1, and make funtion external. Return new block.
(bsi_commit_edge_inserts): Use renamed bsi_commit_one_edge_insert.
* tree-optimize.c (pass_cleanup_cfg_post_optimizing): Enable listing.
* tree-flow.h (bsi_commit_one_edge_insert): Extern decl.
* tree-outof-ssa.c (rewrite_trees): Don't commit edges here.
(same_stmt_list_p): New. Return TRUE if edge is to be forwarded.
(identical_copies_p): New. Return true is two copies are the same.
(identical_stmt_lists_p): New. Return true if stmt lists are the same.
(analyze_edges_for_bb): New. Determine how best to insert edge stmts
for a basic block.
(perform_edge_inserts): New. Determine what to do with all stmts that
have been inserted on edges.
(remove_ssa_form): Analyze and commit edges from here.
Aka I cannot reproduce it with a tree right before but I can right after (well really two patches after but
that other patch is a removal of unused code).
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |amacleod at redhat dot com
Keywords| |ice-on-valid-code
Summary|internal compiler error: in |[4.0 Regression] internal
|tree_redirect_edge_and_branc|compiler error: in
|h, at tree-cfg.c:4146 |tree_redirect_edge_and_branc
| |h, at tree-cfg.c:4146
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18270
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug rtl-optimization/18270] [4.0 Regression] internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146
2004-11-02 7:33 [Bug middle-end/18270] New: internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146 lucier at math dot purdue dot edu
2004-11-02 13:35 ` [Bug middle-end/18270] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2004-11-02 13:48 ` reichelt at gcc dot gnu dot org
2004-11-02 14:01 ` [Bug tree-optimization/18270] " pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-11-02 13:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-11-02 13:48 -------
Confirmed. Reduced testcase:
=====================================
struct A
{
int *p;
int i;
};
void foo(struct A* a)
{
int *q, j=0;
static void *L[]={ &&L1 };
goto *q;
L0:
*q=j;
j=1;
if(q<a->p) a->i=0;
if(q<a->p) a->i=0;
L1:
*q=0;
goto L0;
}
=====================================
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Component|middle-end |rtl-optimization
Ever Confirmed| |1
GCC build triplet|powerpc-apple-darwin7.5.0 |
GCC host triplet|powerpc-apple-darwin7.5.0 |
GCC target triplet|powerpc-apple-darwin7.5.0 |
Keywords| |monitored
Last reconfirmed|0000-00-00 00:00:00 |2004-11-02 13:48:30
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18270
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/18270] [4.0 Regression] internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146
2004-11-02 7:33 [Bug middle-end/18270] New: internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146 lucier at math dot purdue dot edu
2004-11-02 13:35 ` [Bug middle-end/18270] [4.0 Regression] " pinskia at gcc dot gnu dot org
2004-11-02 13:48 ` [Bug rtl-optimization/18270] " reichelt at gcc dot gnu dot org
@ 2004-11-02 14:01 ` pinskia at gcc dot gnu dot org
2004-11-02 14:12 ` reichelt at gcc dot gnu dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-02 14:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-02 14:01 -------
Just look at the tree dump before going out of SSA.
;; Function foo (foo)
foo (aD.1115)
{
voidD.30 * gotovar.0D.1135;
voidD.30 L0L.0 = <<< error >>>;
voidD.30 L1L.5 = <<< error >>>;
static voidD.30 * LD.1120[1] = {&L1L.5};
intD.0 jD.1119;
intD.0 * qD.1118;
intD.0 * D.1123;
# BLOCK 0
# PRED: ENTRY [100.0%] (fallthru,exec)
jD.1119_2 = 0;
gotovar.0D.1135_4 = qD.1118_3;
goto gotovar.0D.1135_4;
# SUCC: 4 [100.0%] (ab,exec)
# BLOCK 1
# PRED: 4 [100.0%] (fallthru,irreducible,exec)
L0L.0:;
# TMT.1D.1137_13 = V_MAY_DEF <TMT.1D.1137_12>;
*qD.1118_3 = jD.1119_1;
# VUSE <TMT.1D.1137_13>;
D.1123_7 = aD.1115_6->pD.1113;
if (qD.1118_3 < D.1123_7) goto <L1>; else goto L1L.5;
# SUCC: 2 [50.0%] (irreducible,true,exec) 4 [50.0%] (irreducible,false,exec)
# BLOCK 2
# PRED: 1 [50.0%] (irreducible,true,exec)
<L1>:;
# TMT.1D.1137_15 = V_MAY_DEF <TMT.1D.1137_13>;
aD.1115_6->iD.1114 = 0;
# VUSE <TMT.1D.1137_15>;
D.1123_19 = aD.1115_6->pD.1113;
if (qD.1118_3 < D.1123_19) goto <L3>; else goto L1L.5;
# SUCC: 3 [50.0%] (irreducible,true,exec) 4 [50.0%] (irreducible,false,exec)
# BLOCK 3
# PRED: 2 [50.0%] (irreducible,true,exec)
<L3>:;
# TMT.1D.1137_14 = V_MAY_DEF <TMT.1D.1137_15>;
aD.1115_6->iD.1114 = 0;
# SUCC: 4 [100.0%] (fallthru,dfs_back,irreducible,exec)
# BLOCK 4
# PRED: 0 [100.0%] (ab,exec) 2 [50.0%] (irreducible,false,exec) 3 [100.0%]
(fallthru,dfs_back,irreducible,exec) 1 [50.0%] (irreducible,false,exec)
Invalid sum of incoming frequencies 20000, should be 10000
# TMT.1D.1137_10 = PHI <TMT.1D.1137_11(0), TMT.1D.1137_13(1), TMT.1D.1137_15(2),
TMT.1D.1137_14(3)>;
# jD.1119_1 = PHI <jD.1119_2(0), 1(2), 1(3), 1(1)>; <-- this, we are trying to make a new block for
j_2 and then try to redirect the abornal branch to it
L1L.5:;
# TMT.1D.1137_12 = V_MAY_DEF <TMT.1D.1137_10>;
*qD.1118_3 = 0;
goto <bb 1> (L0);
# SUCC: 1 [100.0%] (fallthru,irreducible,exec)
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18270
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/18270] [4.0 Regression] internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146
2004-11-02 7:33 [Bug middle-end/18270] New: internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146 lucier at math dot purdue dot edu
` (2 preceding siblings ...)
2004-11-02 14:01 ` [Bug tree-optimization/18270] " pinskia at gcc dot gnu dot org
@ 2004-11-02 14:12 ` reichelt at gcc dot gnu dot org
2004-11-02 14:24 ` amacleod at redhat dot com
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-11-02 14:12 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-11-02 14:12 -------
Even shorter testcase:
================================
void foo()
{
void **p;
int *q, i=0;
static void *L[]={ &&L1 };
goto **p;
L0:
*q=i;
i=1;
if (q<*p) *q=0;
if (q<*p) *q=0;
L1:
*q=0;
goto L0;
}
================================
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18270
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/18270] [4.0 Regression] internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146
2004-11-02 7:33 [Bug middle-end/18270] New: internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146 lucier at math dot purdue dot edu
` (3 preceding siblings ...)
2004-11-02 14:12 ` reichelt at gcc dot gnu dot org
@ 2004-11-02 14:24 ` amacleod at redhat dot com
2004-11-02 21:04 ` amacleod at redhat dot com
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: amacleod at redhat dot com @ 2004-11-02 14:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From amacleod at redhat dot com 2004-11-02 14:23 -------
Is there a rule for make_forwarder_block that says it cannot forward a block
which has *any* abnormal edges?
The code is attempting to make a forwarder block for block 5 for the 3
non-abnormal edges (1,2,3). They are all going to get the same code, so want a
common place to put it.
It would seem the make_forwarder_block simply leaves the existing labels at the
top of the new block, adds an edge from the new block to the old block, and
redirects all edges which are not being forwarded to the old block.
I can see that failing, because now the abnormal edge needs to be redirected to
the old block, when in fact Im not asking for it to be touched.
Is there a reason it doesnt leave all the old labels in the old block, add a new
label to the top of the new block, and redirect all the requested edges to this
new label?.
If it must remain as is, then presumably we will have to punt on commoning any
code on normal edges into a block which also happens to have at least one
abnormal edge, even though we aren't doing anything with that edge.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |rakdver at atrey dot karlin
| |dot mff dot cuni dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18270
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/18270] [4.0 Regression] internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146
2004-11-02 7:33 [Bug middle-end/18270] New: internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146 lucier at math dot purdue dot edu
` (4 preceding siblings ...)
2004-11-02 14:24 ` amacleod at redhat dot com
@ 2004-11-02 21:04 ` amacleod at redhat dot com
2004-11-02 21:23 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: amacleod at redhat dot com @ 2004-11-02 21:04 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From amacleod at redhat dot com 2004-11-02 21:04 -------
whups. That new patch was bootstrapped and tested for no new regressions on
i686-pc-linux-gnu
presumably its OK for mainline? I may rework this for 4.1 to not use
make_forwarder_block() after all, since this seems like a poor restriction, but
too much work for stage3 mainline.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |mark at codesourcery dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18270
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/18270] [4.0 Regression] internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146
2004-11-02 7:33 [Bug middle-end/18270] New: internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146 lucier at math dot purdue dot edu
` (5 preceding siblings ...)
2004-11-02 21:04 ` amacleod at redhat dot com
@ 2004-11-02 21:23 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
2004-11-03 18:56 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rakdver at atrey dot karlin dot mff dot cuni dot cz @ 2004-11-02 21:23 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rakdver at atrey dot karlin dot mff dot cuni dot cz 2004-11-02 21:23 -------
Subject: Re: [4.0 Regression] internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146
Hello,
> Is there a rule for make_forwarder_block that says it cannot forward a block
> which has *any* abnormal edges?
no. Just that all the abnormal edges must go to the created forwarder
block.
> Is there a reason it doesnt leave all the old labels in the old block, add a new
> label to the top of the new block, and redirect all the requested edges to this
> new label?.
Yes. Since we cannot redirect abnormal edges, I had to choose one of
the two possible behaviors -- either having all abnormal edges to point
to the forwarder block, or having all abnormal edges to point to the
other basic block. I chose the former, since it was easier to write
(it just calls split_block, then redirects the edge(s)). Also it is
more sane choice for the original purpose of the function (to create
preheaders for loops) -- you then have to redirect only one edge (latch)
instead of possibly multiple entry edges.
But in fact I do not really care; if you need to rewrite the function
so that it works in the other way, I think no code of mine should have
a problem with this. The other alternative is adding a flag to
make_forwarder_block that would let you choose which way you prefer.
Zdenek
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18270
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/18270] [4.0 Regression] internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146
2004-11-02 7:33 [Bug middle-end/18270] New: internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146 lucier at math dot purdue dot edu
` (6 preceding siblings ...)
2004-11-02 21:23 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
@ 2004-11-03 18:56 ` cvs-commit at gcc dot gnu dot org
2004-11-03 19:28 ` pinskia at gcc dot gnu dot org
2004-11-03 21:31 ` lucier at math dot purdue dot edu
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-11-03 18:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-11-03 18:56 -------
Subject: Bug 18270
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: amacleod@gcc.gnu.org 2004-11-03 18:56:36
Modified files:
gcc : ChangeLog tree-outof-ssa.c
Log message:
2004-11-03 Andrew MacLeod <amacleod@redhat.com>
PR tree-optimization/18270
* tree-outof-ssa.c (analyze_edges_for_bb): If a block has any incoming
abnormal edges, simply commit any pending stmts on all incoming edges.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6150&r2=2.6151
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-outof-ssa.c.diff?cvsroot=gcc&r1=2.28&r2=2.29
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18270
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/18270] [4.0 Regression] internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146
2004-11-02 7:33 [Bug middle-end/18270] New: internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146 lucier at math dot purdue dot edu
` (7 preceding siblings ...)
2004-11-03 18:56 ` cvs-commit at gcc dot gnu dot org
@ 2004-11-03 19:28 ` pinskia at gcc dot gnu dot org
2004-11-03 21:31 ` lucier at math dot purdue dot edu
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-03 19:28 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-03 19:28 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18270
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/18270] [4.0 Regression] internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146
2004-11-02 7:33 [Bug middle-end/18270] New: internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146 lucier at math dot purdue dot edu
` (8 preceding siblings ...)
2004-11-03 19:28 ` pinskia at gcc dot gnu dot org
@ 2004-11-03 21:31 ` lucier at math dot purdue dot edu
9 siblings, 0 replies; 11+ messages in thread
From: lucier at math dot purdue dot edu @ 2004-11-03 21:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From lucier at math dot purdue dot edu 2004-11-03 21:31 -------
Subject: Re: [4.0 Regression] internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146
Was a new test case added with this patch?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18270
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2004-11-03 21:31 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-02 7:33 [Bug middle-end/18270] New: internal compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4146 lucier at math dot purdue dot edu
2004-11-02 13:35 ` [Bug middle-end/18270] [4.0 Regression] " pinskia at gcc dot gnu dot org
2004-11-02 13:48 ` [Bug rtl-optimization/18270] " reichelt at gcc dot gnu dot org
2004-11-02 14:01 ` [Bug tree-optimization/18270] " pinskia at gcc dot gnu dot org
2004-11-02 14:12 ` reichelt at gcc dot gnu dot org
2004-11-02 14:24 ` amacleod at redhat dot com
2004-11-02 21:04 ` amacleod at redhat dot com
2004-11-02 21:23 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
2004-11-03 18:56 ` cvs-commit at gcc dot gnu dot org
2004-11-03 19:28 ` pinskia at gcc dot gnu dot org
2004-11-03 21:31 ` lucier at math dot purdue dot edu
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).