This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/59747] [4.9 Regression] wrong code at -Os and above on x86_64-linux-gnu in 64-bit mode
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Jan 2014 10:17:38 +0000
- Subject: [Bug tree-optimization/59747] [4.9 Regression] wrong code at -Os and above on x86_64-linux-gnu in 64-bit mode
- Auto-submitted: auto-generated
- References: <bug-59747-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59747
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I think the problem is in setting the value of e. With -O in .gimple we have:
e.2 = e;
e.3 = e.2;
e.4 = e.3 + -1;
e = e.4;
while with -O2:
e.2 = e;
e.3 = e.2;
e.4 = (unsigned short) e.3;
D.1762 = e.4 + 65535;
e.5 = (short int) D.1762;
e = e.5;
Wrt the weirdo shift: -1 >> 56 is implementation-defined behavior.