cse_main: Check for used symbols, workaround for #5331

This is a workaround or fix for #5331. Alternative to PR #7455