This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/57073] __builtin_powif (-1.0, k) should be optimized to "1.0 - 2.0 * (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:08:34 +0000
- Subject: [Bug middle-end/57073] __builtin_powif (-1.0, k) should be optimized to "1.0 - 2.0 * (K%2)"
- Auto-submitted: auto-generated
- References: <bug-57073-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57073
--- Comment #10 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Created attachment 30142
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30142&action=edit
Another patch that doesn't work...
This time with the right PR...
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?