[Bug tree-optimization/87186] Does not inline constant to simplify bitwise expression

2018-09-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87186 Richard Biener changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug tree-optimization/87186] Does not inline constant to simplify bitwise expression

2018-09-03 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87186 --- Comment #6 from Marc Glisse --- In some sense, the bug is that .original is optimized at all, ideally it would be the "original" unoptimized code. It is convenient to start optimizing single expressions early, so we do it, but that's it.

[Bug tree-optimization/87186] Does not inline constant to simplify bitwise expression

2018-09-02 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87186 --- Comment #5 from Andrew Pinski --- Right, original is not the one to look at really. There are more passes later on that will optimize it using the patterns that optimized the original one.

[Bug tree-optimization/87186] Does not inline constant to simplify bitwise expression

2018-09-02 Thread mcccs at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87186 --- Comment #4 from MCCCS --- 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); r

[Bug tree-optimization/87186] Does not inline constant to simplify bitwise expression

2018-09-02 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87186 --- Comment #3 from Andrew Pinski --- Can you provide a full testcase that can compile?

[Bug tree-optimization/87186] Does not inline constant to simplify bitwise expression

2018-09-02 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87186 --- Comment #2 from Marc Glisse --- How did you check? Looking at the .optimized dump or the asm, it is optimized to a simple xor.

[Bug tree-optimization/87186] Does not inline constant to simplify bitwise expression

2018-09-01 Thread mcccs at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87186 --- Comment #1 from MCCCS --- It can simplify ~(~(x|s)|x)|~(~(x|s)|s) to s^x but it can't simplify const int t = x|s; ~(~t|x)|~(~t|s) or const int t = ~(x|s); ~(t|x)|~(t|s) or const int t = ~x&~s; ~(t|x)|~(t|s)