[Bug middle-end/17958] expand_divmod fails to optimize division of 64-bit quantity by small constant when BITS_PER_WORD is 32

2021-08-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17958

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |11.0
 Status|ASSIGNED|RESOLVED

--- Comment #4 from Andrew Pinski  ---
Implemented by r11-5533, r11-5614 (PPC improvement), and r11-5648.

[Bug middle-end/17958] expand_divmod fails to optimize division of 64-bit quantity by small constant when BITS_PER_WORD is 32

2021-05-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17958

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

[Bug middle-end/17958] expand_divmod fails to optimize division of 64-bit quantity by small constant when BITS_PER_WORD is 32

2016-01-27 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17958

Martin Sebor  changed:

   What|Removed |Added

   Last reconfirmed|2007-07-02 21:30:35 |2016-1-27
 CC||msebor at gcc dot gnu.org
  Known to fail||4.8.3, 4.9.3, 5.3.0, 6.0

--- Comment #3 from Martin Sebor  ---
It doesn't look like the patch referenced in comment #2 was ever committed and
the 32-bit code still emits a call to __divdi3, not just on powerpc but also on
x86_64.  This affects all still supported GCC versions.

$ cat ~/tmp/t.c && /build/gcc-trunk/gcc/xgcc -B /build/gcc-trunk/gcc -O2 -S
-Wall -Wextra -Wpedantic -m32 -o/dev/stdout ~/tmp/t.c
long long div10(long long n) { return n / 10; }
.file   "t.c"
.machine power4
.globl __divdi3
.section".text"
.align 2
.p2align 4,,15
.globl div10
.type   div10, @function
div10:
stwu 1,-16(1)
li 5,0
mflr 0
li 6,10
stw 0,20(1)
bl __divdi3
lwz 0,20(1)
addi 1,1,16
mtlr 0
blr
.size   div10,.-div10
.ident  "GCC: (GNU) 6.0.0 20160125 (experimental)"
.section.note.GNU-stack,"",@progbits

[Bug middle-end/17958] expand_divmod fails to optimize division of 64-bit quantity by small constant when BITS_PER_WORD is 32

2012-06-12 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17958

Andrew Pinski pinskia at gcc dot gnu.org changed:

   What|Removed |Added

 AssignedTo|roger at eyesopen dot com   |dtemirbulatov at gmail dot
   ||com

--- Comment #2 from Andrew Pinski pinskia at gcc dot gnu.org 2012-06-12 
20:52:43 UTC ---
http://gcc.gnu.org/ml/gcc-patches/2012-06/msg00450.html


[Bug middle-end/17958] expand_divmod fails to optimize division of 64-bit quantity by small constant when BITS_PER_WORD is 32

2004-10-12 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-12 22:55 
---
not all constants though (power of 2 are fine) for an example 16:
mr r12,r3
srawi r11,r3,31
srawi r9,r11,31
srawi r10,r11,31
srwi r10,r9,28
li r9,0
addc r12,r10,r4
adde r11,r9,r3
srwi r4,r12,4
insrwi r4,r11,4,0
srawi r3,r11,4


Confirmed.

-- 
   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Component|rtl-optimization|middle-end
 Ever Confirmed||1
   Last reconfirmed|-00-00 00:00:00 |2004-10-12 22:55:35
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17958