cse_main: Check for used symbols, workaround for #5331

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