[Bug rtl-optimization/37451] Extra addition for doloop in some cases

2020-05-14 Thread luoxhu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37451

luoxhu at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #12 from luoxhu at gcc dot gnu.org ---
Close this.

[Bug rtl-optimization/37451] Extra addition for doloop in some cases

2020-05-14 Thread luoxhu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37451

--- Comment #11 from luoxhu at gcc dot gnu.org ---
fixed on master.

[Bug rtl-optimization/37451] Extra addition for doloop in some cases

2020-05-14 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37451

--- Comment #10 from CVS Commits  ---
The master branch has been updated by Xiong Hu Luo :

https://gcc.gnu.org/g:8a15faa730f99100f6f3ed12663563356ec5a2c0

commit r11-407-g8a15faa730f99100f6f3ed12663563356ec5a2c0
Author: Xionghu Luo 
Date:   Thu May 14 21:03:24 2020 -0500

Fold (add -1; zero_ext; add +1) operations to zero_ext when not
overflow(PR37451, PR61837)

This "subtract/extend/add" existed for a long time and still annoying us
(PR37451, part of PR61837) when converting from 32bits to 64bits, as the
ctr
register is used as 64bits on powerpc64, Andraw Pinski had a patch but
caused some issue and reverted by Joseph S. Myers(PR37451, PR37782).

Andraw:
http://gcc.gnu.org/ml/gcc-patches/2008-09/msg01070.html
http://gcc.gnu.org/ml/gcc-patches/2008-10/msg01321.html
Joseph:
https://gcc.gnu.org/legacy-ml/gcc-patches/2011-11/msg02405.html

We still can do the simplification from "subtract/zero_ext/add" to
"zero_ext"
when loop iterations is known to be LT than MODE_MAX (only do simplify
when counter+0x1 NOT overflow).

Bootstrap and regression tested pass on Power8-LE.

gcc/ChangeLog

2020-05-15  Xiong Hu Luo  

PR rtl-optimization/37451, part of PR target/61837
* loop-doloop.c (doloop_simplify_count): New function.  Simplify
(add -1; zero_ext; add +1) to zero_ext when not wrapping.
(doloop_modify): Call doloop_simplify_count.

gcc/testsuite/ChangeLog

2020-05-15  Xiong Hu Luo  

PR rtl-optimization/37451, part of PR target/61837
* gcc.target/powerpc/doloop-2.c: New test.

[Bug rtl-optimization/37451] Extra addition for doloop in some cases

2012-01-10 Thread jsm28 at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37451

--- Comment #8 from Joseph S. Myers jsm28 at gcc dot gnu.org 2012-01-10 
16:55:44 UTC ---
Author: jsm28
Date: Tue Jan 10 16:55:40 2012
New Revision: 183071

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=183071
Log:
Revert:

2008-09-18  Andrew Pinski  andrew_pin...@playstation.sony.com

PR rtl-opt/37451
* loop-doloop.c (doloop_modify): New argument zero_extend_p and
zero extend count after the correction to it is done.
(doloop_optimize): Update call to doloop_modify, don't zero extend
count before call.

2008-11-03  Andrew Pinski  andrew_pin...@playstation.sony.com

PR rtl-opt/37782
* loop-doloop.c (doloop_modify): Add from_mode argument that says what
mode count is in.
(doloop_optimize): Update call to doloop_modify.

testsuite:
* gcc.c-torture/execute/doloop-1.c,
gcc.c-torture/execute/doloop-2.c: New tests.

Added:
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/execute/doloop-1.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/execute/doloop-2.c
Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/loop-doloop.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


[Bug rtl-optimization/37451] Extra addition for doloop in some cases

2012-01-10 Thread jsm28 at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37451

--- Comment #9 from Joseph S. Myers jsm28 at gcc dot gnu.org 2012-01-10 
23:53:19 UTC ---
Author: jsm28
Date: Tue Jan 10 23:53:13 2012
New Revision: 183080

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=183080
Log:
Revert:

2008-09-18  Andrew Pinski  andrew_pin...@playstation.sony.com

PR rtl-opt/37451
* loop-doloop.c (doloop_modify): New argument zero_extend_p and
zero extend count after the correction to it is done.
(doloop_optimize): Update call to doloop_modify, don't zero extend
count before call.

2008-11-03  Andrew Pinski  andrew_pin...@playstation.sony.com

PR rtl-opt/37782
* loop-doloop.c (doloop_modify): Add from_mode argument that says what
mode count is in.
(doloop_optimize): Update call to doloop_modify.

testsuite:
* gcc.c-torture/execute/doloop-1.c,
gcc.c-torture/execute/doloop-2.c: New tests.

Added:
branches/gcc-4_5-branch/gcc/testsuite/gcc.c-torture/execute/doloop-1.c
branches/gcc-4_5-branch/gcc/testsuite/gcc.c-torture/execute/doloop-2.c
Modified:
branches/gcc-4_5-branch/gcc/ChangeLog
branches/gcc-4_5-branch/gcc/loop-doloop.c
branches/gcc-4_5-branch/gcc/testsuite/ChangeLog


[Bug rtl-optimization/37451] Extra addition for doloop in some cases

2011-12-02 Thread jsm28 at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37451

--- Comment #7 from Joseph S. Myers jsm28 at gcc dot gnu.org 2011-12-02 
16:54:33 UTC ---
Author: jsm28
Date: Fri Dec  2 16:54:27 2011
New Revision: 181929

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=181929
Log:
Revert:

2008-09-18  Andrew Pinski  andrew_pin...@playstation.sony.com

PR rtl-opt/37451
* loop-doloop.c (doloop_modify): New argument zero_extend_p and
zero extend count after the correction to it is done.
(doloop_optimize): Update call to doloop_modify, don't zero extend
count before call.

2008-11-03  Andrew Pinski  andrew_pin...@playstation.sony.com

PR rtl-opt/37782
* loop-doloop.c (doloop_modify): Add from_mode argument that says what
mode count is in.
(doloop_optimize): Update call to doloop_modify.

testsuite:
* gcc.c-torture/execute/doloop-1.c,
gcc.c-torture/execute/doloop-2.c: New tests.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/doloop-1.c
trunk/gcc/testsuite/gcc.c-torture/execute/doloop-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/loop-doloop.c
trunk/gcc/testsuite/ChangeLog


[Bug rtl-optimization/37451] Extra addition for doloop in some cases

2009-04-16 Thread pinskia at gcc dot gnu dot org


--- Comment #6 from pinskia at gcc dot gnu dot org  2009-04-16 15:48 ---
I am no longer working on this one.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|pinskia at gcc dot gnu dot  |unassigned at gcc dot gnu
   |org |dot org
 Status|ASSIGNED|NEW


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



[Bug rtl-optimization/37451] Extra addition for doloop in some cases

2008-09-29 Thread schwab at suse dot de


--- Comment #5 from schwab at suse dot de  2008-09-29 14:52 ---
This is causing miscompilation of the stage2 ada compiler.

fatal error: system.ads is incorrectly formatted
unrecognized or incorrect restrictions pragma: No_Implicit_Dynamic_Code
compilation abandoned
make[3]: *** [ada/ada.o] Error 1


-- 


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



[Bug rtl-optimization/37451] Extra addition for doloop in some cases

2008-09-18 Thread pinskia at gcc dot gnu dot org


--- Comment #3 from pinskia at gcc dot gnu dot org  2008-09-18 19:30 ---
Subject: Bug 37451

Author: pinskia
Date: Thu Sep 18 19:28:48 2008
New Revision: 140470

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=140470
Log:
2008-09-18  Andrew Pinski  [EMAIL PROTECTED]

PR rtl-opt/37451
* loop-doloop.c (doloop_modify): New argument zero_extend_p and
zero extend count after the correction to it is done.
(doloop_optimize): Update call to doloop_modify, don't zero extend
count before call.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/loop-doloop.c


-- 


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



[Bug rtl-optimization/37451] Extra addition for doloop in some cases

2008-09-18 Thread pinskia at gcc dot gnu dot org


--- Comment #4 from pinskia at gcc dot gnu dot org  2008-09-18 19:30 ---
This is still not fully fixed.  There is still an issue dealing the DECL_RTX's
being promoted early on.


-- 


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



[Bug rtl-optimization/37451] Extra addition for doloop in some cases

2008-09-14 Thread pinskia at gcc dot gnu dot org


--- Comment #2 from pinskia at gcc dot gnu dot org  2008-09-15 01:15 ---
Hmm, I posted a patch which fixes some of this but we still don't get rid of
the extra zero extend because of the way variables are promoted. Boo.


-- 


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



[Bug rtl-optimization/37451] Extra addition for doloop in some cases

2008-09-09 Thread pinskia at gcc dot gnu dot org


--- Comment #1 from pinskia at gcc dot gnu dot org  2008-09-09 22:03 ---
I have a fix which I will try to submit for 4.5, I will attach it soon.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2008-09-09 22:03:49
   date||


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