/* cris and mn10300 -O2 */ foo (float *c) { union { float r; unsigned int i; } e; e.r = c[0]; if (e.i < 0x3f7f0000) return (e.r = e.r / 2.0f, e.i); return ((int) e.i < 0) ? 0 : 255; } Probably this is a duplicate too for vax: int a, b; int baz (short x) { return x; } int bar (int x) { if (baz (a ^ x ^ a)) return b; return 0; } int foo (void) { return bar (a == 0 || 1 == 1 - a) ? 1 : bar (1 && a); }
Is this a cond-optab regression or "just" an observation?
Subject: Re: [cond-optab] CSE does not put subregs into COMPAREs on many CC0 machines > Is this a cond-optab regression or "just" an observation? Yes, it causes extra moves on code using unions. Where we have r20:SI=r19:SF#0 where X#0 = (subreg X 0) cc0=r20:SI is now r20:SI=r19:SF#0 cc0=cmp(r20:SI,0) and CSE is somehow not able to turn it into cc0=cmp(r19:SF#0,0)
Fixed by the new SRA thanks to its usage of VIEW_CONVERT_EXPR at the tree level.