Hi, Please find attached the modified patch as per the comments. Tested the patch on AArch64 and X86 without any regressions. The other hunks of the earlier patch have been removed as per the earlier comments due to failure in regressions. Investigated those issues and found that its because of Double and Float patterns. Could not deduce why the double and float patterns FAIL though. >> fold_builtin_cos/cosh can be reduced to constant folding, thus >> remove their fold_strip_sign_nops () path. Had removed them but the double and float patterns does not generate the optimizations and hence had to retain them Please let me know why the double and float patterns are failing. I could work on those and try to move all other patterns using "simplify and match". The testcase for these pattern optimizations are present. Please let me know whether we would need a separate check so that I can add them. Thanks, Naveen ChangeLog 2015-08-17 Naveen H.S PR middle-end/16107 * fold-const.c (fold_binary_loc) : Move Optimize tan(x)*cos(x) as sin(x) to match.pd. Move Optimize x*pow(x,c) as pow(x,c+1) to match.pd. Move Optimize pow(x,c)*x as pow(x,c+1) to match.pd. Move Optimize sin(x)/cos(x) as tan(x) to match.pd. Move Optimize cos(x)/sin(x) as 1.0/tan(x) to match.pd. Move Optimize sin(x)/tan(x) as cos(x) to match.pd. Move Optimize tan(x)/sin(x) as 1.0/cos(x) to match.pd. Move Optimize pow(x,c)/x as pow(x,c-1) to match.pd. Move Optimize x/pow(y,z) into x*pow(y,-z) to match.pd. * match.pd (SIN ) : New Operator. (TAN) : New Operator. (mult:c (SQRT (SQRT@1 @0)) @1) : New simplifier. (mult (POW:s @0 @1) (POW:s @2 @1)) (mult:c (TAN:s @0) (COS:s @0)) (mult:c @0 (POW @0 @1)) (rdiv (SIN:s @0) (COS:s @0)) (rdiv (COS:s @0) (SIN:s @0)) (rdiv (SIN:s @0) (TAN:s @0)) (rdiv (TAN:s @0) (SIN:s @0)) (rdiv (POW @0 @1) @0) (rdiv @0 (SQRT (rdiv @1 @2))) (rdiv @0 (POW @1 @2))