https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116466
--- Comment #3 from cui xu <leidian900 at outlook dot com> --- (In reply to Jeffrey A. Law from comment #2) > Looking at this, I would fully expect that in an optimizing compilation that > the redundant extension would be eliminated. Are you seeing the redundant > sign extensions in the final assembly output or just in the intermediate RTL? > > If the former, can you attach a testcase? > > Thanks. I only see it in the intermediate RTL. In my tests, the optimization indeed removes the redundant extensions.