[ 
https://issues.apache.org/jira/browse/HADOOP-9707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13704135#comment-13704135
 ] 

Brian Bockelman commented on HADOOP-9707:
-----------------------------------------

Hi - 

This resulted in an incorrect result for me when I was incorporating this code 
into a separate (appropriately licensed, open-source) project.  I verified that 
the patch results in correct behavior.


To quote the GCC docs (http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html):
{quote}
Only a number in the constraint can guarantee that one operand is in the same 
place as another. The mere fact that foo is the value of both operands is not 
enough to guarantee that they are in the same place in the generated assembler 
code. The following does not work reliably:

     asm ("combine %2,%0" : "=r" (foo) : "r" (foo), "g" (bar));
{quote}

Hope this helps.
                
> Fix register lists for crc32c inline assembly
> ---------------------------------------------
>
>                 Key: HADOOP-9707
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9707
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 3.0.0, 2.1.0-beta
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Minor
>         Attachments: hadoop-9707.txt
>
>
> The inline assembly used for the crc32 instructions has an incorrect clobber 
> list: the computed CRC values are "in-out" variables and thus need to use the 
> "matching constraint" syntax in the clobber list.
> This doesn't seem to cause a problem now in Hadoop, but may break in a 
> different compiler version which allocates registers differently, or may 
> break when the same code is used in another context.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to