<?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>130500</bug_id>
          
          <creation_ts>2014-03-20 02:28:12 -0700</creation_ts>
          <short_desc>[ARM64] GCC generates wrong code with -O2 flag in WTF::weakCompareAndSwap</short_desc>
          <delta_ts>2015-06-15 06:08:23 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Template Framework</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Linux</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>
          
          <blocked>108645</blocked>
    
    <blocked>130506</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Gabor Rapcsanyi">rgabor</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>benjamin</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>commit-queue</cc>
    
    <cc>fpizlo</cc>
    
    <cc>oliver</cc>
    
    <cc>ossy</cc>
    
    <cc>zherczeg</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>992452</commentid>
    <comment_count>0</comment_count>
    <who name="Gabor Rapcsanyi">rgabor</who>
    <bug_when>2014-03-20 02:28:12 -0700</bug_when>
    <thetext>/tmp/cc2M6EGp.s:23: Error: the optional immediate offset can only be 0 at operand 2 -- `ldxr w3,[x29,28]&apos;
/tmp/cc2M6EGp.s:26: Error: the optional immediate offset can only be 0 at operand 3 -- `stxr w2,w1,[x29,28]&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>992453</commentid>
    <comment_count>1</comment_count>
    <who name="Gabor Rapcsanyi">rgabor</who>
    <bug_when>2014-03-20 02:37:55 -0700</bug_when>
    <thetext>Tried with: 
 gcc-linaro 4.8 (Aarch64)	4.8-2014.02	14.02

(http://www.linaro.org/downloads/)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>992454</commentid>
    <comment_count>2</comment_count>
      <attachid>227276</attachid>
    <who name="Gabor Rapcsanyi">rgabor</who>
    <bug_when>2014-03-20 02:38:35 -0700</bug_when>
    <thetext>Created attachment 227276
proposed fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>992455</commentid>
    <comment_count>3</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-03-20 02:40:21 -0700</bug_when>
    <thetext>Attachment 227276 did not pass style-queue:


ERROR: Source/WTF/wtf/Atomics.h:125:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:125:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:125:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:125:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:125:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:125:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:165:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:165:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:165:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:165:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 10 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>993738</commentid>
    <comment_count>4</comment_count>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2014-03-24 01:38:52 -0700</bug_when>
    <thetext>This refactor is also ok. I think all of these patches can be landed, if nobody has an objection.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>993794</commentid>
    <comment_count>5</comment_count>
      <attachid>227276</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2014-03-24 07:52:05 -0700</bug_when>
    <thetext>Comment on attachment 227276
proposed fix

Since the new constraints are incorrect and are just there to appease gcc, I would put them behind some #if&apos;s and keep the original code around. My recollection is that not using +m in a cas can also lead to code gen bugs in some compilers because the &quot;memory&quot; constraint isn&apos;t enough to make them see what&apos;s going on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>994120</commentid>
    <comment_count>6</comment_count>
      <attachid>227731</attachid>
    <who name="Gabor Rapcsanyi">rgabor</who>
    <bug_when>2014-03-25 02:50:24 -0700</bug_when>
    <thetext>Created attachment 227731
proposed patch v2

I put the changes between GCC guards.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>994121</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-03-25 02:53:22 -0700</bug_when>
    <thetext>Attachment 227731 did not pass style-queue:


ERROR: Source/WTF/wtf/Atomics.h:125:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:126:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:125:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:126:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:125:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:126:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:125:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:126:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:125:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:126:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:125:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:126:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:126:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:179:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:180:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:179:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:180:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:179:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:180:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:179:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:180:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/Atomics.h:180:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 22 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>994162</commentid>
    <comment_count>8</comment_count>
      <attachid>227731</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-03-25 07:13:34 -0700</bug_when>
    <thetext>Comment on attachment 227731
proposed patch v2

Clearing flags on attachment: 227731

Committed r166234: &lt;http://trac.webkit.org/changeset/166234&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>994163</commentid>
    <comment_count>9</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-03-25 07:13:38 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1101913</commentid>
    <comment_count>10</comment_count>
    <who name="Andreas Schwab">schwab</who>
    <bug_when>2015-06-15 06:08:23 -0700</bug_when>
    <thetext>The correct constraint is &quot;Q&quot;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>227276</attachid>
            <date>2014-03-20 02:38:35 -0700</date>
            <delta_ts>2014-03-25 02:50:24 -0700</delta_ts>
            <desc>proposed fix</desc>
            <filename>atomics_arm64.patch</filename>
            <type>text/plain</type>
            <size>1890</size>
            <attacher name="Gabor Rapcsanyi">rgabor</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XVEYvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9XVEYvQ2hh
bmdlTG9nCShyZXZpc2lvbiAxNjU4OTQpCisrKyBTb3VyY2UvV1RGL0NoYW5nZUxvZwkod29ya2lu
ZyBjb3B5KQpAQCA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AgICJsZHhyICV3MiwgJTBcblx0Igor
ICAgICAgICAibGR4ciAldzIsIFsleDBdXG5cdCIKICAgICAgICAgImNtcCAldzMsICV3MlxuXHQi
CiAgICAgICAgICJiLm5lIDBmXG5cdCIKLSAgICAgICAgInN0eHIgJXcxLCAldzQsICUwXG5cdCIK
KyAgICAgICAgInN0eHIgJXcxLCAldzQsIFsleDBdXG5cdCIKICAgICAgICAgIjA6IgotICAgICAg
ICA6ICIrbSIoKmxvY2F0aW9uKSwgIj0mciIocmVzdWx0KSwgIj0mciIodG1wKQorICAgICAgICA6
ICIrciIobG9jYXRpb24pLCAiPSZyIihyZXN1bHQpLCAiPSZyIih0bXApCiAgICAgICAgIDogInIi
KGV4cGVjdGVkKSwgInIiKG5ld1ZhbHVlKQogICAgICAgICA6ICJtZW1vcnkiKTsKICAgICByZXN1
bHQgPSAhcmVzdWx0OwpAQCAtMTU3LDEyICsxNTcsMTIgQEAgaW5saW5lIGJvb2wgd2Vha0NvbXBh
cmVBbmRTd2FwKHZvaWQqdm9sYQogICAgIHZvaWQqIHRtcDsKICAgICBhc20gdm9sYXRpbGUoCiAg
ICAgICAgICJtb3YgJXcxLCAjMVxuXHQiCi0gICAgICAgICJsZHhyICV4MiwgJTBcblx0IgorICAg
ICAgICAibGR4ciAleDIsIFsleDBdXG5cdCIKICAgICAgICAgImNtcCAleDMsICV4MlxuXHQiCiAg
ICAgICAgICJiLm5lIDBmXG5cdCIKLSAgICAgICAgInN0eHIgJXcxLCAleDQsICUwXG5cdCIKKyAg
ICAgICAgInN0eHIgJXcxLCAleDQsIFsleDBdXG5cdCIKICAgICAgICAgIjA6IgotICAgICAgICA6
ICIrbSIoKmxvY2F0aW9uKSwgIj0mciIocmVzdWx0KSwgIj0mciIodG1wKQorICAgICAgICA6ICIr
ciIobG9jYXRpb24pLCAiPSZyIihyZXN1bHQpLCAiPSZyIih0bXApCiAgICAgICAgIDogInIiKGV4
cGVjdGVkKSwgInIiKG5ld1ZhbHVlKQogICAgICAgICA6ICJtZW1vcnkiKTsKICAgICByZXR1cm4g
IXJlc3VsdDsK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>227731</attachid>
            <date>2014-03-25 02:50:24 -0700</date>
            <delta_ts>2014-03-25 07:13:33 -0700</delta_ts>
            <desc>proposed patch v2</desc>
            <filename>weak_compare_arm64.patch</filename>
            <type>text/plain</type>
            <size>1987</size>
            <attacher name="Gabor Rapcsanyi">rgabor</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XVEYvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9XVEYvQ2hh
bmdlTG9nCShyZXZpc2lvbiAxNjYyMjcpCisrKyBTb3VyY2UvV1RGL0NoYW5nZUxvZwkod29ya2lu
ZyBjb3B5KQpAQCAtMSwzICsxLDE1IEBACisyMDE0LTAzLTI1ICBHYWJvciBSYXBjc2FueWkgIDxy
Z2Fib3JAd2Via2l0Lm9yZz4KKworICAgICAgICBbQVJNNjRdIEdDQyBnZW5lcmF0ZXMgd3Jvbmcg
Y29kZSB3aXRoIC1PMiBmbGFnIGluIFdURjo6d2Vha0NvbXBhcmVBbmRTd2FwCisgICAgICAgIGh0
dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xMzA1MDAKKworICAgICAgICBS
ZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBTZXQgdGhlIGZpcnN0IG9wZXJh
bmQgdG8gdGhlIGV4YWN0IHJlZ2lzdGVyIGluIHRoZSBpbmxpbmUgYXNzZW1ibHkgd2l0aCBHQ0Mu
CisKKyAgICAgICAgKiB3dGYvQXRvbWljcy5oOgorICAgICAgICAoV1RGOjp3ZWFrQ29tcGFyZUFu
ZFN3YXApOgorCiAyMDE0LTAzLTI0ICBBbmR5IEV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HJlc3VsdDsKQEAgLTE1Miw2ICsxNjYsMjAgQEAgaW5saW5lIGJvb2wgd2Vha0NvbXBh
cmVBbmRTd2FwKHZvaWQqdm9sYQogICAgICAgICA6ICJtZW1vcnkiCiAgICAgICAgICk7CiAgICAg
cmV0dXJuIHJlc3VsdDsKKyNlbGlmIENQVShBUk02NCkgJiYgQ09NUElMRVIoR0NDKQorICAgIGJv
b2wgcmVzdWx0OworICAgIHZvaWQqIHRtcDsKKyAgICBhc20gdm9sYXRpbGUoCisgICAgICAgICJt
b3YgJXcxLCAjMVxuXHQiCisgICAgICAgICJsZHhyICV4MiwgWyUwXVxuXHQiCisgICAgICAgICJj
bXAgJXgzLCAleDJcblx0IgorICAgICAgICAiYi5uZSAwZlxuXHQiCisgICAgICAgICJzdHhyICV3
MSwgJXg0LCBbJTBdXG5cdCIKKyAgICAgICAgIjA6IgorICAgICAgICA6ICIrciIobG9jYXRpb24p
LCAiPSZyIihyZXN1bHQpLCAiPSZyIih0bXApCisgICAgICAgIDogInIiKGV4cGVjdGVkKSwgInIi
KG5ld1ZhbHVlKQorICAgICAgICA6ICJtZW1vcnkiKTsKKyAgICByZXR1cm4gIXJlc3VsdDsKICNl
bGlmIENQVShBUk02NCkKICAgICBib29sIHJlc3VsdDsKICAgICB2b2lkKiB0bXA7Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>