Incompatible sizes on AMD64
Juliusz Chroboczek
Juliusz.Chroboczek at pps.jussieu.fr
Fri Jan 6 10:09:25 EST 2006
Dear Simon, dear Ian, dear all,
When compiling Darcs on AMD64, I get a worrying sounding warning about
incompatible datasizes from the C compiler. I've reduced the Darcs
code to what I believe is a minimal example (at any rate, removing a
single clause anywhere makes the warning go away).
Compiling the attached gives
$ ghc -c -O -keep-hc-files Bug.hs
Bug.hc: In function ¡Æs2iP_ret¡Ç:
Bug.hc:400: warning: cast to pointer from integer of different size
Compiling with ``-fvia-c'' instead of ``-O'' does not yield the
warning. This is GHC 6.4.1, as provided in Ian's 6.4.1-1 Debian
package.
I'm attaching the Haskell source and the ``.hc'' file. Let me know if
you need further testing, or if you want me to try with a newer
version of GHC (in which case a pointer to bootstrapping instructions
would be welcome).
Thanks,
Juliusz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bug.hs
Type: text/x-haskell
Size: 446 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/glasgow-haskell-bugs/attachments/20060106/b7a5deda/Bug.bin
-------------- next part --------------
/* GHC_PACKAGES base-1.0 rts-1.0
*/
#include "Stg.h"
#include "HsBase.h"
EI_(Bug_zdwzn_info);
StgWord Bug_zdwzn_closure[] = {
(W_)&Bug_zdwzn_info
};
IF_(s2ge_entry);
IF_(s2ge_slow) {
FB_
Sp=Sp+0;
JMP_((W_)&s2ge_entry);
FE_
}
IF_(s2hy_0_alt);
IF_(s2hy_1_alt);
static StgWord s2hy_info[] = {
0x0, 0x41UL, 0x25UL, 0x0, (W_)&s2hy_0_alt, (W_)&s2hy_1_alt
};
EI_(GHCziWord_W8zh_con_info);
IF_(s2hy_0_alt) {
FB_
Hp=Hp+2;
if ((W_)Hp > (W_)HpLim) goto _c2i4;
Hp[-1] = (W_)&GHCziWord_W8zh_con_info;
*Hp = Sp[1];
Sp[1] = (W_)Hp-8;
Sp=Sp+1;
JMP_(*((P_)(Sp[1])));
_c2i4:
HpAlloc = 0x10UL;
JMP_(stg_gc_enter_1);
FE_
}
EI_(GHCziWord_W8zh_con_info);
IF_(s2hy_1_alt) {
FB_
Hp=Hp+2;
if ((W_)Hp > (W_)HpLim) goto _c2i8;
Hp[-1] = (W_)&GHCziWord_W8zh_con_info;
*Hp = Sp[1];
Sp[1] = (W_)Hp-8;
Sp=Sp+1;
JMP_(*((P_)(Sp[1])));
_c2i8:
HpAlloc = 0x10UL;
JMP_(stg_gc_enter_1);
FE_
}
IF_(s2hw_ret);
static StgWord s2hw_info[] = {
(W_)&s2hw_ret, 0x6c5UL, 0x24UL
};
II_(s2hy_info);
IF_(s2hw_ret) {
W_ _s2fD;
W_ _s2fQ;
FB_
_s2fD = (Sp[5]) + (R1.p[1]);
_s2fQ = (W_)((*((StgWord8*)(((Sp[1]) + 0x0) + (_s2fD << 0x0)))));
Sp[5] = _s2fQ;
R1.p = (P_)(Sp[3]);
Sp[4] = (W_)&s2hy_info;
Sp=Sp+4;
JMP_(*((P_)(*R1.p)));
FE_
}
IF_(s2hv_ret);
static StgWord s2hv_info[] = {
(W_)&s2hv_ret, 0x4c5UL, 0x24UL
};
II_(s2hw_info);
IF_(s2hv_ret) {
FB_
Sp[5] = R1.p[1];
R1.p = (P_)(Sp[4]);
*Sp = (W_)&s2hw_info;
JMP_(*((P_)(*R1.p)));
FE_
}
IF_(s2g1_ret);
static StgWord s2g1_info[] = {
(W_)&s2g1_ret, 0x3UL, 0x24UL
};
II_(s2hv_info);
IF_(s2g1_ret) {
FB_
R1.p = (P_)(Sp[4]);
Sp[-1] = (W_)&s2hv_info;
Sp=Sp-1;
JMP_(*((P_)(*R1.p)));
FE_
}
IF_(s2hB_0_alt);
IF_(s2hB_1_alt);
static StgWord s2hB_info[] = {
0x0, 0x3UL, 0x25UL, 0x0, (W_)&s2hB_0_alt, (W_)&s2hB_1_alt
};
IF_(s2g1_ret);
IF_(s2hB_0_alt) {
W_ _s2g7;
FB_
_s2g7 = *((P_)((R1.p[1]) + 0x8UL));
Sp[-1] = _s2g7;
Sp=Sp-1;
JMP_((W_)&s2g1_ret);
FE_
}
IF_(s2g1_ret);
IF_(s2hB_1_alt) {
W_ _s2gc;
FB_
_s2gc = (R1.p[1]) + 0x10UL;
Sp[-1] = _s2gc;
Sp=Sp-1;
JMP_((W_)&s2g1_ret);
FE_
}
IF_(s2ge_entry);
IF_(s2ge_slow);
static StgWord s2ge_info[] = {
(W_)&s2ge_entry, 0x3UL, 0xbUL, 0x100000000UL, 0x0, 0x0, (W_)&s2ge_slow
};
II_(s2hB_info);
IF_(s2ge_entry) {
FB_
if (((W_)Sp - 0x30UL) < (W_)SpLim) goto _c2ia;
Sp[-1] = R1.p[1];
Sp[-2] = R1.p[2];
Sp[-3] = R1.p[3];
R1.p = (P_)(R1.p[3]);
Sp[-4] = (W_)&s2hB_info;
Sp=Sp-4;
JMP_(*((P_)(*R1.p)));
_c2ia:
Sp=Sp+0;
JMP_(stg_gc_fun);
FE_
}
EF_(Bug_zdwzn_entry);
StgWord Bug_zdwzn_info[] = {
(W_)&Bug_zdwzn_entry, 0x0, 0x11UL, 0x300000013UL
};
EF_(GHCziIOBase_unsafePerformIO_entry);
EI_(Bug_zdwzn_closure);
II_(s2ge_info);
FN_(Bug_zdwzn_entry) {
FB_
Hp=Hp+4;
if ((W_)Hp > (W_)HpLim) goto _c2ic;
Hp[-3] = (W_)&s2ge_info;
Hp[-2] = Sp[1];
Hp[-1] = Sp[2];
*Hp = *Sp;
Sp[2] = (W_)Hp-24;
Sp=Sp+2;
JMP_((W_)&GHCziIOBase_unsafePerformIO_entry);
_c2ic:
HpAlloc = 0x20UL;
R1.p = (P_)(W_)&Bug_zdwzn_closure;
JMP_(stg_gc_fun);
FE_
}
II_(r2fh_info);
static StgWord r2fh_closure[] = {
(W_)&r2fh_info, 0x0, 0x0, 0x0
};
static char c2ih_str[] = "Negative index in indexPS";
IF_(r2fh_entry);
static StgWord r2fh_info[] = {
(W_)&r2fh_entry, 0x200000000UL, 0x18UL
};
EF_(GHCziBase_unpackCStringzh_entry);
IF_(r2fh_entry) {
FB_
if (((W_)Sp - 0x18UL) < (W_)SpLim) goto _c2ij;
Hp=Hp+3;
if ((W_)Hp > (W_)HpLim) goto _c2ij;
Hp[-2] = (W_)&stg_CAF_BLACKHOLE_info;
CALLER_SAVE_R1
CALLER_SAVE_SYSTEM
newCAF((void *)(W_)R1.w);
CALLER_RESTORE_SYSTEM
CALLER_RESTORE_R1
R1.p[1] = (W_)Hp-16;
*R1.p = (W_)&stg_IND_STATIC_info;
Sp[-2] = (W_)&stg_upd_frame_info;
Sp[-1] = (W_)Hp-16;
Sp[-3] = (W_)&c2ih_str;
Sp=Sp-3;
JMP_((W_)&GHCziBase_unpackCStringzh_entry);
_c2ij:
HpAlloc = 0x18UL;
JMP_(stg_gc_enter_1);
FE_
}
EI_(GHCziErr_error_closure);
II_(r2fh_closure);
StgWord Bug_lvl1_srt[] = {
(W_)&GHCziErr_error_closure, (W_)&r2fh_closure
};
EI_(Bug_lvl1_info);
StgWord Bug_lvl1_closure[] = {
(W_)&Bug_lvl1_info, 0x0, 0x0, 0x0
};
EF_(Bug_lvl1_entry);
StgWord Bug_lvl1_info[] = {
(W_)&Bug_lvl1_entry, 0x200000000UL, 0x300000018UL, (W_)&Bug_lvl1_srt
};
EI_(GHCziErr_error_closure);
II_(r2fh_closure);
FN_(Bug_lvl1_entry) {
FB_
if (((W_)Sp - 0x20UL) < (W_)SpLim) goto _c2io;
Hp=Hp+3;
if ((W_)Hp > (W_)HpLim) goto _c2io;
Hp[-2] = (W_)&stg_CAF_BLACKHOLE_info;
CALLER_SAVE_R1
CALLER_SAVE_SYSTEM
newCAF((void *)(W_)R1.w);
CALLER_RESTORE_SYSTEM
CALLER_RESTORE_R1
R1.p[1] = (W_)Hp-16;
*R1.p = (W_)&stg_IND_STATIC_info;
Sp[-2] = (W_)&stg_upd_frame_info;
Sp[-1] = (W_)Hp-16;
Sp[-3] = (W_)&r2fh_closure;
R1.p = (P_)(W_)&GHCziErr_error_closure;
Sp=Sp-4;
JMP_((W_)&stg_ap_p_ret);
_c2io:
HpAlloc = 0x18UL;
JMP_(stg_gc_enter_1);
FE_
}
EI_(GHCziBase_lvl7_closure);
StgWord Bug_w2c_srt[] = {
(W_)&GHCziBase_lvl7_closure
};
EI_(Bug_w2c_info);
StgWord Bug_w2c_closure[] = {
(W_)&Bug_w2c_info, 0x0
};
IF_(s2ip_ret);
static StgWord s2ip_info[] = {
(W_)&s2ip_ret, 0x0, 0x100000024UL, (W_)&Bug_w2c_srt
};
EI_(GHCziBase_Czh_con_info);
EI_(GHCziBase_lvl7_closure);
IF_(s2ip_ret) {
W_ _c2iA;
W_ _s2gp;
W_ _s2gr;
FB_
Hp=Hp+2;
if ((W_)Hp > (W_)HpLim) goto _c2iC;
_c2iA = (R1.p[1]) <= 0x10ffffUL;
if (_c2iA >= 0x1UL) goto _c2iF;
R1.p = (P_)(W_)&GHCziBase_lvl7_closure;
Sp=Sp+1;
Hp=Hp-2;
JMP_(*((P_)(*R1.p)));
_c2iC:
HpAlloc = 0x10UL;
JMP_(stg_gc_enter_1);
_c2iF:
_s2gp = R1.p[1];
_s2gr = (StgWord32)(_s2gp);
Hp[-1] = (W_)&GHCziBase_Czh_con_info;
*Hp = _s2gr;
R1.p=Hp-1;
Sp=Sp+1;
JMP_(*((P_)(*Sp)));
FE_
}
EF_(Bug_w2c_entry);
StgWord Bug_w2c_info[] = {
(W_)&Bug_w2c_entry, 0x0, 0x100000011UL, 0x100000004UL, (W_)&Bug_w2c_srt
};
II_(s2ip_info);
FN_(Bug_w2c_entry) {
FB_
R1.p = (P_)(*Sp);
*Sp = (W_)&s2ip_info;
JMP_(*((P_)(*R1.p)));
FE_
}
EI_(Bug_zn_info);
StgWord Bug_zn_closure[] = {
(W_)&Bug_zn_info
};
IF_(s2iG_ret);
static StgWord s2iG_info[] = {
(W_)&s2iG_ret, 0x1UL, 0x24UL
};
EF_(Bug_zdwzn_entry);
IF_(s2iG_ret) {
FB_
*Sp = R1.p[2];
Sp[-1] = R1.p[1];
Sp=Sp-1;
JMP_((W_)&Bug_zdwzn_entry);
FE_
}
EF_(Bug_zn_entry);
StgWord Bug_zn_info[] = {
(W_)&Bug_zn_entry, 0x0, 0x11UL, 0x20000000bUL
};
EI_(Bug_zn_closure);
II_(s2iG_info);
FN_(Bug_zn_entry) {
FB_
if (((W_)Sp - 0x8UL) < (W_)SpLim) goto _c2iN;
R1.p = (P_)(*Sp);
*Sp = (W_)&s2iG_info;
JMP_(*((P_)(*R1.p)));
_c2iN:
R1.p = (P_)(W_)&Bug_zn_closure;
JMP_(stg_gc_fun);
FE_
}
EI_(GHCziBase_lvl7_closure);
EI_(Bug_lvl1_closure);
StgWord Bug_zdwindexPS_srt[] = {
(W_)&GHCziBase_lvl7_closure, (W_)&Bug_lvl1_closure
};
EI_(Bug_zdwindexPS_info);
StgWord Bug_zdwindexPS_closure[] = {
(W_)&Bug_zdwindexPS_info, 0x0
};
IF_(s2iP_ret);
static StgWord s2iP_info[] = {
(W_)&s2iP_ret, 0x0, 0x100000024UL, (W_)&Bug_zdwindexPS_srt
};
EI_(GHCziBase_lvl7_closure);
IF_(s2iP_ret) {
W_ _c2j7;
W_ _s2gU;
FB_
_c2j7 = (R1.p[1]) <= 0x10ffffUL;
if (_c2j7 >= 0x1UL) goto _c2ja;
R1.p = (P_)(W_)&GHCziBase_lvl7_closure;
Sp=Sp+1;
JMP_(*((P_)(*R1.p)));
_c2ja:
_s2gU = R1.p[1];
R1.p = (P_)((StgWord32)(_s2gU));
Sp=Sp+1;
JMP_(*((P_)(*Sp)));
FE_
}
IF_(s2gO_ret);
static StgWord s2gO_info[] = {
(W_)&s2gO_ret, 0x103UL, 0x300000024UL, (W_)&Bug_zdwindexPS_srt
};
EF_(Bug_zdwzn_entry);
EI_(Bug_lvl1_closure);
II_(s2iP_info);
IF_(s2gO_ret) {
W_ _c2jb;
FB_
_c2jb = (I_)(R1.p[1]) < (I_)0x0;
if (_c2jb >= 0x1UL) goto _c2jd;
*Sp = Sp[1];
Sp[1] = Sp[2];
Sp[2] = (W_)R1.w;
Sp[3] = (W_)&s2iP_info;
JMP_((W_)&Bug_zdwzn_entry);
_c2jd:
R1.p = (P_)(W_)&Bug_lvl1_closure;
Sp=Sp+4;
JMP_(*((P_)(*R1.p)));
FE_
}
EF_(Bug_zdwindexPS_entry);
StgWord Bug_zdwindexPS_info[] = {
(W_)&Bug_zdwindexPS_entry, 0x0, 0x300000011UL, 0x300000013UL, (W_)&Bug_zdwindexPS_srt
};
EI_(Bug_zdwindexPS_closure);
II_(s2gO_info);
FN_(Bug_zdwindexPS_entry) {
FB_
if (((W_)Sp - 0x8UL) < (W_)SpLim) goto _c2jf;
R1.p = (P_)(Sp[2]);
Sp[-1] = (W_)&s2gO_info;
Sp=Sp-1;
JMP_(*((P_)(*R1.p)));
_c2jf:
R1.p = (P_)(W_)&Bug_zdwindexPS_closure;
JMP_(stg_gc_fun);
FE_
}
EI_(Bug_zdwindexPS_closure);
StgWord Bug_indexPS_srt[] = {
(W_)&Bug_zdwindexPS_closure
};
EI_(Bug_indexPS_info);
StgWord Bug_indexPS_closure[] = {
(W_)&Bug_indexPS_info, 0x0
};
IF_(s2h7_ret);
static StgWord s2h7_info[] = {
(W_)&s2h7_ret, 0x0, 0x24UL
};
EI_(GHCziBase_Czh_con_info);
IF_(s2h7_ret) {
FB_
Hp=Hp+2;
if ((W_)Hp > (W_)HpLim) goto _c2jw;
Hp[-1] = (W_)&GHCziBase_Czh_con_info;
*Hp = (W_)R1.w;
R1.p=Hp-1;
Sp=Sp+1;
JMP_(*((P_)(*Sp)));
_c2jw:
HpAlloc = 0x10UL;
JMP_((W_)&stg_gc_unbx_r1);
FE_
}
IF_(s2jg_ret);
static StgWord s2jg_info[] = {
(W_)&s2jg_ret, 0x1UL, 0x100000024UL, (W_)&Bug_indexPS_srt
};
EF_(Bug_zdwindexPS_entry);
II_(s2h7_info);
IF_(s2jg_ret) {
FB_
*Sp = Sp[1];
Sp[-1] = R1.p[2];
Sp[-2] = R1.p[1];
Sp[1] = (W_)&s2h7_info;
Sp=Sp-2;
JMP_((W_)&Bug_zdwindexPS_entry);
FE_
}
EF_(Bug_indexPS_entry);
StgWord Bug_indexPS_info[] = {
(W_)&Bug_indexPS_entry, 0x0, 0x100000011UL, 0x20000000bUL, (W_)&Bug_indexPS_srt
};
EI_(Bug_indexPS_closure);
II_(s2jg_info);
FN_(Bug_indexPS_entry) {
FB_
if (((W_)Sp - 0x10UL) < (W_)SpLim) goto _c2jy;
R1.p = (P_)(*Sp);
*Sp = (W_)&s2jg_info;
JMP_(*((P_)(*R1.p)));
_c2jy:
R1.p = (P_)(W_)&Bug_indexPS_closure;
JMP_(stg_gc_fun);
FE_
}
EI_(Bug_zdWPS_info);
StgWord Bug_zdWPS_closure[] = {
(W_)&Bug_zdWPS_info
};
IF_(s2hk_ret);
static StgWord s2hk_info[] = {
(W_)&s2hk_ret, 0x2UL, 0x24UL
};
EI_(Bug_PS_con_info);
IF_(s2hk_ret) {
FB_
Hp=Hp+4;
if ((W_)Hp > (W_)HpLim) goto _c2jQ;
Hp[-3] = (W_)&Bug_PS_con_info;
Hp[-2] = Sp[1];
Hp[-1] = Sp[2];
*Hp = (W_)R1.w;
R1.p=Hp-3;
Sp=Sp+3;
JMP_(*((P_)(*Sp)));
_c2jQ:
HpAlloc = 0x20UL;
JMP_(stg_gc_enter_1);
FE_
}
IF_(s2hj_ret);
static StgWord s2hj_info[] = {
(W_)&s2hj_ret, 0x2UL, 0x24UL
};
II_(s2hk_info);
IF_(s2hj_ret) {
W_ _c2jT;
FB_
_c2jT = Sp[2];
Sp[2] = (W_)R1.w;
R1.p = (P_)_c2jT;
*Sp = (W_)&s2hk_info;
JMP_(*((P_)(*R1.p)));
FE_
}
IF_(s2hi_dflt);
static StgWord s2hi_info[] = {
0x0, 0x2UL, 0x25UL, 0x0, (W_)&s2hi_dflt, (W_)&s2hi_dflt
};
II_(s2hj_info);
IF_(s2hi_dflt) {
W_ _c2jW;
FB_
_c2jW = Sp[1];
Sp[1] = (W_)R1.w;
R1.p = (P_)_c2jW;
*Sp = (W_)&s2hj_info;
JMP_(*((P_)(*R1.p)));
FE_
}
EF_(Bug_zdWPS_entry);
StgWord Bug_zdWPS_info[] = {
(W_)&Bug_zdWPS_entry, 0x0, 0x11UL, 0x300000013UL
};
II_(s2hi_info);
FN_(Bug_zdWPS_entry) {
FB_
R1.p = (P_)(*Sp);
*Sp = (W_)&s2hi_info;
JMP_(*((P_)(*R1.p)));
FE_
}
EI_(Bug_PS_info);
StgWord Bug_PS_closure[] = {
(W_)&Bug_PS_info
};
EF_(Bug_PS_entry);
StgWord Bug_PS_info[] = {
(W_)&Bug_PS_entry, 0x0, 0x11UL, 0x300000013UL
};
EI_(Bug_PS_con_info);
EI_(Bug_PS_closure);
FN_(Bug_PS_entry) {
FB_
Hp=Hp+4;
if ((W_)Hp > (W_)HpLim) goto _c2k2;
Hp[-3] = (W_)&Bug_PS_con_info;
Hp[-2] = *Sp;
Hp[-1] = Sp[1];
*Hp = Sp[2];
R1.p=Hp-3;
Sp=Sp+3;
JMP_(*((P_)(*Sp)));
_c2k2:
HpAlloc = 0x20UL;
R1.p = (P_)(W_)&Bug_PS_closure;
JMP_(stg_gc_fun);
FE_
}
EF_(Bug_PS_con_entry);
StgWord Bug_PS_con_info[] = {
(W_)&Bug_PS_con_entry, 0x3UL, 0x1UL
};
FN_(Bug_PS_con_entry) {
FB_
JMP_(*((P_)(*Sp)));
FE_
}
EF_(Bug_PS_static_entry);
StgWord Bug_PS_static_info[] = {
(W_)&Bug_PS_static_entry, 0x3UL, 0x9UL
};
FN_(Bug_PS_static_entry) {
FB_
JMP_(*((P_)(*Sp)));
FE_
}
static StgWord _module_registered[] = {
0x0
};
EF_(__stginit_Prelude_);
EF_(__stginit_Foreign_);
EF_(__stginit_ForeignziForeignPtr_);
EF_(__stginit_DataziChar_);
FN_(__stginit_Bug_) {
FB_
if (0x0 != (*((P_)(W_)&_module_registered))) goto _c2k6;
goto _c2k8;
_c2k6:
Sp=Sp+1;
JMP_(Sp[-1]);
_c2k8:
*((P_)(W_)&_module_registered) = 0x1UL;
Sp=Sp-1;
*Sp = (W_)&__stginit_Prelude_;
Sp=Sp-1;
*Sp = (W_)&__stginit_Foreign_;
Sp=Sp-1;
*Sp = (W_)&__stginit_ForeignziForeignPtr_;
Sp=Sp-1;
*Sp = (W_)&__stginit_DataziChar_;
goto _c2k6;
FE_
}
EF_(__stginit_Bug_);
FN_(__stginit_Bug) {
FB_
JMP_((W_)&__stginit_Bug_);
FE_
}
More information about the Glasgow-haskell-bugs
mailing list