[Bug tree-optimization/126788] __builtin_convertvector upconvert + downconvert doesn't cancel out

"hjl.tools at gmail dot com via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126788

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2026-08-11
                 CC|                            |hjl.tools at gmail dot com
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
Add

/* (type) ((wide_type) a) -> a.  */
(simplify
 (convert (convert@1 @0))
  (if (ANY_INTEGRAL_TYPE_P (type)
       && ANY_INTEGRAL_TYPE_P (TREE_TYPE (@1))
       && types_match (type, TREE_TYPE (@0))
       && element_precision (type) < element_precision (TREE_TYPE (@1)))
   @0))

to match.pd works for me.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.