{"action":"created","issue":{"url":"https://api.github.com/repos/DaGenix/rust-crypto/issues/308","labels_url":"https://api.github.com/repos/DaGenix/rust-crypto/issues/308/labels{/name}","comments_url":"https://api.github.com/repos/DaGenix/rust-crypto/issues/308/comments","events_url":"https://api.github.com/repos/DaGenix/rust-crypto/issues/308/events","html_url":"https://github.com/DaGenix/rust-crypto/pull/308","id":91464706,"number":308,"title":"Prevent GCC from removing inline assembly","user":{"login":"andreasots","id":104879,"avatar_url":"https://avatars.githubusercontent.com/u/104879?v=3","gravatar_id":"","url":"https://api.github.com/users/andreasots","html_url":"https://github.com/andreasots","followers_url":"https://api.github.com/users/andreasots/followers","following_url":"https://api.github.com/users/andreasots/following{/other_user}","gists_url":"https://api.github.com/users/andreasots/gists{/gist_id}","starred_url":"https://api.github.com/users/andreasots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreasots/subscriptions","organizations_url":"https://api.github.com/users/andreasots/orgs","repos_url":"https://api.github.com/users/andreasots/repos","events_url":"https://api.github.com/users/andreasots/events{/privacy}","received_events_url":"https://api.github.com/users/andreasots/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-27T13:33:18Z","updated_at":"2015-10-17T06:46:12Z","closed_at":"2015-10-17T06:45:53Z","pull_request":{"url":"https://api.github.com/repos/DaGenix/rust-crypto/pulls/308","html_url":"https://github.com/DaGenix/rust-crypto/pull/308","diff_url":"https://github.com/DaGenix/rust-crypto/pull/308.diff","patch_url":"https://github.com/DaGenix/rust-crypto/pull/308.patch"},"body":"Disassembly of `rust_crypto_aesni_setup_working_key_128` on master:\r\n```\r\n0000000000000000 <rust_crypto_aesni_setup_working_key_128>:\r\n   0:   55                      push   %rbp\r\n   1:   48 89 e5                mov    %rsp,%rbp\r\n   4:   48 81 ec 30 10 00 00    sub    $0x1030,%rsp\r\n   b:   48 83 0c 24 00          orq    $0x0,(%rsp)\r\n  10:   48 81 c4 20 10 00 00    add    $0x1020,%rsp\r\n  17:   64 48 8b 04 25 28 00    mov    %fs:0x28,%rax\r\n  1e:   00 00 \r\n  20:   48 89 45 f8             mov    %rax,-0x8(%rbp)\r\n  24:   31 c0                   xor    %eax,%eax\r\n  26:   48 8b 45 f8             mov    -0x8(%rbp),%rax\r\n  2a:   64 48 33 04 25 28 00    xor    %fs:0x28,%rax\r\n  31:   00 00 \r\n  33:   75 02                   jne    37 <rust_crypto_aesni_setup_working_key_128+0x37>\r\n  35:   c9                      leaveq \r\n  36:   c3                      retq   \r\n  37:   e8 00 00 00 00          callq  3c <rust_crypto_aesni_setup_working_key_128+0x3c>\r\n```\r\nNote that the inline assembly has been optimized out.\r\n\r\nFixed:\r\n```\r\n0000000000000000 <rust_crypto_aesni_setup_working_key_128>:\r\n   0:   55                      push   %rbp\r\n   1:   48 89 e5                mov    %rsp,%rbp\r\n   4:   48 81 ec 30 10 00 00    sub    $0x1030,%rsp\r\n   b:   48 83 0c 24 00          orq    $0x0,(%rsp)\r\n  10:   48 81 c4 20 10 00 00    add    $0x1020,%rsp\r\n  17:   64 48 8b 04 25 28 00    mov    %fs:0x28,%rax\r\n  1e:   00 00 \r\n  20:   48 89 45 f8             mov    %rax,-0x8(%rbp)\r\n  24:   31 c0                   xor    %eax,%eax\r\n  26:   f3 0f 6f 0f             movdqu (%rdi),%xmm1\r\n  2a:   f3 0f 7f 0e             movdqu %xmm1,(%rsi)\r\n  2e:   48 83 c6 10             add    $0x10,%rsi\r\n  32:   66 0f 3a df d1 01       aeskeygenassist $0x1,%xmm1,%xmm2\r\n  38:   e8 65 00 00 00          callq  a2 <rust_crypto_aesni_setup_working_key_128+0xa2>\r\n  3d:   66 0f 3a df d1 02       aeskeygenassist $0x2,%xmm1,%xmm2\r\n  43:   e8 5a 00 00 00          callq  a2 <rust_crypto_aesni_setup_working_key_128+0xa2>\r\n  48:   66 0f 3a df d1 04       aeskeygenassist $0x4,%xmm1,%xmm2\r\n  4e:   e8 4f 00 00 00          callq  a2 <rust_crypto_aesni_setup_working_key_128+0xa2>\r\n  53:   66 0f 3a df d1 08       aeskeygenassist $0x8,%xmm1,%xmm2\r\n  59:   e8 44 00 00 00          callq  a2 <rust_crypto_aesni_setup_working_key_128+0xa2>\r\n  5e:   66 0f 3a df d1 10       aeskeygenassist $0x10,%xmm1,%xmm2\r\n  64:   e8 39 00 00 00          callq  a2 <rust_crypto_aesni_setup_working_key_128+0xa2>\r\n  69:   66 0f 3a df d1 20       aeskeygenassist $0x20,%xmm1,%xmm2\r\n  6f:   e8 2e 00 00 00          callq  a2 <rust_crypto_aesni_setup_working_key_128+0xa2>\r\n  74:   66 0f 3a df d1 40       aeskeygenassist $0x40,%xmm1,%xmm2\r\n  7a:   e8 23 00 00 00          callq  a2 <rust_crypto_aesni_setup_working_key_128+0xa2>\r\n  7f:   66 0f 3a df d1 80       aeskeygenassist $0x80,%xmm1,%xmm2\r\n  85:   e8 18 00 00 00          callq  a2 <rust_crypto_aesni_setup_working_key_128+0xa2>\r\n  8a:   66 0f 3a df d1 1b       aeskeygenassist $0x1b,%xmm1,%xmm2\r\n  90:   e8 0d 00 00 00          callq  a2 <rust_crypto_aesni_setup_working_key_128+0xa2>\r\n  95:   66 0f 3a df d1 36       aeskeygenassist $0x36,%xmm1,%xmm2\r\n  9b:   e8 02 00 00 00          callq  a2 <rust_crypto_aesni_setup_working_key_128+0xa2>\r\n  a0:   eb 2d                   jmp    cf <rust_crypto_aesni_setup_working_key_128+0xcf>\r\n  a2:   66 0f 70 d2 ff          pshufd $0xff,%xmm2,%xmm2\r\n  a7:   c5 e1 73 f9 04          vpslldq $0x4,%xmm1,%xmm3\r\n  ac:   66 0f ef cb             pxor   %xmm3,%xmm1\r\n  b0:   c5 e1 73 f9 04          vpslldq $0x4,%xmm1,%xmm3\r\n  b5:   66 0f ef cb             pxor   %xmm3,%xmm1\r\n  b9:   c5 e1 73 f9 04          vpslldq $0x4,%xmm1,%xmm3\r\n  be:   66 0f ef cb             pxor   %xmm3,%xmm1\r\n  c2:   66 0f ef ca             pxor   %xmm2,%xmm1\r\n  c6:   f3 0f 7f 0e             movdqu %xmm1,(%rsi)\r\n  ca:   48 83 c6 10             add    $0x10,%rsi\r\n  ce:   c3                      retq   \r\n  cf:   48 8b 45 f8             mov    -0x8(%rbp),%rax\r\n  d3:   64 48 33 04 25 28 00    xor    %fs:0x28,%rax\r\n  da:   00 00 \r\n  dc:   75 02                   jne    e0 <rust_crypto_aesni_setup_working_key_128+0xe0>\r\n  de:   c9                      leaveq \r\n  df:   c3                      retq   \r\n  e0:   e8 00 00 00 00          callq  e5 <rust_crypto_aesni_setup_working_key_128+0xe5>\r\n```\r\n\r\nFixes #295. Fixes #305."},"comment":{"url":"https://api.github.com/repos/DaGenix/rust-crypto/issues/comments/148891256","html_url":"https://github.com/DaGenix/rust-crypto/pull/308#issuecomment-148891256","issue_url":"https://api.github.com/repos/DaGenix/rust-crypto/issues/308","id":148891256,"user":{"login":"DaGenix","id":2101211,"avatar_url":"https://avatars.githubusercontent.com/u/2101211?v=3","gravatar_id":"","url":"https://api.github.com/users/DaGenix","html_url":"https://github.com/DaGenix","followers_url":"https://api.github.com/users/DaGenix/followers","following_url":"https://api.github.com/users/DaGenix/following{/other_user}","gists_url":"https://api.github.com/users/DaGenix/gists{/gist_id}","starred_url":"https://api.github.com/users/DaGenix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaGenix/subscriptions","organizations_url":"https://api.github.com/users/DaGenix/orgs","repos_url":"https://api.github.com/users/DaGenix/repos","events_url":"https://api.github.com/users/DaGenix/events{/privacy}","received_events_url":"https://api.github.com/users/DaGenix/received_events","type":"User","site_admin":false},"created_at":"2015-10-17T06:46:12Z","updated_at":"2015-10-17T06:46:12Z","body":"Thanks.\r\n\r\nSorry for taking so long to get to this."}}