This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[GSoC] constant-folding pattern not fired


Hi,
   Apparently this pattern is not getting fired (even in isolation).

/* x % 1 -> 0 */
(simplify
  (trunc_mod @0 integer_onep)
  { build_zero_cst (type); })

I tried with this test-case:
int f(int x)
{
  int t1 = 1;
  int t2 = x % t1;
  return t2;
}

I get the following output in ccp1 dump file:
http://pastebin.com/B6HjptkC

and the following output is generated in gimple-match.c:
http://pastebin.com/tmi0cpxv

I guess the generated code appears to be correct for the above pattern,
so we are not doing anything wrong in genmatch ?

Thanks,
Prathamesh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]