This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/65307] [4.9 Regression] Incorrect optimization breaks basic arithmetic
- From: "ktietz at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 Mar 2015 13:06:52 +0000
- Subject: [Bug tree-optimization/65307] [4.9 Regression] Incorrect optimization breaks basic arithmetic
- Auto-submitted: auto-generated
- References: <bug-65307-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65307
--- Comment #7 from Kai Tietz <ktietz at gcc dot gnu.org> ---
Well, it looked like the same issue by inspection dumps, as folding issue
happens in reassoc-pass. Of course it might be that forward-prop patch is the
actual issue.
I noticed for -O3 on 4.9.x that valid computation (dse1):
...
g (const unsigned int from_f)
{
const unsigned int thirty_four;
unsigned int _3;
unsigned int _4;
unsigned int global.0_8;
unsigned int _9;
unsigned int _10;
<bb 2>:
global.0_8 = global;
_9 = global.0_8 * 2;
_3 = _9 * 2;
_10 = _9 * 3;
_4 = _10 * 5;
thirty_four_5 = _3 + _4;
...
Shows after reassoc1 pass:
...
g (const unsigned int from_f)
{
const unsigned int thirty_four;
unsigned int _3;
unsigned int _4;
unsigned int global.0_8;
unsigned int _9;
unsigned int _10;
<bb 2>:
global.0_8 = global;
_9 = global.0_8 * 2;
_4 = 15;
_3 = _4 + 2;
_10 = _9 * _3;
thirty_four_5 = _10;
...
so it seems to be the forward-propagate patch.
Sorry for the noise