<?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>154535</bug_id>
          
          <creation_ts>2016-02-22 08:06:48 -0800</creation_ts>
          <short_desc>Workaround for ICE in GCC 4.8 appeared in r196846.</short_desc>
          <delta_ts>2016-02-22 12:04:21 -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>WebCore Misc.</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Konstantin Tokarev">annulen</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>commit-queue</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>ossy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1167017</commentid>
    <comment_count>0</comment_count>
    <who name="Konstantin Tokarev">annulen</who>
    <bug_when>2016-02-22 08:06:48 -0800</bug_when>
    <thetext>This is an exact error message:

../../../Source/WebCore/html/HTMLFormElement.cpp:876:1: internal compiler error: in output_index_string, at dwarf2out.c:21825
 } // namespace
 ^</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167022</commentid>
    <comment_count>1</comment_count>
      <attachid>271923</attachid>
    <who name="Konstantin Tokarev">annulen</who>
    <bug_when>2016-02-22 08:36:39 -0800</bug_when>
    <thetext>Created attachment 271923
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167039</commentid>
    <comment_count>2</comment_count>
      <attachid>271923</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-02-22 09:07:16 -0800</bug_when>
    <thetext>Comment on attachment 271923
Patch

Add a FIXME please!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167041</commentid>
    <comment_count>3</comment_count>
    <who name="Konstantin Tokarev">annulen</who>
    <bug_when>2016-02-22 09:13:56 -0800</bug_when>
    <thetext>What FIXME do you mean? equalLettersIgnoringASCIICase(..., &quot;off&quot;) where &quot;off&quot; is literal is used in many other places of this file, and I guess this form is a bit faster because literal needs not need is8Bit() check.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167043</commentid>
    <comment_count>4</comment_count>
      <attachid>271923</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2016-02-22 09:33:44 -0800</bug_when>
    <thetext>Comment on attachment 271923
Patch

No this is not right. It was meant to be off (without the quotes), referring to the local off variable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167048</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-02-22 09:37:02 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; No this is not right. It was meant to be off (without the quotes), referring
&gt; to the local off variable.

Surely equalLettersIgnoringASCIICase does not have different behavior depending on whether I pass a wtf::String or a literal?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167049</commentid>
    <comment_count>6</comment_count>
      <attachid>271923</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2016-02-22 09:37:04 -0800</bug_when>
    <thetext>Comment on attachment 271923
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=271923&amp;action=review

&gt; Source/WebCore/ChangeLog:7
&gt; +

The change log does not explain why this should be &quot;off&quot; instead of off. It seems valid to use off without quotes to me. It should end up calling:
inline bool equalIgnoringASCIICase(const AtomicString&amp; a, const String&amp; b);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167051</commentid>
    <comment_count>7</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2016-02-22 09:40:01 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; Comment on attachment 271923 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=271923&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/ChangeLog:7
&gt; &gt; +
&gt; 
&gt; The change log does not explain why this should be &quot;off&quot; instead of off. It
&gt; seems valid to use off without quotes to me. It should end up calling:
&gt; inline bool equalIgnoringASCIICase(const AtomicString&amp; a, const String&amp; b);

I don&apos;t think we do have a equalIgnoringASCIICase() overload that takes a literal. Therefore, if you pass &quot;off&quot; it likely calls:
inline bool equalIgnoringASCIICase(const String&amp; a, const char* b);

Which means we don&apos;t know the length of b in advance. If we pass a String in, the size of b is known in advance.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167056</commentid>
    <comment_count>8</comment_count>
    <who name="Konstantin Tokarev">annulen</who>
    <bug_when>2016-02-22 09:44:59 -0800</bug_when>
    <thetext>(In reply to comment #7)

&gt; I don&apos;t think we do have a equalIgnoringASCIICase() overload that takes a
&gt; literal. Therefore, if you pass &quot;off&quot; it likely calls:
&gt; inline bool equalIgnoringASCIICase(const String&amp; a, const char* b);
&gt; 
&gt; Which means we don&apos;t know the length of b in advance. If we pass a String
&gt; in, the size of b is known in advance.

I believe it calls

template&lt;unsigned length&gt; bool equalLettersIgnoringASCIICase(const StringImpl&amp;, const char (&amp;lowercaseLetters)[length]);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167065</commentid>
    <comment_count>9</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2016-02-22 10:09:22 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; 
&gt; &gt; I don&apos;t think we do have a equalIgnoringASCIICase() overload that takes a
&gt; &gt; literal. Therefore, if you pass &quot;off&quot; it likely calls:
&gt; &gt; inline bool equalIgnoringASCIICase(const String&amp; a, const char* b);
&gt; &gt; 
&gt; &gt; Which means we don&apos;t know the length of b in advance. If we pass a String
&gt; &gt; in, the size of b is known in advance.
&gt; 
&gt; I believe it calls
&gt; 
&gt; template&lt;unsigned length&gt; bool equalLettersIgnoringASCIICase(const
&gt; StringImpl&amp;, const char (&amp;lowercaseLetters)[length]);

oh, I did indeed miss the one taking a literal:
template&lt;unsigned length&gt; inline bool equalLettersIgnoringASCIICase(const AtomicString&amp; string, const char (&amp;lowercaseLetters)[length]);

That said, it does not explain why the previous code does not work in GCC. It seems perfectly legal to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167074</commentid>
    <comment_count>10</comment_count>
    <who name="Konstantin Tokarev">annulen</who>
    <bug_when>2016-02-22 10:28:29 -0800</bug_when>
    <thetext>(In reply to comment #9)

&gt; That said, it does not explain why the previous code does not work in GCC.
&gt; It seems perfectly legal to me.

That&apos;s hard to explain internal compiler errors. If you are interested I&apos;ll prepare reduced test case which should reveal broken C++ construction.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167079</commentid>
    <comment_count>11</comment_count>
      <attachid>271923</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2016-02-22 10:38:01 -0800</bug_when>
    <thetext>Comment on attachment 271923
Patch

Ok to unbreak you and because equalIgnoringASCIICase() has a literal taking an override. However, I wish we understood the problem a bit better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167102</commentid>
    <comment_count>12</comment_count>
      <attachid>271923</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-02-22 11:26:45 -0800</bug_when>
    <thetext>Comment on attachment 271923
Patch

Clearing flags on attachment: 271923

Committed r196946: &lt;http://trac.webkit.org/changeset/196946&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167103</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-02-22 11:26:50 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167126</commentid>
    <comment_count>14</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-02-22 12:04:21 -0800</bug_when>
    <thetext>(In reply to comment #11)
&gt; Comment on attachment 271923 [details]
&gt; Patch
&gt; 
&gt; Ok to unbreak you and because equalIgnoringASCIICase() has a literal taking
&gt; an override. However, I wish we understood the problem a bit better.

To be clear, it&apos;s a GCC bug causing some obsolete version of GCC to crash (ICE = internal compiler error), and this modification is a workaround for that crash. It&apos;d be reasonable to accept the patch (it&apos;s a one-liner that adds support for a new compiler) or reject it (it&apos;s a workaround for a compiler we technically don&apos;t support anymore), I&apos;d err on the side of accept... which you did.

(In reply to comment #8)
&gt; I believe it calls
&gt; 
&gt; template&lt;unsigned length&gt; bool equalLettersIgnoringASCIICase(const
&gt; StringImpl&amp;, const char (&amp;lowercaseLetters)[length]);

Wow! This is quite esoteric C++, the only time I ever saw this syntax was in a trivia question... array parameters are normally just pointers, but for templates it&apos;s not necessarily true!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>271923</attachid>
            <date>2016-02-22 08:36:39 -0800</date>
            <delta_ts>2016-02-22 11:26:45 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-154535-20160222193620.patch</filename>
            <type>text/plain</type>
            <size>1448</size>
            <attacher name="Konstantin Tokarev">annulen</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTk2OTM0CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggOGRlMTg4ODgzZWE0MTRj
ZjA3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