[Bug tree-optimization/87186] Does not inline constant to simplify bitwise expression
mcccs at gmx dot com
gcc-bugzilla@gcc.gnu.org
Mon Sep 3 06:21:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87186
--- Comment #4 from MCCCS <mcccs at gmx dot com> ---
Flags: -O2 -fdump-tree-original
Code:
int f1 (int x, int s) {
return ~(~(x|s)|x)|~(~(x|s)|s);
}
int f2 (int x, int s) {
const int t = x|s;
return ~(~t|x)|~(~t|s);
}
int f3 (int x, int s) {
const int t = ~(x|s);
return ~(t|x)|~(t|s);
}
int f4 (int x, int s) {
const int t = ~x&~s;
return ~(t|x)|~(t|s);
}
Tree output (f1 has the expected output, others
should have had the same output):
;; Function f1 (null)
;; enabled by -tree-original
{
return s ^ x;
}
;; Function f2 (null)
;; enabled by -tree-original
{
const int t = x | s;
const int t = x | s;
return ~((int) ~t | x & s);
}
;; Function f3 (null)
;; enabled by -tree-original
{
const int t = ~(x | s);
const int t = ~(x | s);
return ~(x & s | (int) t);
}
;; Function f4 (null)
;; enabled by -tree-original
{
const int t = ~(x | s);
const int t = ~(x | s);
return ~(x & s | (int) t);
}
More information about the Gcc-bugs
mailing list