This is the mail archive of the gcc-patches@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] | |
Thanks, Andrew Pinski
* fold-const.c (fold_binary): Handle the return value of fold_to_nonsharp_ineq_using_bound if we get back the same operand back. Implement "X +- C1 CMP C2" folding to "X CMP C2 -+ C1".
Attachment:
t.diff.txt
Description: Text document
--- testtwo ---
/* { dg-do compile } */
/* { dg-options "-fdump-tree-gimple" } */
int g(int x)
{
return (x - 10) < 0;
}
/* There should be only x >= 9 and no x - 10. */
/* { dg-final { scan-tree-dump-times ">= 9" 1 "gimple"} } */
/* { dg-final { scan-tree-dump-times "- 10" 0 "gimple"} } */
/* { dg-final { cleanup-tree-dump "gimple" } } */--- testthree ---
/* { dg-do compile } */
/* { dg-options "-fdump-tree-gimple -fwrapv" } */
int g(int x)
{
return (x - 10) < 0;
}
/* There should be no x >= 9 and one x - 10. */
/* { dg-final { scan-tree-dump-times ">= 9" 0 "gimple"} } */
/* { dg-final { scan-tree-dump-times "- 10" 1 "gimple"} } */
/* { dg-final { cleanup-tree-dump "gimple" } } */--- testfour ---
/* { dg-do compile } */
/* { dg-options "-fdump-tree-gimple" } */
int g(int x)
{
return (x + 10) < 0;
}
/* There should be only x >= -9 and no x + 10. */
/* { dg-final { scan-tree-dump-times ">= 9" 1 "gimple"} } */
/* { dg-final { scan-tree-dump-times "- 10" 0 "gimple"} } */
/* { dg-final { cleanup-tree-dump "gimple" } } */--- testfive ---
/* { dg-do compile } */
/* { dg-options "-fdump-tree-gimple -fwrapv" } */
int g(int x)
{
return (x + 10) < 0;
}
/* There should be no x >= -9 and one x + 10. */
/* { dg-final { scan-tree-dump-times ">= 9" 0 "gimple"} } */
/* { dg-final { scan-tree-dump-times "- 10" 1 "gimple"} } */
/* { dg-final { cleanup-tree-dump "gimple" } } */
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |