[Bug rtl-optimization/54524] Spurious add on sum of bitshifts (forward-propagate issue)

2012-09-18 Thread jan.sm...@alcatel-lucent.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54524

Jan Smets  changed:

   What|Removed |Added

 Target|mips|mipsisa64-octeon-elf
  Known to work||4.5.0, 4.5.4
  Known to fail||4.6.0, 4.6.3, 4.7.1, 4.8.0

--- Comment #2 from Jan Smets  2012-09-18 
12:41:43 UTC ---
GCC 4.5.4 => CORRECT


   0:   27bdffd0addiu   sp,sp,-48
   4:   97a5001clhu a1,28(sp)
   8:   000427c0sll a0,a0,0x1f
   c:   00053600sll a2,a1,0x18
  10:   3c030040lui v1,0x40
  14:   00052a02srl a1,a1,0x8
  18:   00a42821addua1,a1,a0
  1c:   00c33821addua3,a2,v1
  20:   3c024000lui v0,0x4000
  24:   00e6302bsltua2,a3,a2
  28:   00a21021adduv0,a1,v0
  2c:   3c04lui a0,0x0
2c: R_MIPS_HI16 .rodata
  30:   2484addiu   a0,a0,0
30: R_MIPS_LO16 .rodata
  34:   afbf002csw  ra,44(sp)
  38:   0c00jal 0 
38: R_MIPS_26   printf
  3c:   00c23021addua2,a2,v0 <= !
  40:   8fbf002clw  ra,44(sp)
  44:   03e8jr  ra
  48:   27bd0030addiu   sp,sp,48



GCC 4.6.3
=
   0:   27bdffd0addiu   sp,sp,-48
   4:   97a5001clhu a1,28(sp)
   8:   3c030040lui v1,0x40
   c:   3c024000lui v0,0x4000
  10:   00054600sll t0,a1,0x18
  14:   01033821addua3,t0,v1
  18:   00052a02srl a1,a1,0x8
  1c:   00e8402bsltut0,a3,t0
  20:   00a21021adduv0,a1,v0
  24:   000427c0sll a0,a0,0x1f
  28:   01023021addua2,t0,v0
  2c:   00c43021addua2,a2,a0
  30:   3c04lui a0,0x0
30: R_MIPS_HI16 .rodata
  34:   2484addiu   a0,a0,0
34: R_MIPS_LO16 .rodata
  38:   afbf002csw  ra,44(sp)
  3c:   0c00jal 0 
3c: R_MIPS_26   printf
  40:   24c60001addiu   a2,a2,1   <= !
  44:   8fbf002clw  ra,44(sp)
  48:   03e8jr  ra
  4c:   27bd0030addiu   sp,sp,48


GCC 4.8.0
=
   0:   27bdffd0addiu   sp,sp,-48
   4:   97a6001clhu a2,28(sp)
   8:   3c030040lui v1,0x40
   c:   00062e00sll a1,a2,0x18
  10:   00a33821addua3,a1,v1
  14:   00063202srl a2,a2,0x8
  18:   3c024000lui v0,0x4000
  1c:   00e5282bsltua1,a3,a1
  20:   00c21021adduv0,a2,v0
  24:   000427c0sll a0,a0,0x1f
  28:   00a21021adduv0,a1,v0
  2c:   00443021addua2,v0,a0
  30:   3c04lui a0,0x0
30: R_MIPS_HI16 .rodata
  34:   2484addiu   a0,a0,0
34: R_MIPS_LO16 .rodata
  38:   afbf002csw  ra,44(sp)
  3c:   0c00jal 0 
3c: R_MIPS_26   printf
  40:   24c60001addiu   a2,a2,1<= !
  44:   8fbf002clw  ra,44(sp)
  48:   03e8jr  ra
  4c:   27bd0030addiu   sp,sp,48


[Bug rtl-optimization/54524] Spurious add on sum of bitshifts (forward-propagate issue)

2012-09-18 Thread jan.sm...@alcatel-lucent.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54524

Jan Smets  changed:

   What|Removed |Added

   Severity|normal  |major


[Bug rtl-optimization/54524] Spurious add on sum of bitshifts

2012-09-08 Thread jan.sm...@alcatel-lucent.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54524

--- Comment #1 from Jan Smets  2012-09-08 
13:18:48 UTC ---
Created attachment 28152
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28152
testcase

The result is correct with -fno-forward-propagate

tUint64 is unsigned long long I meant. 


An even more reduced testcase is attached. Compile it with a MIPS cross
compiler:

./gcc  -nostdinc -funsigned-char  -fno-builtin -G 0 -mno-gpopt -msoft-float
-fno-merge-constants -pipe -Wall -O2 -fno-optimize-sibling-calls
-fno-partial-inlining -fno-reorder-blocks -fno-strict-aliasing  -c /tmp/test.c
-o test -mabi=32