[llvm-bugs] [Bug 31970] New: Assertion failure in lib/Support/APFloat.cpp
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Feb 15 05:31:09 PST 2017
http://bugs.llvm.org/show_bug.cgi?id=31970
Bug ID: 31970
Summary: Assertion failure in lib/Support/APFloat.cpp
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: nickc at redhat.com
CC: llvm-bugs at lists.llvm.org
Created attachment 17986
--> http://bugs.llvm.org/attachment.cgi?id=17986&action=edit
Preprocessed test case.
Compiling the attached preprocessed source code with the attached command line
triggers this assertion failure:
clang-4.0: /work/sources/llvm/current/lib/Support/APFloat.cpp:544: unsigned int
llvm::powerOf5(llvm::integerPart*, unsigned int): Assertion `power <=
maxExponent' failed.
The stack backtrace looks like this:
#0 0x00000000034cc20c llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/work/sources/llvm/current/lib/Support/Unix/Signals.inc:402:0
#1 0x00000000034cc29f PrintStackTraceSignalHandler(void*)
/work/sources/llvm/current/lib/Support/Unix/Signals.inc:466:0
#2 0x00000000034ca802 llvm::sys::RunSignalHandlers()
/work/sources/llvm/current/lib/Support/Signals.cpp:44:0
#3 0x00000000034cbb83 SignalHandler(int)
/work/sources/llvm/current/lib/Support/Unix/Signals.inc:256:0
#4 0x00007fee3a7e15c0 __restore_rt (/lib64/libpthread.so.0+0x115c0)
#5 0x00007fee3934991f __GI_raise
/usr/src/debug/glibc-2.24-33-ge9e69e4/signal/../sysdeps/unix/sysv/linux/raise.c:58:0
#6 0x00007fee3934b51a __GI_abort
/usr/src/debug/glibc-2.24-33-ge9e69e4/stdlib/abort.c:91:0
#7 0x00007fee39341da7 __assert_fail_base
/usr/src/debug/glibc-2.24-33-ge9e69e4/assert/assert.c:92:0
#8 0x00007fee39341e52 (/lib64/libc.so.6+0x2de52)
#9 0x00000000034049f5 llvm::powerOf5(unsigned long*, unsigned int)
/work/sources/llvm/current/lib/Support/APFloat.cpp:546:0
#10 0x0000000003408fa2
llvm::detail::IEEEFloat::roundSignificandWithExponent(unsigned long const*,
unsigned int, int, llvm::APFloatBase::roundingMode)
/work/sources/llvm/current/lib/Support/APFloat.cpp:2377:0
#11 0x000000000340966d
llvm::detail::IEEEFloat::convertFromDecimalString(llvm::StringRef,
llvm::APFloatBase::roundingMode)
/work/sources/llvm/current/lib/Support/APFloat.cpp:2556:0
#12 0x000000000340a023
llvm::detail::IEEEFloat::convertFromString(llvm::StringRef,
llvm::APFloatBase::roundingMode)
/work/sources/llvm/current/lib/Support/APFloat.cpp:2613:0
#13 0x0000000003411f8a llvm::APFloat::convertFromString(llvm::StringRef,
llvm::APFloatBase::roundingMode)
/work/sources/llvm/current/lib/Support/APFloat.cpp:4430:0
#14 0x000000000630756e
clang::NumericLiteralParser::GetFloatValue(llvm::APFloat&)
/work/sources/llvm/current/tools/clang/lib/Lex/LiteralSupport.cpp:997:0
#15 0x000000000538b907 BuildFloatingLiteral(clang::Sema&,
clang::NumericLiteralParser&, clang::QualType, clang::SourceLocation)
/work/sources/llvm/current/tools/clang/lib/Sema/SemaExpr.cpp:3220:0
#16 0x000000000538c8d0 clang::Sema::ActOnNumericConstant(clang::Token const&,
clang::Scope*)
/work/sources/llvm/current/tools/clang/lib/Sema/SemaExpr.cpp:3409:0
#17 0x0000000004dae72d clang::Parser::ParseCastExpression(bool, bool, bool&,
clang::Parser::TypeCastState)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseExpr.cpp:746:0
#18 0x0000000004dae35c clang::Parser::ParseCastExpression(bool, bool,
clang::Parser::TypeCastState)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseExpr.cpp:481:0
#19 0x0000000004dacfcc
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseExpr.cpp:170:0
#20 0x0000000004d87b9e clang::Parser::ParseInitializer()
/work/sources/llvm/current/tools/clang/include/clang/Parse/Parser.h:1636:0
#21 0x0000000004d744fd
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseDecl.cpp:2078:0
#22 0x0000000004d736c8 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseDecl.cpp:1869:0
#23 0x0000000004d562ca
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:986:0
#24 0x0000000004d56382
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:1001:0
#25 0x0000000004d55a05
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:851:0
#26 0x0000000004d54cef
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:627:0
#27 0x0000000004d50e66 clang::ParseAST(clang::Sema&, bool, bool)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseAST.cpp:146:0
#28 0x0000000003d0e575 clang::ASTFrontendAction::ExecuteAction()
/work/sources/llvm/current/tools/clang/lib/Frontend/FrontendAction.cpp:568:0
#29 0x000000000415de26 clang::CodeGenAction::ExecuteAction()
/work/sources/llvm/current/tools/clang/lib/CodeGen/CodeGenAction.cpp:973:0
#30 0x0000000003d0dfe3 clang::FrontendAction::Execute()
/work/sources/llvm/current/tools/clang/lib/Frontend/FrontendAction.cpp:472:0
#31 0x0000000003cb39a5
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/work/sources/llvm/current/tools/clang/lib/Frontend/CompilerInstance.cpp:951:0
#32 0x0000000003e3b18b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/work/sources/llvm/current/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:249:0
#33 0x0000000001868da7 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /work/sources/llvm/current/tools/clang/tools/driver/cc1_main.cpp:221:0
#34 0x000000000185eb5f ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/work/sources/llvm/current/tools/clang/tools/driver/driver.cpp:299:0
#35 0x000000000185f6ee main
/work/sources/llvm/current/tools/clang/tools/driver/driver.cpp:380:0
#36 0x00007fee39334401 __libc_start_main
/usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:323:0
#37 0x000000000185c55a _start
(/work/builds/llvm/current/native/bin/clang-4.0+0x185c55a)
Stack dump:
0. Program arguments: /work/builds/llvm/current/native/bin/clang-4.0 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name float-exact-1.c -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -resource-dir
/work/builds/llvm/current/native/bin/../lib/clang/5.0.0 -internal-isystem
/usr/local/include -internal-isystem
/work/builds/llvm/current/native/bin/../lib/clang/5.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -w
-fdebug-compilation-dir /work/builds/llvm/current/native/tests -ferror-limit 19
-fmessage-length 130 -fobjc-runtime=gcc -fdiagnostics-show-option -o
/dev/shm/float-exact-1-9be66d.o -x c
/work/sources/gcc/current/gcc/testsuite/gcc.dg/float-exact-1.c
1. /work/sources/gcc/current/gcc/testsuite/gcc.dg/float-exact-1.c:292:1:
current parser token
'1.8225997659412373012642029668097099081995254078467816718604\
902435141858443166988684047803543129136025986236736736017655\
509834928163110160849867540377949045027419112905889658392846\
126319028167798783107812829917053644701598967767636342956203\
999770864055077592691915230273843577112246476529298591341071\
313110337661777304220340396298768698441131694859514066773321\
059786469060001083813361460161387168195154228027648977594276\
496061276605855817438145692314650177569263750801566422892936\
732834290416745265618525969943519916542939199731612507343012\
297331882934352282118173551211985973294301787840335672389913\
821098681464088756477802684228806339233239542587316254618680\
197563613907079766830481997222017010585267442240109888818022\
189543438116245170584546472752661417773021275082355242554950\
776248474101880875363872607989624146320823364146896124171892\
610744237622308266702265704492674694505399997330424978964704\
335411125839490463131661420668167686151828553033363555080508\
484934542727634080467233927879117726432283352324546435315312\
937809651095964197873430398662003709663353962932921239516263\
008572512558260093668527782388349282015308359304941505110445\
043762021191469060607078792635897736408141163554429972292873\
575169264387977130124003958599909776720759582995017519144111\
001778329839793855454688442046155253818724410472281602421363\
580613990749181808302947976045417884436271162664776148749463\
202753814797191206392480969096910387729527305862739806702349\
088455828380471306603628636563037414688265702108098430515297\
645997107159687247830496686980315376091511219227376708389862\
310190633134517040835432587726931910775044780329777051964574\
763119639404235797665922677433332402402817037657141926646502\
612388421085254756323737273178774331073924707711575555193153\
421957126062196520952920611871114861423032687425262323243276\
848595495133802591437804984986053892365334900647137137197585\
161954823956838391108748154877098567190695813394392779995887\
642254413740232692940887236351533691174492514884514265006822\
752026136435469700291628942927286843274959781329315250417360\
438115330104516894597449604875954147108010051910197388860417\
003307595774863477182911525109554542883460240867674794470854\
883815424039187014069246137704710366577005576311674384079810\
437206511282792194562503036151028910065418370565117488062226\
073975854919243439941741016447206284543777826080409075756028\
194465562812076645422284670475730922346454505830553174377950\
824178034708147037448871898963699023373821217419560423459358\
846127232531421552826545954362386431279626917642725181802754\
271134597856231805666129524101509582941585421888561296839474\
232056474112935379177434928227554149402642893913492062781246\
372611175305462271711931011635602039137701669573065960945871\
579420683440097179831368317352157202215160682058878025153007\
184185319863451652087375936651004559837502483808090613073982\
264685620351993519454344577635257452328683726988824705474397\
398247190812883071734743260426540123481791283782928972842466\
595210269414219040901793935553872090377394005932597887081359\
481915849178541128182923272843218513093012167744690818603663\
862691727272565325057703378827553284852502067686026850339624\
401046086817036618366842240024522042069888708534827471235203\
998932259309110942367856287784097166420437430118381247339347\
418156902369282431197735078016591613063918260343498992697002\
033186558413655576703389208301203552157755701852051877927864\
696515420369217703510602759815252574799728706795849558382877\
392016396900560101736741462690753991602263974212137632508984\
264559315540891383192361601189350414311358816980975697568561\
515680971830107704152657284552920241862730125888825702301035\
564615759615882010733764341109834449576907982406265803484111\
303615971297609065271517286111839839646343815364461776394273\
571391219315553915335300622295196577640884201524657614065743\
729121754460652975075990012786021662416077757235487562550381\
116824006014440438178253273174734436163638119532295383351135\
543170811596051785036366846773285937845231974424475418970517\
659179798069972876889488877627309887323737590814875050457317\
809625163713227973229002908003491739085115971899606986738405\
752463436186745107821032315480693516006251388789902053863235\
071957895722121876262598833823352290042576488238120724072267\
480348425637199003147760378463243043407534395221882144887315\
875876025907739792297575795373506429192468470170038312050500\
917665707583420927303790875332407805094505665159755210495266\
485594187244922216154283213688032393939401426499517609275128\
062067355172333120857796045387692492375534056470145301671359\
016602832469675123108598588424022216759334733452626330303791\
660952659036162827509451468771297954737165701921676834866994\
084496268491510599580714458155026746676860790028899722645883\
679435969902046442373108472951515492761911884847211825930115\
654927539118088350255959445076757398298893380662248358210075\
297702191186519614515280395341723177201383862827129721649638\
274531314762377778754560119397123180107310216608157141828379\
259328274508467371717057031104537750450228447941619684073375\
630517322006118640290925241602376256334414376495602911265450\
165889418372161719063670619610214632774542741157366426747861\
054811449449004970132668146607323502760146957586465275981090\
328336256381187450646030492071694516054712444513961269623339\
705411366337817643269316717217432478812002049894979925260411\
553651385384826214231392012841425936827944383266227115236029\
717393064659821056467446870597828757433936024422511537561864\
619865595955628070343780472634463916608440151554502790128417\
277259492437005696576453717387309605129939526661181496994297\
244693710437436581443653555343763817246961834486181294985455\
884981266421533438177271809310897035958260776218253097858601\
160643120653927024652834025146166356877731266566437231429061\
099807825113272551869352908241073955695854354852545370793609\
838167127357752579007490955536081388103461735071174567636929\
060824172375010035497010614957197713919909924635906503348016\
450952475530978921242656498701313530533991692867619886826204\
706468476070943378163577235406861262755114909606255628375659\
196050370661430148107216310635729360112021571291096278032076\
401092225373270173950575377792566872113768085940991929655824\
050914085013970861399015141010432835406337266746706727481946\
196898882472095111505210339933002505227334750020285673634670\
738458390159933494226851499935336922036551687169140582574153\
726872453800858360764892975201757027862632615130256075468549\
502839367841926212872731925042838691319757663382746471782087\
828988857978192483595747889021081459460627705275735868618724\
958783348362295106875556443770626864591972089881215465141073\
516646930158996569747675806719463602045230325049794904894739\
988312727573320971310488326486213061839843830003145873279435\
454121817918269218294901387830156432148142381592864575229119\
479029130050663564889172093067341444164942736885872753984012\
865743421266470861425283889134636885790293235727017788606167\
560012477186697069994213912998550931078617189790771376702549\
055361745205232419031423044366971378594392952093464046441667\
117613906203494872209149396518971207279263883566606774353236\
255473603377861613942239543893894460581170658088042083661404\
937465706659424639301296621963906278930754459296017486063079\
582024995485338893699574289806529424673393810217577605952909\
491283123179789154639057105774960699934999681018155749261864\
012821574480758746632022143860041252142846691648490809250856\
327057133540568617791625295314357533564192304930155735301757\
457531580062662693966772497728335047637869054460240023262262\
260698443946964564691259441706490611176164305693669515767804\
836460521205954731752583848846525153811934541997962775215961\
180346397456122329133421016560406277159258781706172834569862\
946953007793254152187010227976038449980797987728559041018441\
590564594738308310579014597893182017151615208050090318483536\
106249131918576316944251537092347119867433735046169725181104\
507590928834713669184230634083190791725243913641206256399101\
550966117564795555149420011152858441084271411289366093158722\
254752761637144762690747726313899449121995142565661043193165\
353010677613760383307839362361625628371456344409245507081913\
518237257141164239966660785903970075181826808229440731778746\
830751045427285945936163931997929399708401851740705527023711\
492262489476846435969872480702228386506357017948329114555484\
164760105906717855684788039081591713778852802032849601308169\
832017420608399347713424218434541771868442189843417628618330\
607429739733739437863581804003482214082370567967330530446020\
897773385726872912189813323094415093143437550397556262780011\
208941731420098754319961419532567861629590267320403217607660\
774125374101195389953895035347940170148097810952083736798564\
420421622607993390894450932047257403433908665884124601384175\
012387617430467934818665777122459487877479257747635172691688\
471574765285820096075133353869554987216398800026453207557923\
535966131756358352198875705382763163680830588056974671628368\
719411827591592806044707764658145625683998557872894583705117\
936257144994734815912058252772021032081682437093280526665192\
728869800954748014250481042845426151143544474372887617562791\
409866964806319608280819816846942058817381943129762034507591\
367065185343216917751414811188645979508942996964383255432999\
246119971295726296202396921903289017490293595312645036697141\
581149988784499288560584613793415358537364677872496224892098\
940856692342358755626519304557946447004033186014602147449599\
351317079758304444877174136521487256811625263467410007624215\
856145392339552689565690577293133060124853654497575571509576\
408069646196646757505249296126372820539234090564691695806544\
715766025588258581902342311480969412221466852421842650484494\
063894865891424563992751226230317059592413191308470146226366\
458233536657973376067140793776369412191789801225320255079444\
592709005698858098716107025188986428347407279053266600044521\
079987989879536957560131070100060050673537683871138182387904\
590837539252425985326631955455857258818756188063697492342550\
045277400125480079927908846850898283905756532829762950509886\
991675925213188409911532242068610889478326451513981115020992\
630395715520350039372702741107911736947893709538471200363740\
669304116845653259038102180504837110789645359520309929381266\
271463740502507456882882255788069710715770802338317704510793\
279398576163709512326095306022330346997717688118726634628650\
675984237916551201500684504118483305560295744746257951860545\
390826531622290588364837980034428055971370065573420370270905\
592141420051502465016793525150950140243606137664910359769114\
512792293426708006440346732679574519594848136194781488696994\
267355775509666977187349644291823026624985531726865131782364\
428380093055155988532106121916567178604128111080322761213573\
781334480667563871257352254033032675246444238637990062075058\
819854494711379915549313390179300091783493496822950479766923\
983305064901026858870340863556799948310622536592472509634484\
910640735459644047154918467543140024764605449756679450446473\
048922824617117723876384637412932380635306714345354710568410\
140587435077620501285599837051978855056335305570615129711860\
309387503970812843734718712815925040263182888714533431137355\
255722368962836390856001176889513153529416105504464217522618\
741534232432067776306691118141998014985541610448993152948945\
865983354717289054861249734477980864059509622993770525110616\
313865830823478927462500895844216364365499438449134659145333\
799994034010282254566331595018205841080487728993632798168070\
476921205941768965021887178681810499301253039335978279707627\
295287697256489961179958946847840431902105306618594831078534\
622089641993900896756734276531931450266972752637997248151974\
2277811246822238899767398834228515624999e-4951L'
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170215/41fb97fc/attachment-0001.html>
More information about the llvm-bugs
mailing list