[Bug tree-optimization/126856] [17 Regression] mpfr and mpc started failing tests recently since r17-3204

"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=126856

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
            Summary|[17 Regression] mpfr and    |[17 Regression] mpfr and
                   |mpc started failing tests   |mpc started failing tests
                   |recently                    |recently since r17-3204
                 CC|                            |pinskia at gcc dot gnu.org
   Last reconfirmed|                            |2026-08-13

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

What is happening is we have:
  exp.0_1 = (unsigned int) exp_8(D);

Which gets recorded as:
Folding statement: exp.0_1 = (unsigned int) exp_8(D);
 Registering value_relation (exp.0_1 pe32 exp_8(D)) (bb2) at exp.0_1 =
(unsigned int) exp_8(D);


and then when the simple_dce happens we change the assignment to exp.0_1 to:

exp.0_1 = 0;

And then we look at:
Folding statement: _5 = (short unsigned int) exp_8(D);
 Registering value_relation (_5 pe16 exp_8(D)) (bb6) at _5 = (short unsigned
int) exp_8(D);
Queued stmt for removal.  Folds to: 0

Which is wrong.

So this is caused by r17-3204-ge02ce3b8c4574c.

Let me try to get a testcase without unions and fp.
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.