<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>178543</bug_id>
          
          <creation_ts>2017-10-19 14:10:36 -0700</creation_ts>
          <short_desc>REGRESSION(r223691): DFGByteCodeParser.cpp:1483:83: warning: comparison is always false due to limited range of data type [-Wtype-limits]</short_desc>
          <delta_ts>2017-11-15 13:08:29 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>Other</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=176601</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Saam Barati">saam</assigned_to>
          <cc>buildbot</cc>
    
    <cc>commit-queue</cc>
    
    <cc>fpizlo</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>msaboff</cc>
    
    <cc>rmorisset</cc>
    
    <cc>rniwa</cc>
    
    <cc>saam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1362316</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-10-19 14:10:36 -0700</bug_when>
    <thetext>r223691 &quot;Turn recursive tail calls into loops&quot; introduced the following warning when building WebKitGTK+ with GCC 7.2.1:

../../Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp: In member function ‘bool JSC::DFG::ByteCodeParser::handleRecursiveTailCall(JSC::DFG::Node*, const JSC::CallLinkStatus&amp;, int, JSC::VirtualRegister, int)’:
../../Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:1483:83: warning: comparison is always false due to limited range of data type [-Wtype-limits]
     } while (stackEntry-&gt;m_inlineCallFrame &amp;&amp; stackEntry-&gt;m_inlineCallFrame-&gt;kind == TailCall &amp;&amp; (stackEntry = stackEntry-&gt;m_caller));
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

It&apos;s a bit surprising because InlineCallFrame::Kind has only eight possible values (including TailCall), and InlineCallFrame::kind is an unsigned bitfield three bits wide, which seems like it should be enough.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362320</commentid>
    <comment_count>1</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-10-19 14:14:30 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #0)
&gt; r223691 &quot;Turn recursive tail calls into loops&quot; introduced the following
&gt; warning when building WebKitGTK+ with GCC 7.2.1:
&gt; 
&gt; ../../Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp: In member function
&gt; ‘bool JSC::DFG::ByteCodeParser::handleRecursiveTailCall(JSC::DFG::Node*,
&gt; const JSC::CallLinkStatus&amp;, int, JSC::VirtualRegister, int)’:
&gt; ../../Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:1483:83: warning:
&gt; comparison is always false due to limited range of data type [-Wtype-limits]
&gt;      } while (stackEntry-&gt;m_inlineCallFrame &amp;&amp;
&gt; stackEntry-&gt;m_inlineCallFrame-&gt;kind == TailCall &amp;&amp; (stackEntry =
&gt; stackEntry-&gt;m_caller));
&gt;                                               
&gt; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
&gt; 
&gt; It&apos;s a bit surprising because InlineCallFrame::Kind has only eight possible
&gt; values (including TailCall), and InlineCallFrame::kind is an unsigned
&gt; bitfield three bits wide, which seems like it should be enough.

Oh wow. This should be
stackEntry-&gt;m_inlineCallFrame-&gt;kind == InlineCallFrame::TailCall I think</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362326</commentid>
    <comment_count>2</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-10-19 14:20:30 -0700</bug_when>
    <thetext>Will fix. I wonder if clang does the right thing here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362336</commentid>
    <comment_count>3</comment_count>
      <attachid>324287</attachid>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-10-19 14:27:34 -0700</bug_when>
    <thetext>Created attachment 324287
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362337</commentid>
    <comment_count>4</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-10-19 14:28:02 -0700</bug_when>
    <thetext>gotta love the C++ type system.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362346</commentid>
    <comment_count>5</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-10-19 14:30:19 -0700</bug_when>
    <thetext>Ima let the tests run on this just in case we are hitting entirely new code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362377</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-10-19 15:02:02 -0700</bug_when>
    <thetext>Ahhh, I was super confused. So TailCall there must be coming from the NodeType enum in DFGNodeType.h.

If NodeType were changed to be an enum class, weird bugs like this could be avoided in the future.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362380</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-10-19 15:03:17 -0700</bug_when>
    <thetext>Unfortunately:

** The following JSC stress test failures have been introduced:
	wasm.yaml/wasm/js-api/call-indirect.js.default-wasm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362381</commentid>
    <comment_count>8</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-10-19 15:05:10 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #6)
&gt; Ahhh, I was super confused. So TailCall there must be coming from the
&gt; NodeType enum in DFGNodeType.h.
&gt; 
&gt; If NodeType were changed to be an enum class, weird bugs like this could be
&gt; avoided in the future.

Indeed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362382</commentid>
    <comment_count>9</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-10-19 15:05:26 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #7)
&gt; Unfortunately:
&gt; 
&gt; ** The following JSC stress test failures have been introduced:
&gt; 	wasm.yaml/wasm/js-api/call-indirect.js.default-wasm

With the change applied locally on your machine?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362383</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-10-19 15:07:33 -0700</bug_when>
    <thetext>(In reply to Saam Barati from comment #9)
&gt; (In reply to Michael Catanzaro from comment #7)
&gt; &gt; Unfortunately:
&gt; &gt; 
&gt; &gt; ** The following JSC stress test failures have been introduced:
&gt; &gt; 	wasm.yaml/wasm/js-api/call-indirect.js.default-wasm
&gt; 
&gt; With the change applied locally on your machine?

No, I actually got that from the JSC EWS:

https://webkit-queues.webkit.org/results/4924194

But the EWS just reran the tests and the it passed this time. The test must be flaky.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362385</commentid>
    <comment_count>11</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-10-19 15:09:02 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #10)
&gt; (In reply to Saam Barati from comment #9)
&gt; &gt; (In reply to Michael Catanzaro from comment #7)
&gt; &gt; &gt; Unfortunately:
&gt; &gt; &gt; 
&gt; &gt; &gt; ** The following JSC stress test failures have been introduced:
&gt; &gt; &gt; 	wasm.yaml/wasm/js-api/call-indirect.js.default-wasm
&gt; &gt; 
&gt; &gt; With the change applied locally on your machine?
&gt; 
&gt; No, I actually got that from the JSC EWS:
&gt; 
&gt; https://webkit-queues.webkit.org/results/4924194
&gt; 
&gt; But the EWS just reran the tests and the it passed this time. The test must
&gt; be flaky.

It&apos;s still possible this patch introduced the failure. I&apos;ll run it locally without CJIT on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362452</commentid>
    <comment_count>12</comment_count>
      <attachid>324287</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-10-19 16:49:27 -0700</bug_when>
    <thetext>Comment on attachment 324287
patch

Clearing flags on attachment: 324287

Committed r223729: &lt;https://trac.webkit.org/changeset/223729&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362453</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-10-19 16:49:28 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1362665</commentid>
    <comment_count>14</comment_count>
    <who name="Robin Morisset">rmorisset</who>
    <bug_when>2017-10-20 05:01:26 -0700</bug_when>
    <thetext>Wow, I had totally missed that. Thank you for finding it and fixing it so quickly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1364519</commentid>
    <comment_count>15</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-10-25 15:11:50 -0700</bug_when>
    <thetext>Re-opened since this is blocked by bug 178834</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1364526</commentid>
    <comment_count>16</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2017-10-25 15:15:43 -0700</bug_when>
    <thetext>There&apos;s no reason to re-open this since webkit.org/b/176601 has been re-opened.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1372375</commentid>
    <comment_count>17</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-11-15 13:08:29 -0800</bug_when>
    <thetext>&lt;rdar://problem/35568861&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>324287</attachid>
            <date>2017-10-19 14:27:34 -0700</date>
            <delta_ts>2017-10-19 16:49:27 -0700</delta_ts>
            <desc>patch</desc>
            <filename>b-backup.diff</filename>
            <type>text/plain</type>
            <size>1629</size>
            <attacher name="Saam Barati">saam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMjIzNzEyKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBA
CisyMDE3LTEwLTE5ICBTYWFtIEJhcmF0aSAgPHNiYXJhdGlAYXBwbGUuY29tPgorCisgICAgICAg
IFJFR1JFU1NJT04ocjIyMzY5MSk6IERGR0J5dGVDb2RlUGFyc2VyLmNwcDoxNDgzOjgzOiB3YXJu
aW5nOiBjb21wYXJpc29uIGlzIGFsd2F5cyBmYWxzZSBkdWUgdG8gbGltaXRlZCByYW5nZSBvZiBk
YXRhIHR5cGUgWy1XdHlwZS1saW1pdHNdCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3Jn
L3Nob3dfYnVnLmNnaT9pZD0xNzg1NDMKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9P
UFMhKS4KKworICAgICAgICAqIGR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nRyeS0+bV9pbmxpbmVDYWxsRnJhbWUtPmtpbmQgPT0gVGFp
bENhbGwgJiYgKHN0YWNrRW50cnkgPSBzdGFja0VudHJ5LT5tX2NhbGxlcikpOworICAgIH0gd2hp
bGUgKHN0YWNrRW50cnktPm1faW5saW5lQ2FsbEZyYW1lICYmIHN0YWNrRW50cnktPm1faW5saW5l
Q2FsbEZyYW1lLT5raW5kID09IElubGluZUNhbGxGcmFtZTo6VGFpbENhbGwgJiYgKHN0YWNrRW50
cnkgPSBzdGFja0VudHJ5LT5tX2NhbGxlcikpOwogCiAgICAgLy8gVGhlIHRhaWwgY2FsbCB3YXMg
bm90IHJlY3Vyc2l2ZQogICAgIHJldHVybiBmYWxzZTsK
</data>

          </attachment>
      

    </bug>

</bugzilla>