Hi all,

Can gatekeeper help review bug943,
http://bugs.open64.net/show_bug.cgi?id=943. thanks.

Bug943 is the regression caused by r3875.
The common place of all failed cases are:
from the ouput .s file, there are following piece of code:
        sete %bl                        #
        movl %ebx,%eax                  #

That is a movl after "sete", the right form should be "movzbl %bl,%eax"
The checkin code of r3857 is as follows, it uses Exp_COPY instead of
Exp_COPY_Ext when size>2. But for instruction like "sete" it doesn't clear the
upper bits, obviously r3857 break the orignal fix for bug5621.
Modified: trunk/osprey/be/cg/lra.cxx
===================================================================
--- trunk/osprey/be/cg/lra.cxx  2011-12-26 08:44:54 UTC (rev 3856)
+++ trunk/osprey/be/cg/lra.cxx  2012-01-13 05:43:31 UTC (rev 3857)
@@ -5518,10 +5518,38 @@
    Set_OP_opnd( op, opnd_idx, result );

  } else {
+    if (TN_size(result) > 2)
+      Exp_COPY( opnd, result, &ops );
+    else
    // Do sign/zero extend instead of regular copy.  Needed for "sete" which
    // doesn't clear the upper bits.  Bug 5621.
-    Exp_COPY_Ext(TN_size(result) == 2 ? TOP_movzwl : TOP_movzbl,
-                opnd, result, &ops );
+      Exp_COPY_Ext(TN_size(result) == 2 ? TOP_movzwl : TOP_movzbl,
+                   opnd, result, &ops );
+
...


But the code Exp_COPY should not delte, for follwing case:
int main()
{
 int inc = 0xFF;
 asm volatile (
  "add $1, %0\n\t"
  : "+Q" (inc)
  :
  );
printf("inc=%d\n",inc);
}
if we use Exp_COPY_Ext to generate result, it will use TOP_movzbl to
store back the result, that will clear the upper 3 byte to 0.

To fix the problem, that do not break the two condition. I put the
code "Exp_COPY( opnd, result, &ops );" into inline asm condition.
The patch is attached.

Thanks
zhuqing

Attachment: bug943.patch
Description: Binary data

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to