Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • 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 336
    • Issues 336
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Infrastructure Registry
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2136

Closed
Open
Created Jun 19, 2003 by Dietmar Kreye@dkrGuest

wrong code generation for reshape

Bugzilla Link 20
Created on Jun 19, 2003 14:28
Resolution FIXED
Resolved on Dec 01, 2003 19:09
Version 1.00beta
OS All
Architecture All
Attachments bug.sac

Extended Description

The compiler backend generates wrong code the primitive operation reshape().
Example:
  B = reshape( sv, A)
If the rc of A is 1 (A is the last reference of the array) B can reuse the data
vector of A. For the time being the following code is generated:
  CHECK_REUSE( B, A)
    ALLOC_BEGIN( B, ...)
      PRF_RESHAPE__SHAPE( B, ...)
    ALLOC_END( B, ...)
  INC_RC( B)
  IS_NOT_REUSED( B, A)
    COPY_DATA( B, A)
The problem is about the CHECK_REUSE icm which is defined as follows:
  if (RC(B) == 1)
    ASSIGN( B, A)
  else
    /* allocation of B */
Unfortunately, ASSIGN is not correct here since A and B may have incompatible
descriptors! Instead, the following code should be generated:
  if (RC(B) == 1)
    ASSIGN_DESC( B, A)
    ASSIGN_DATA( B, A)
    PRF_RESHAPE__DIM( B, ...)
    PRF_RESHAPE__SHAPE( B, ...)
  else
    ALLOC_BEGIN( B, ...)
      PRF_RESHAPE__SHAPE( B, ...)
    ALLOC_END( B, ...)
  INC_RC( B)
  IS_NOT_REUSED( B, A)
    COPY_DATA( B, A)
or:
  if (RC(B) == 1)
    ASSIGN_DESC( B, A)
  else
    ALLOC_BEGIN( B, ...)
      PRF_RESHAPE__SHAPE( B, ...)
    ALLOC_END( B, ...)
  INC_RC( B)
  IS_REUSED( B, A)
    PRF_RESHAPE__DIM( B, ...)
    PRF_RESHAPE__SHAPE( B, ...)
    ASSIGN_DATA( B, A)
  ELSE
    COPY_DATA( B, A)
A SAC program for reproducing the bug will be given as attachment.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking