[Bug tree-optimization/107765] missing (int)-(unsigned)int_val to just -int_val if int_val is known not to contain INT_MIN

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

--- Comment #7 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Note:
```

+        tree stype = signed_type_for (type);
+       auto minvalue = wi::min_value (stype);
+       int_range_max valid_range (TREE_TYPE (@0), minvalue, minvalue);
+       vr.intersect (valid_range);
+       /* If the range does not include min value,
+          then we can do this change around. */
+       if (vr.undefined_p ())
+         contains_signed_min = false;
```

can be simplified down to just:
tree stype = signed_type_for (type);
if (vrp.contains_p (wi::min_value (stype)))

I don't know why I didn't do that before. anyways Learning more about ranges in
those years now.
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.