Could I get a code review for bug fix to bug 815?

https://bugs.open64.net/show_bug.cgi?id=815

Attached patch file causes no new failures with the open64 regression suite. I 
have also tested with the h264 program as filed in the bug report -- base/peak 
with ref data and other SPECCPU2006 (no new failures with -O3 and -apo).

The problem here is specific to MP regions that contain somewhat advanced 
reductions.

The code that causes the assert is SYMBOL(WN_array_base(WN_kid0(wn)) in 
"osprey/be/lno/minvariant.cxx". Here a symbol is requested but the WN_opcode 
does not have the sym PROPERTY. The WN_opcode of array base is actually an ADD. 
Similar issue is in line 4418 in "osprey/be/com/wn_mp.cxx" when this reduction 
is localized. Here WN_st is accessed on the address computing ADD node. The 
computed NULL value causes a SEGV downstream in the call chain. To cause this 
error apply the patch only to "osprey/be/lno/minvariant.cxx". My fix is to 
ignore the reductions which do not have the sym property in the MP region.

Here is the dump of reduction tree that causes the issues:

   U8U8LDID 0 <1,51,stats> T<57,anon_ptr.,8>
   U4INTCONST 400 (0x190)
  U8ADD
  U4INTCONST 10 (0xa)
   I4I4LDID 0 <2,8,_temp__ubtmp0> T<4,.predef_I4,4>
  U8I4CVT
 U8ARRAY 1 4
XPRAGMA 1 52 <null-st> # REDUCTION {line: 1/25}

I have also attached the simplified test case.

Best wishes,
Ram
Open source compiler engineering
Advanced micro devices

Attachment: bug_815_diff.patch
Description: bug_815_diff.patch

typedef unsigned char byte;
typedef struct
{
  int   bit_use_mode        [10][10]; 
  int   bit_use_stuffingBits[10];
} StatParameters;

typedef struct
{
  int type;
} ImageParameters;

extern StatParameters  *stats;
extern ImageParameters *img;

int RBSPtoEBSP(byte *streamBuffer, int begin_bytepos, int end_bytepos, int 
min_num_bytes)
{

  int i, j ;

  while (j < begin_bytepos+min_num_bytes) {
    streamBuffer[j+2] = 0x03;
    j += 3;
    stats->bit_use_stuffingBits[img->type]+=16;
  }

  return j;
}

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to