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 403
    • Issues 403
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #1316
Closed
Open
Created Jan 12, 2017 by Sven-Bodo Scholz@sbsOwner

conditionals are sometimes over-optimised

Bugzilla Link 1187
Created on Jan 12, 2017 16:27
Version svn
OS All
Architecture PC
Attachments sacprelude_d.sacbugreport

Extended Description

noinline int forever( int x)
{
  if( _eq_SxS_( x,0))
    res = forever(x);
  else
    res = 42;
  return res;
}
int main() {
  return forever( 0);
}
after optimisation yields 42 :-(
What happens is that the type of the function forever is computed as int{42}. The constant folder  reacts and throws the conditional away.....
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking