fix Issue 13504 - ICE(backend/cgelem.c 2418) with "-O -cov"

- assert failed because goal wasn't properly passed down
Merge pull request #4047 from MartinNowak/fix13504

fix Issue 13504 - ICE(backend/cgelem.c 2418) with "-O -cov"