[Bug rtl-optimization/83377] Missed optimization (x86): Bit operations should be converted to arithmetic

2018-12-12 Thread vinay.m.engg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83377

--- Comment #4 from Vinay Kumar  ---
Hi,

Above mentioned patch does not work for the pattern "if( x & 2 ) y = (x &
~2UL)". 

>> Probably still easier to fix in combine / simplify-rtx.
We are working as per your suggestion.

Regards,
Vinay

[Bug rtl-optimization/83377] Missed optimization (x86): Bit operations should be converted to arithmetic

2018-12-11 Thread vinay.m.engg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83377

--- Comment #3 from Vinay Kumar  ---
The below mentioned pattern match in match.pd  generates the assembly code
similar to subtraction.
==
diff --git a/gcc/match.pd b/gcc/match.pd
index fbb4d6f..3cde6a6 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -925,6 +925,11 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
  (bit_and @0 integer_all_onesp)
   (non_lvalue @0))

+/*Fold (x & ~CST) into (x - CST)*/
+(simplify(bit_and:c @0 INTEGER_CST@1)
+(if ((INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type)))
+ (minus @0 (negate @1
+
/* x & x -> x,  x | x -> x  */
(for bitop (bit_and bit_ior)
  (simplify
==

 Assembly generated is as follows:
==
test.o: file format elf64-x86-64


Disassembly of section .text:

 :
   0:   48 83 ff fe   cmp$0xfffe,%rdi
   4:   74 04 je a 
   6:   48 8b 7f fd   mov-0x3(%rdi),%rdi
   a:   e9 00 00 00 00jmpq   f 
   f:   90nop

0010 :
  10:   48 83 ff fe   cmp$0xfffe,%rdi
  14:   74 04 je 1a 
  16:   48 8b 7f fe   mov-0x2(%rdi),%rdi
  1a:   e9 00 00 00 00jmpq   1f 
==

[Bug target/85667] (x86_64) ms_abi rules aren't followed when returning short structs with float values

2018-10-17 Thread vinay.m.engg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85667

Vinay Kumar  changed:

   What|Removed |Added

 CC||vinay.m.engg at gmail dot com

--- Comment #1 from Vinay Kumar  ---
Hi,

The current exists in latest trunk sources also. Please let me know is there
any progress on this.

Regards,
Vinay

[Bug target/86947] Erroneous code generated with O2 and O3 for PPC

2018-08-22 Thread vinay.m.engg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86947

--- Comment #4 from Vinay Kumar  ---
Hi Richard,

Thanks for checking the bug.
Please find attached the testcase that would exit with message
"Should NOT BE here" on miscompilation.

The behavior is same with other targets as well.
We have checked it with latest X86 and Aarch64 targets.

gcc t1.c t2.c -O2 -m64 -lm

[Bug target/86947] Erroneous code generated with O2 and O3 for PPC

2018-08-22 Thread vinay.m.engg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86947

--- Comment #3 from Vinay Kumar  ---
Created attachment 44572
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44572=edit
Testcase t2.c

[Bug target/86947] Erroneous code generated with O2 and O3 for PPC

2018-08-22 Thread vinay.m.engg at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86947

Vinay Kumar  changed:

   What|Removed |Added

 CC||vinay.m.engg at gmail dot com

--- Comment #2 from Vinay Kumar  ---
Created attachment 44571
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44571=edit
Testcase t1.c