[Bug tree-optimization/126458] [16/17 Regression] Wrong code with ((int)a)>0 ? (type1)a : CST since r16-4585

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

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[16/17 Regression] Wrong    |[16/17 Regression] Wrong
                   |code with ((int)a)>0 ?      |code with ((int)a)>0 ?
                   |(type1)a : CST              |(type1)a : CST since
                   |                            |r16-4585

--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
          widest_int c1 = wi::mask<widest_int>(TYPE_PRECISION (type) - 1, 0);

The problem is the wrong precision is used here. it should have been c1_type or
from_type.

This only shows up with precision which differ by 1 which is why it does not
show up more.

This bug was introduced with r16-4585-ga4e033fb51d566 .
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.