Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 401
    • Issues 401
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #1272
Closed
Open
Created Oct 03, 2013 by Robert Bernecky@rbeDeveloper

WRCI with -dopra allows array reuse on same-partition indexing

Bugzilla Link 1095
Created on Oct 03, 2013 19:47
Version svn
OS Linux
Architecture PC
Attachments bug980.breaks.sac, wrciOffsetTooSmall.sac

Extended Description

Created an attachment (id=990)
source code to reproduce fault
Indexed references within a modarray that refer to the current
partition should prohibit array reuse. Compiling with -dopra,
however, thinks it can operate in place. This causes
wrong answers in the wrci unit test bug980.breaks.sac
and also can be seen here:
sac@rattler:~/sac/testsuite/optimizations/wrci$ sac2c wrciOffsetTooSmall.sac -v1 -dopra -bopt:wrci  -nowlf |grep RC
      modarray( AAA ,RC(AAA)); 
sac@rattler:~/sac/testsuite/optimizations/wrci$ sac2c wrciOffsetTooSmall.sac -v1  -bopt:wrci |grep RC
sac@rattler:~/sac/testsuite/optimizations/wrci$ cat wrciOffsetTooSmall.sac /*
 * Attempt to unit test RWO (Reuse With Offset), based 
 * on zero documentation in the C code.
 *
 * AAA should NOT be a datareuse candidate, because
 * the index offset refers to data in the same partition.
 * See RWOprf for this case.
 *
 */
/* RESULT: RC(AAA) 0 0 */
use Array: all;
int main()
{
   AAA = _reshape_VxA_( [ 25, 10], iota( 250));
   AAA = with {
          ([0,0] <= iv < [10,10]): AAA[iv + [ 9, 0]] + 1000;
         } : modarray(AAA);
   //StdIO::print(AAA);
   z = sum( AAA);
   //StdIO::print(z);
   z = _sub_SxS_( z, 140125);
   return( z);
}
sac@rattler:~/sac/testsuite/optimizations/wrci$ sac2c -V
sac2c v1.00-beta (Haggis And Apple)
 product rev 18312 linux-gnu_x86_64
 (Thu Oct  3 14:40:19 EDT 2013 by sac)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking