This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/57071] Optimize (-1)**k to 1 - 2 * mod(K, 2)
- From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 17 May 2013 23:05:21 +0000
- Subject: [Bug fortran/57071] Optimize (-1)**k to 1 - 2 * mod(K, 2)
- Auto-submitted: auto-generated
- References: <bug-57071-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57071
--- Comment #12 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Created attachment 30141
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30141&action=edit
Another patch that doesn't work...
I tried to follow the advice in comment#9, but I hit a wall
(again).
With the attached patch, I hit
foo.f90:1:0: error: SSA_NAME_DEF_STMT is wrong
program main
^
Expected definition statement:
_16 = 1.0e+0;
Actual definition statement:
_16 = _24;
so I suspect I need PHI nodes here.
Is this the right approach in general? Am I missing something
simple here?