Hi! On Tue, May 26, 2020 at 03:45:05AM +0000, Yangfei (Felix) wrote: > > > I am using Outlook and I didn't find the place to change the MIME type > > > : - ( > > > > The simplest option is to use a different email client, one that plays > > nicely > > with others. You use git, maybe you could even use git-send-email? > > The bad news is that it would be hard to switch to a different email client > with my company's IT policy :-( > But I think I can ask IT if that is possible. Sorry for the trouble.
Yes, please try to get this sorted somehow. Maybe you can ask other people in your company that have this same problem? > > > + new_rtx = gen_rtx_AND (mode, new_rtx, > > > + gen_int_mode (mask << real_pos, mode)); > > > + } > > > > So this changes > > ((X >> C) & M) == ... > > to > > (X & (M << C)) == ... > > ? > > > > Where then does it check what ... is? This is only valid like this if that > > is zero. > > > > Why should this go in combine and not in simplify-rtx instead? > > True. This is only valid when ... is zero. > That's why we need the "&& equality_comparison " condition here. But that doesn't test if the other side of the comparison is 0. > > > --- /dev/null > > > +++ b/gcc/testsuite/gcc.dg/pr94026.c > > > @@ -0,0 +1,21 @@ > > > +/* { dg-do compile { target aarch64*-*-* i?86-*-* x86_64-*-* } } */ > > > > Why restrict this to only some targets? > > That's because I only have these targets for verification. > But I think this can work on other targets. Removed from the v4 patch. > Could you please help check the other ports? In general, you should never restrict anything to some targets simply because you haven't tested it on other targets. If it is a good test it will just work on those other targets. Traffic on gcc-testresults@ will show you if it actually does. > > > +/* { dg-options "-O2 -fdump-rtl-combine" } */ > > > + > > > +int > > > +foo (int c) > > > +{ > > > + int a = (c >> 8) & 7; > > > + > > > + if (a >= 2) { > > > + return 1; > > > + } > > > + > > > + return 0; > > > +} > > > + > > > +/* The combine phase should transform (compare (and (lshiftrt x 8) 6) 0) > > > + to (compare (and (x 1536)) 0). We look for the *attempt* to match this > > > + RTL pattern, regardless of whether an actual insn may be found on the > > > + platform. */ > > > + > > > +/* { dg-final { scan-rtl-dump "\\(const_int 1536" "combine" } } */ > > > > That is a very fragile test. > > For this specific test case, (const_int 1536) is calculated from > subexpression (M << C) in (X & (M << C)). > I also see some similar checkings in gcc.dg/asr_div1.c. Suggesions? Maybe it is better to test that the non-optimal code you saw before is not generated anymore? That could be a target-specific test of course. The advantage is that the test will not break for all kinds of unrelated reasons (like this test) -- that simply does not scale with the number of tests we have. Segher