Hello, all

Can gatekeeper review the patch to bug #544 for me please? Thank you.

Bug #544 is caused by bitwise dead code elimniation (BDCE) in WOPT. It
happens with -m32 -O2 (or -O3 but not -O0). The test case looks like
follows:

int sy(unsigned long a)
{
   unsigned long j4;
   long tmp;
   j4=a+(a&0x5555555555555555)>>0x1;
   return j4&0x44;
}

Before BDCE, the expression a&0x5555555555555555 is converted into:

>      LDID U8 U8 sym5v2 50 ty=502  <u=2 cr17> flags:0x0 b=-1
>      LDC I8 6148914691236517205 <u=0 cr5> flags:0x0 b=-1
>     I8BAND <u=1 cr18> isop_flags:0xc0040 flags:0x1 b=E1

Now, the expression j4&0x44 causes BDCE to mark only the 2nd and 6th
bit being live for j4. Going backward,
j4=(a+a&0x5555555555555555)>>0x1 causes BDCE think only the first byte
of a&0x5555555555555555 is live. Based on this information, BDCE think
we can use converted the I8BAND (with both operand type and result
type being 64-bit long) to I4BAND (with both operand type and result
type being 32-bit long). However, in this case, both of the result
type of I8BAND's children can not be shortened to 32-bit long. So, we
can not do this I8BAND -> I4BAND transformation in this case.

-- Feng

Attachment: bug544.patch
Description: Binary data

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to