internal compiler error: in referenced_var_lookup, at tree-dfa.c
Jay K
jay.krell@cornell.edu
Fri Sep 10 11:11:00 GMT 2010
So..we have a custom frontend.
That uses process boundaries to avoid GPL crossing into BSDish licensed code.
So maybe you don't want to help me. Understood.
But just in case:
We generate trees. Probably they aren't of great quality.
e.g. relatively devoid of types and do field accesses by offseting pointers and casting.
We do our own layout earlier. Not great, but that's how it is.
Currently we use gcc 4.5.1.
When I enable inlining on some architectures, e.g. Macosx/x86, much code yields:
../FPrint.m3: In function 'FPrint__xCombine':
../FPrint.m3:25:0: internal compiler error: in referenced_var_lookup, at tree-dfa.c:525
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Now I've spent a while debugging this. I'm not completely lazy.
The original source (again, not a standard frontend):
PROCEDURE xCombine (): INTEGER =
BEGIN
RETURN xFix32 (0);
END xCombine;
PROCEDURE xFix32 (x: INTEGER): INTEGER =
CONST a = 1;
BEGIN
IF Word.And (x, a) = 0 THEN
RETURN 0;
END;
RETURN 0;
END xFix32;
-fdump-tree-all, 003t.original:
FPrint__xCombine ()
{
int_32 D.985;
int_32 M3_AcxOUs__result;
int_32 M3_AcxOUs__result;
int_32 D.985;
D.985 = FPrint__xFix32 (0);
<retval> = D.985;
return <retval>;
}
FPrint__xFix32 (int_32 M3_AcxOUs_x)
{
int_32 M3_AcxOUs__result;
int_32 M3_AcxOUs__result;
if ((M3_AcxOUs_x & 1) != 0)
{
goto <D.986>;
}
<retval> = 0;
return <retval>;
<D.986>:;
<retval> = 0;
return <retval>;
}
040t.release_ssa:
;; Function FPrint__xFix32 (FPrint__xFix32)
Released 0 names, 0.00%
FPrint__xFix32 (int_32 M3_AcxOUs_x)
{
int_32 D.987;
<bb 2>:
D.987_3 = M3_AcxOUs_x_2(D) & 1;
if (D.987_3 != 0)
goto <bb 4> (<L1>);
else
goto <bb 3>;
<bb 3>:
<retval>_4 = 0;
goto <bb 5>;
<L1>:
<retval>_5 = 0;
<bb 5>:
# <retval>_1 = PHI <<retval>_4(3), <retval>_5(4)>
return <retval>_1;
}
Breakpoint 1, 0x0078f21a in copy_phis_for_bb (bb=0x4126a280, id=0xbffff5d8) at ../../gcc-4.5/gcc/tree-inline.c:1937
1937 {
(gdb) n
1938 basic_block const new_bb = (basic_block) bb->aux;
(gdb)
1943 jaykrell_check_1(); doesn't do anything now, was helping debug
(gdb)
1945 for (si = gsi_start (phi_nodes (bb)); !gsi_end_p (si); gsi_next (&si))
(gdb)
1947 tree res = { 0 }, new_res = { 0 };
(gdb)
1948 gimple new_phi = { 0 };
(gdb)
1949 edge new_edge = { 0 };
(gdb)
1951 phi = gsi_stmt (si);
(gdb)
1952 res = PHI_RESULT (phi);
(gdb)
1953 new_res = res;
(gdb)
1954 if (is_gimple_reg (res))
(gdb)
1956 walk_tree (&new_res, copy_tree_body_r, id, NULL);
(gdb)
1957 new_phi = create_phi_node (new_res, new_bb); This line split up locally, ok.
(gdb)
1958 SSA_NAME_DEF_STMT (new_res) = new_phi;
(gdb) call debug_referenced_vars()
Referenced variables in FPrint__xCombine: 7
Variable: D.1036, UID D.1036, int_32gimple_default_def 0x412130a8 1036
Variable: D.1041, UID D.1041, int_32gimple_default_def 0x412130a8 1041
Variable: .MEM, UID D.1038, <unnamed type>, is global, call clobberedgimple_default_def 0x412130a8 1038
Variable: M3_AcxOUs_x, UID D.1039, int_32gimple_default_def 0x412130a8 1039
Variable: D.1040, UID D.1040, int_32gimple_default_def 0x412130a8 1040
Variable: <retval>, UID D.979, int_32gimple_default_def 0x412130a8 979
Variable: D.985, UID D.985, int_32gimple_default_def 0x412130a8 985
(gdb) n
1959 FOR_EACH_EDGE (new_edge, ei, new_bb->preds)
(gdb) call debug_referenced_vars()
Referenced variables in FPrint__xCombine: 7
Variable: D.1036, UID D.1036, int_32gimple_default_def 0x412130a8 1036
Variable: D.1041, UID D.1041, int_32gimple_default_def 0x412130a8 1041
Variable: .MEM, UID D.1038, <unnamed type>, is global, call clobberedgimple_default_def 0x412130a8 1038
Variable: M3_AcxOUs_x, UID D.1039, int_32gimple_default_def 0x412130a8 1039
Variable: D.1093058884, UID D.1093058884, int_32gimple_default_def 0x412130a8 1093058884
Variable: <retval>, UID D.979, int_32gimple_default_def 0x412130a8 979
Variable: D.985, UID D.985, int_32gimple_default_def 0x412130a8 985
You can see D.1040 got overwritten with something else.
And then later the assertion is that it is missing.
Is it valid for uids to be so high?
Any clues/tips?
Thanks much,
- Jay
More information about the Gcc
mailing list