Re: [PPL-devel] make check fails on Freebsd in tests/Box/propagateconstraints2
On Sat, 2009-04-04 at 09:43 +0200, Roberto Bagnara wrote:
Tobias Grosser wrote:
thanks a lot for your work on this. I attached the gdb logs for you.
Hi Tobias,
it looks like GCC is miscompiling something: the equality test on two identical long doubles fails. Can you please send the generated assembly code?
Sure, here the assembly code for ld2.cc compiled with: g++ -O0 -g -S ld2.cc Tobi
Tobias Grosser ha scritto:
On Sat, 2009-04-04 at 09:43 +0200, Roberto Bagnara wrote:
Tobias Grosser wrote:
thanks a lot for your work on this. I attached the gdb logs for you. Hi Tobias,
it looks like GCC is miscompiling something: the equality test on two identical long doubles fails. Can you please send the generated assembly code?
Sure,
here the assembly code for ld2.cc compiled with:
g++ -O0 -g -S ld2.cc
As you see in your ld2.s this is the assembler generated for if (!convert(0x00000000UL, 0x0000000000000001ULL) == 3.6451995318824746025284059336194198163990508156935633437209804870283716886333977368095607086258272051972473473472035311019669856326220321699735080755898090054838225811779316785692252638056335597566215625659834107289403197935535272685912407999541728110155185383830460547687154224492953058597182682142626220675323554608440680792597537396882263389719028133546642119572938120002167626722920322774336390308456055297955188552992122553211711634876291384629300355138527501603132845785873465668580833490531237051939887039833085878399463225014686024594663765868704564236347102423971946588603575680671344779827642197362928177512955605368457612678466479085174632509237360395127227814159533660963994444034021170534884480219777636044379086876232490341169092945505322835546042550164710485109901552496948203761750727745215979248292641646728293792248343785221488475244616533404531408985349389010799994660849957929408670822251678980926263322841336335372303657106066727110161016969869085455268160934467855758 235452864566704649092870630625875619302191928395746860797324007419326707925865842479032526017145025116520187337055564776698564030616718609883010220890087524042382938121214157585271795472816282327108859944585747150338528775954260248007917199819553441519165990035038288222003556659679587710909376884092310507637448820944563204842727161227981498363616605895952090835768872542325329552297498926405507629594382412784961938193820775459054611725479613404698176911656760942613207257273126074829376531404216196861030595291994214319374495660993373960630752183022438454753416779724620381266269034081670865175453863821550089560659554103929149526239278808471595331845354866664804805634075314283853293005224776842170509512647474546357548662147849415423151110386306843914252124393041905841223742229722846065374850524646486553697190990267605182875609969972107784730669801294274274395170323909647913676782217496309754197134381391626788785559991775284508827480465385881774472703067382348985029769028530013645 504052272870939400583257885854573686549919562658630500834720876230660209033789194899209751908294216020103820394777720834006615191549726954365823050219109085766920481735349588941709767630848078374028138492275409420733154011152623348768159620874413022565584389125006072302057820130836741130234976124452147951709838486879883482032894412569087555652160818151512056388931125624153290844569340951461844692909011661106348755901648356069416294074897743797927398046747642434839120846918717692254465062843105653091908724772862559253835285450363605508542269195712463611332259048203019165883170843777122593678948464112948225870758354869856455108298805285787826984125562492745222350610924543423862023271204078275403339146131921891743158841366880194359662736634704314404430321364117756050306014368370639726903304174751873302009119675004967616181226147964529371240703987038908689155270514904657367453977649410948794796494381625766143469486520853080246963582567565857945684933190420538828438081803587871107 744180754788011865195774162718963831698357082256365846545686437026186024335489381637207327725383454545130650115406757655106569705004135372053700679248802092173634073236733684480049044084139777417069654942470407997864518618221884735712575568194332840874860236762494678694836313804738564862395470156033183226127836520686997985394004066373116827311153406778416602407104315511403704103755855729393030840738435407021205519630505149599457413591699116765754784032793801120203473482925381507983204527948424275265017968529118631081782766384723202378700828622717633961951395137123031361943660215408305314569105840483725460251777651404602071129231519231764021467528682219668899153815964812531606968222607231942595218130543034572223679679292687630728923552788547142782438631107830670601244590393155281768403049315228131487458243508921305950151980025572043324832155514470975125100762233648012028880876356506546349468872327276239064590766702271086341623192103570072733693546571875690463948848950837941035 318359596139945753778977755254619774647475181629750100914635619250327426455946458005816006983478170231943799213973476811504926872373490215642064630961387032012502777579804107726470143915791444243752525197667646704580085152976476241448144534960696851274398006295520756926486086815068790443764289774631751752051815479584595151590747012858384936940340076624101001835331415166841854607581750664815610189011330319510420990532971188374489844432308566427376064787878802852999035218550256124134710344666241715592090775384984751068112940290603342718033205664939350246217197176848044433518669466905252660607583321905318072325655018902937542595909474331403843353669733988168992536983021199161428916310053493353721580057799445291767358871939804092884746216945903030985523823769694423651860231309855078236176700511918890153514796597786761324496716420150595404382373039229030560790683446354402767725654259443299276549062629524755557509120238794246360214620433216314283656758518656549016934743434114062209 075500900456895883239368146751261034644012237280581850483204752512668828752991205822530900331778836744323438127341239220429265549085482314732853495722109622898898009940265336293214647005520293915172930551962180656672512762374901292060984143389032109424889027922539246679410822732675635286538633434434864957624004099789959850520823107302770769652428462784025682851873655888766532454230472059434786129319642112934893741195657514867872048845023075123729239731191911256140687560945268927833216880303109005580256834554518984874011393152907434774619210259879053322362993988594489387420874873162887307110687527634493923668972362589970911769962532843066876354543618621794071916521552436506195717202321286241307854049305668050292332713755462533132874462858122199615650226545103738705816482147911391708709705090741587219676334254715505158014981911072162776206923470142349135273858121648344750020070994021229914395427839819849271813006696032901904951061957842485312997402627061067983385735239773652409 412936952141886756327154470813722525510229819212511256751318392100741322860296214432621271458720224043142582192556064152802184450746540347901150755585133744227536171881983859311648101828170027941722798030282020865670812674533493413454963892393797764944190223010420679866005010454669500040571347269341476916780319866988453702999870673844073103374338281165148307453744907601716721529785950403514055725265230260512150937099005678735683852425745463850085677382639515326765492943564175657977715956384967191495778042162918921255410551471737237449917566696724590213751112887541253729183944179762430930282147033293860317993139495351613438927204090460650099589809789479976625455146641942620976652972426123679687660006291746558870908243635836538436589802775660312864296284763185729150458238958058260101327129778344186134682888329885473771745507968025731486842532941722850567778269273771580586471454035577212335120024954373394139988427825997101862157234379581542753405098110723490410464838062846088733 942757188785904186928092883334235227812406989744418298793037942414558527767133213548706472510947206755723227884479087787788921162341316176084167322809874931413318849278602593243927812557861508918592034972126159164049990970677787399148579613058849346787620435155211905818982566246359578309278114211549921399869999362036311498523728025643148961517493264044287720082504285693383296981618501712654114267081137235583250590628715067128384609860311470603514915063160125325387933544995456670095275738108920480046524524521396887893929129382518883412981222352328611387339031535609672921042411909463505167697693050307623869083995925550431922360692794912244658266842033120812554318517563412345669139725893906015586508304374020455952076899961595975457118082036883181129189476616621158029195786364034303230416100180636967072212498263837152633888503074184694239734867470092339450362209015181857669427338368461268166381583450487827282412512798203101932235129591110298840022305716882168542822578732186317444 509505523274289525381495452627798898243990285131322086386330706021355227520766615678724723251256742912688818491014163827036474514282328479933321571807940150363653616458881463557493661502090854571891872327863995858799416803703481411054047422984524978953692871939744961404456773012714035896658229110968329520211813435711369576078163183427557705604065699202616339664034841216798695426848436869083543736884379686835257236661214859479467478875727163608006964428164741135934661060892041795546771453745824379626646188830186286875100795112525560022417883462840197508639922839065135723259180534640806435215321548250748202390779907790070695880340296195621904167473597128840843245215986781788901864094514806867817331768249202768350024775234860935869637331554244918975754958515495270345383376943149530571640192150266707739109974432797600052906415115847071932263512716704397751410765526327361661176113949343256737438823655183185612089415529316291251367997115745789167410235872514289989469631824116505544 042064163364874186561053330385457739601909496028500962085690852302287088948745775235125582819733929612639216561639633693884117634763886259524069015182734130370686433835502829622377291959017885993928766510865998492239942591452592404793843806578034980587190625290073394283162299977568998577121169227586830717074729355744992449784197881713384684717511253038609115892894008066372029204294899198702634159516608889754348273042974513623250526934820015248431712290784679105379131381154586266120249707308995151143019152816139292393293515010498592252745641078468181129383391613089431532051176517163804684622961938824442933704843685300968988127789731782849127985502452460634119184826382616940292452732916467073315946752134281587552738824383579602450640510158889185418011397716197432214050377972856694814558106533200089042159975979759073915120262140200120101347075367742276364775809181675078504851970653263910911714517637512376127394984685100090554800250960159855817693701796567811513065659525901019773 98335185042637681982306448413722177895665290302796223004198526079143104070007874540548221582347389579e-4951L) return 1; movl $1, 4(%esp) movl $0, 8(%esp) movl $0, (%esp) call _Z7convertjy fldz fucompp fnstsw %ax sahf setne %al setp %dl orl %edx, %eax xorl $1, %eax movzbl %al, %eax pushl %eax fildl (%esp) leal 4(%esp), %esp fldz fucompp fnstsw %ax sahf sete %al setnp %dl andl %edx, %eax testb %al, %al je .L36 The constant seen in source file is the minimun denormalized number (with all its decimals) representable with a long double, but it seems that, despite a typo in the last versione of test program we sent to you, it is seen as zero from your compiler. As a reference this is the code I obtain here with gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12) and the attached (fixed) test program. movl $1, 4(%esp) movl $0, 8(%esp) movl $0, (%esp) call _Z7convertjy fldt .LC3 fucompp fnstsw %ax sahf sete %al setnp %dl andl %edx, %eax xorl $1, %eax testb %al, %al jne .L4 ... .LC3: .long 1 .long 0 .long 0 Now I guess there is something broken in your version of compiler. I'd like you send me the output of g++ -v -fsyntax-only -x c++ /dev/null and g++ -E -dM -x c++ /dev/null I'm also interested in the ld2.s generated from fixed test program with -O0, -O1, -O2 to see if something changes. The presence of fldz in generated assembler is the evidence of the miscompilation. Then, after sending me these info, I'd ask you to try another gcc version (more recent than 4.3.1) to compile both ld2.cc and ppl build to see if this make a difference in one or both. -- Abramo Bagnara Opera Unica Phone: +39.0546.656023 Via Borghesi, 16 48014 Castel Bolognese (RA) - Italy .file "ld2.cc" .text .p2align 4,,15 .type _GLOBAL__I__Z7convertjy, @function _GLOBAL__I__Z7convertjy: .LFB1201: pushl %ebp .LCFI0: movl %esp, %ebp .LCFI1: subl $24, %esp .LCFI2: movl $_ZStL8__ioinit, (%esp) call _ZNSt8ios_base4InitC1Ev movl $__dso_handle, 8(%esp) movl $_ZStL8__ioinit, 4(%esp) movl $_ZNSt8ios_base4InitD1Ev, (%esp) call __cxa_atexit leave ret .LFE1201: .size _GLOBAL__I__Z7convertjy, .-_GLOBAL__I__Z7convertjy .section .ctors,"aw",@progbits .align 4 .long _GLOBAL__I__Z7convertjy .section .rodata.str1.1,"aMS",@progbits,1 .LC0: .string "Converting with " .LC1: .string "msp = 0x" .LC2: .string ", lsp = 0x" .LC3: .string "\ngives " .LC4: .string "L" .text .p2align 4,,15 .globl _Z7convertjy .type _Z7convertjy, @function _Z7convertjy: .LFB1181: pushl %ebp .LCFI3: movl %esp, %ebp .LCFI4: pushl %esi .LCFI5: pushl %ebx .LCFI6: subl $64, %esp .LCFI7: movl 16(%ebp), %edx movl 12(%ebp), %eax movl 8(%ebp), %esi movl $10000, _ZSt4cerr+8 movl %edx, -20(%ebp) movl %eax, -24(%ebp) movl %esi, -16(%ebp) fldt -24(%ebp) movl %edx, -44(%ebp) movl %eax, -48(%ebp) fstpt -40(%ebp) movl $16, 8(%esp) movl $.LC0, 4(%esp) movl $_ZSt4cerr, (%esp) call _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_i movl $8, 8(%esp) movl $.LC1, 4(%esp) movl $_ZSt4cerr, (%esp) call _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_i movl _ZSt4cerr, %ecx movl $_ZSt4cerr, %edx addl -12(%ecx), %edx movl 12(%edx), %eax andl $-75, %eax orl $8, %eax movl %eax, 12(%edx) movl -12(%ecx), %eax movl $8, _ZSt4cerr+8(%eax) movl -12(%ecx), %eax leal _ZSt4cerr(%eax), %ebx cmpb $0, 117(%ebx) jne .L4 movl $32, 4(%esp) movl %ebx, (%esp) call _ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc movb $1, 117(%ebx) movb %al, 116(%ebx) .L4: movb $48, 116(%ebx) movl %esi, 4(%esp) movl $_ZSt4cerr, (%esp) call _ZNSo9_M_insertImEERSoT_ movl $10, 8(%esp) movl $.LC2, 4(%esp) movl %eax, %esi movl %eax, (%esp) movl %esi, %ebx call _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_i movl (%esi), %edx movl %esi, %ecx addl -12(%edx), %ecx movl 12(%ecx), %eax andl $-75, %eax orl $8, %eax movl %eax, 12(%ecx) movl -12(%edx), %eax movl $16, 8(%esi,%eax) addl -12(%edx), %ebx cmpb $0, 117(%ebx) jne .L5 movl $32, 4(%esp) movl %ebx, (%esp) call _ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc movb $1, 117(%ebx) movb %al, 116(%ebx) .L5: movb $48, 116(%ebx) movl -44(%ebp), %edx movl -48(%ebp), %eax movl %esi, (%esp) movl %edx, 8(%esp) movl %eax, 4(%esp) call _ZNSo9_M_insertIyEERSoT_ movl $7, 8(%esp) movl $.LC3, 4(%esp) movl %eax, %ebx movl %eax, (%esp) call _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_i movl %ebx, (%esp) fldt -40(%ebp) fstpt 4(%esp) call _ZNSo9_M_insertIeEERSoT_ movl $1, 8(%esp) movl $.LC4, 4(%esp) movl %eax, %ebx movl %eax, (%esp) call _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_i movl $10, 4(%esp) movl (%ebx), %eax movl -12(%eax), %edx leal (%ebx,%edx), %eax movl %eax, (%esp) call _ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc movl %ebx, (%esp) movsbl %al,%eax movl %eax, 4(%esp) call _ZNSo3putEc movl %eax, (%esp) call _ZNSo5flushEv fldt -40(%ebp) addl $64, %esp popl %ebx popl %esi popl %ebp ret .LFE1181: .size _Z7convertjy, .-_Z7convertjy .p2align 4,,15 .globl main .type main, @function main: .LFB1182: leal 4(%esp), %ecx .LCFI8: andl $-16, %esp pushl -4(%ecx) .LCFI9: pushl %ebp .LCFI10: movl %esp, %ebp .LCFI11: pushl %ecx .LCFI12: subl $36, %esp .LCFI13: movl $-861229876, 4(%esp) movl $-1395873108, 8(%esp) movl $-1431515990, (%esp) call _Z7convertjy fldt .LC6 fcompp fnstsw %ax sahf jne .L9 jmp .L12 .p2align 4,,7 .p2align 3 .L13: fstp %st(0) .p2align 4,,7 .p2align 3 .L9: movl $1, %eax .L10: addl $36, %esp popl %ecx popl %ebp leal -4(%ecx), %esp ret .p2align 4,,7 .p2align 3 .L12: movl $-1429419350, 4(%esp) movl $-894776118, 8(%esp) movl $-859133236, (%esp) call _Z7convertjy fldt .LC7 fcompp fnstsw %ax sahf jne .L9 movl $1, 4(%esp) movl $0, 8(%esp) movl $0, (%esp) call _Z7convertjy fldt .LC8 fcom %st(1) fnstsw %ax fstp %st(1) sahf jne .L13 movl $1, 4(%esp) movl $0, 8(%esp) movl $-2147483648, (%esp) fstpt -24(%ebp) call _Z7convertjy fldt -24(%ebp) fcompp fnstsw %ax sahf setne %al movzbl %al, %eax jmp .L10 .LFE1182: .size main, .-main .local _ZStL8__ioinit .comm _ZStL8__ioinit,1,1 .weakref _ZL20__gthrw_pthread_oncePiPFvvE,pthread_once .weakref _ZL27__gthrw_pthread_getspecificj,pthread_getspecific .weakref _ZL27__gthrw_pthread_setspecificjPKv,pthread_setspecific .weakref _ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_,pthread_create .weakref _ZL22__gthrw_pthread_cancelm,pthread_cancel .weakref _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t,pthread_mutex_lock .weakref _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t,pthread_mutex_trylock .weakref _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t,pthread_mutex_unlock .weakref _ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t,pthread_mutex_init .weakref _ZL30__gthrw_pthread_cond_broadcastP14pthread_cond_t,pthread_cond_broadcast .weakref _ZL25__gthrw_pthread_cond_waitP14pthread_cond_tP15pthread_mutex_t,pthread_cond_wait .weakref _ZL26__gthrw_pthread_key_createPjPFvPvE,pthread_key_create .weakref _ZL26__gthrw_pthread_key_deletej,pthread_key_delete .weakref _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t,pthread_mutexattr_init .weakref _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti,pthread_mutexattr_settype .weakref _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t,pthread_mutexattr_destroy .section .rodata.cst16,"aM",@progbits,16 .align 16 .LC6: .long -861229876 .long -1395873108 .long 52394 .align 16 .align 16 .LC7: .long -1429419350 .long -894776118 .long 43724 .align 16 .align 16 .LC8: .long 1 .long 0 .long 0 .align 16 .section .eh_frame,"a",@progbits .Lframe1: .long .LECIE1-.LSCIE1 .LSCIE1: .long 0x0 .byte 0x1 .globl __gxx_personality_v0 .string "zP" .uleb128 0x1 .sleb128 -4 .byte 0x8 .uleb128 0x5 .byte 0x0 .long __gxx_personality_v0 .byte 0xc .uleb128 0x4 .uleb128 0x4 .byte 0x88 .uleb128 0x1 .align 4 .LECIE1: .LSFDE1: .long .LEFDE1-.LASFDE1 .LASFDE1: .long .LASFDE1-.Lframe1 .long .LFB1201 .long .LFE1201-.LFB1201 .uleb128 0x0 .byte 0x4 .long .LCFI0-.LFB1201 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI1-.LCFI0 .byte 0xd .uleb128 0x5 .align 4 .LEFDE1: .LSFDE3: .long .LEFDE3-.LASFDE3 .LASFDE3: .long .LASFDE3-.Lframe1 .long .LFB1181 .long .LFE1181-.LFB1181 .uleb128 0x0 .byte 0x4 .long .LCFI3-.LFB1181 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI4-.LCFI3 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI7-.LCFI4 .byte 0x83 .uleb128 0x4 .byte 0x86 .uleb128 0x3 .align 4 .LEFDE3: .LSFDE5: .long .LEFDE5-.LASFDE5 .LASFDE5: .long .LASFDE5-.Lframe1 .long .LFB1182 .long .LFE1182-.LFB1182 .uleb128 0x0 .byte 0x4 .long .LCFI8-.LFB1182 .byte 0xc .uleb128 0x1 .uleb128 0x0 .byte 0x9 .uleb128 0x4 .uleb128 0x1 .byte 0x4 .long .LCFI9-.LCFI8 .byte 0xc .uleb128 0x4 .uleb128 0x4 .byte 0x4 .long .LCFI10-.LCFI9 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI11-.LCFI10 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI12-.LCFI11 .byte 0x84 .uleb128 0x3 .align 4 .LEFDE5: .ident "GCC: (Ubuntu 4.3.2-1ubuntu12) 4.3.2" .section .note.GNU-stack,"",@progbits
participants (2)
-
Abramo Bagnara -
Tobias Grosser