{"action":"created","issue":{"url":"https://api.github.com/repos/cc65/cc65/issues/769","repository_url":"https://api.github.com/repos/cc65/cc65","labels_url":"https://api.github.com/repos/cc65/cc65/issues/769/labels{/name}","comments_url":"https://api.github.com/repos/cc65/cc65/issues/769/comments","events_url":"https://api.github.com/repos/cc65/cc65/issues/769/events","html_url":"https://github.com/cc65/cc65/issues/769","id":367076007,"node_id":"MDU6SXNzdWUzNjcwNzYwMDc=","number":769,"title":"[goto] Innocent goto takes more memory now","user":{"login":"Fabrizio-Caruso","id":29057615,"node_id":"MDQ6VXNlcjI5MDU3NjE1","avatar_url":"https://avatars3.githubusercontent.com/u/29057615?v=4","gravatar_id":"","url":"https://api.github.com/users/Fabrizio-Caruso","html_url":"https://github.com/Fabrizio-Caruso","followers_url":"https://api.github.com/users/Fabrizio-Caruso/followers","following_url":"https://api.github.com/users/Fabrizio-Caruso/following{/other_user}","gists_url":"https://api.github.com/users/Fabrizio-Caruso/gists{/gist_id}","starred_url":"https://api.github.com/users/Fabrizio-Caruso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fabrizio-Caruso/subscriptions","organizations_url":"https://api.github.com/users/Fabrizio-Caruso/orgs","repos_url":"https://api.github.com/users/Fabrizio-Caruso/repos","events_url":"https://api.github.com/users/Fabrizio-Caruso/events{/privacy}","received_events_url":"https://api.github.com/users/Fabrizio-Caruso/received_events","type":"User","site_admin":false},"labels":[{"id":32846635,"node_id":"MDU6TGFiZWwzMjg0NjYzNQ==","url":"https://api.github.com/repos/cc65/cc65/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2018-10-05T06:26:08Z","updated_at":"2018-10-14T12:37:59Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I have followed the recent goto fixes.\r\nIt seems that this has a negative effect on innocent goto's:\r\n```c\r\nif(oneMissileLevel())\r\n{\r\n\tif(bulletPtr->_x==XSize-1 && bulletPtr->_y==YSize/2 && rightHorizontalMissile._status)\r\n\t{\r\n\t\tgoto _destroy; // destroyHorizontalMissile(&rightHorizontalMissile);\r\n\t}\r\n}\t\t\t\t\r\nelse if(missileLevel() || bossLevel())\r\n{\r\n\tif(bulletPtr->_x==XSize-1 && bulletPtr->_y==HORIZONTAL_MISSILE_OFFSET && rightHorizontalMissile._status)\r\n\t{\r\n_destroy:\tdestroyHorizontalMissile(&rightHorizontalMissile);\t\r\n\t}\r\n\telse if(bulletPtr->_x==0 && bulletPtr->_y==YSize-1-HORIZONTAL_MISSILE_OFFSET && leftHorizontalMissile._status)\r\n\t{\r\n\t\tdestroyHorizontalMissile(&leftHorizontalMissile);\t\r\n\t}\r\n}\r\n```\r\nPreviously, inserting a goto was beneficial in terms of code size. It is now detrimental.\r\nThe difference between the previous code size and the current one is 13 extra bytes for the binary compiled with post-goto-fixed CC65 versions."},"comment":{"url":"https://api.github.com/repos/cc65/cc65/issues/comments/429623051","html_url":"https://github.com/cc65/cc65/issues/769#issuecomment-429623051","issue_url":"https://api.github.com/repos/cc65/cc65/issues/769","id":429623051,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTYyMzA1MQ==","user":{"login":"Fabrizio-Caruso","id":29057615,"node_id":"MDQ6VXNlcjI5MDU3NjE1","avatar_url":"https://avatars3.githubusercontent.com/u/29057615?v=4","gravatar_id":"","url":"https://api.github.com/users/Fabrizio-Caruso","html_url":"https://github.com/Fabrizio-Caruso","followers_url":"https://api.github.com/users/Fabrizio-Caruso/followers","following_url":"https://api.github.com/users/Fabrizio-Caruso/following{/other_user}","gists_url":"https://api.github.com/users/Fabrizio-Caruso/gists{/gist_id}","starred_url":"https://api.github.com/users/Fabrizio-Caruso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fabrizio-Caruso/subscriptions","organizations_url":"https://api.github.com/users/Fabrizio-Caruso/orgs","repos_url":"https://api.github.com/users/Fabrizio-Caruso/repos","events_url":"https://api.github.com/users/Fabrizio-Caruso/events{/privacy}","received_events_url":"https://api.github.com/users/Fabrizio-Caruso/received_events","type":"User","site_admin":false},"created_at":"2018-10-14T12:37:59Z","updated_at":"2018-10-14T12:37:59Z","author_association":"CONTRIBUTOR","body":"I understand that are some extra 2 byte overhead left on top of the jmp (which I don't see as an overhead in 99% of the cases).\r\nMoreover I am not able to understand why this is done as a sort of post-processing optimization and the innocent goto cannot be detected before the stack adjustment is inserted. I guess this is done this way, because it is easier to implement this way.\r\n"}}
{"actor":{"display_login":"Fabrizio-Caruso"}}