Bug 28405 - 4.x code generation regression relative to 3.4.6
Summary: 4.x code generation regression relative to 3.4.6
Status: RESOLVED DUPLICATE of bug 24929
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-17 08:58 UTC by Denis Vlasenko
Modified: 2006-09-20 22:19 UTC (History)
5 users (show)

See Also:
Host:
Target: i686-*-*, x86_64-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Vlasenko 2006-07-17 08:58:47 UTC
gcc 3.4.x generates a bit suboptimal code on the below fragment.
gcc 4.x generates code which is a bit more suboptimal.

unsigned v;
void g(unsigned A)
/* gcc -O2 -fomit-frame-pointer -S:
gcc-3.4.3, 3.4.6:
        movl    $-858993459, %eax
        mull    4(%esp)
        movl    %edx, %eax	// huh?
        shrl    $3, %eax
        movl    %eax, v
        ret
gcc-4.0.0,4.1.1:
        movl    $-858993459, %eax
        mull    4(%esp)
        movl    %edx, %eax	// huh?
        xorl    %edx, %edx	// huh??
        shrl    $3, %eax
        movl    %eax, v
        ret
*/
{
	v = (A * 3435973837ULL) >> 35;
}
Comment 1 Andrew Pinski 2006-07-17 09:16:42 UTC
As far as I can tell this is a target issue of splitting too late.
Comment 2 Manuel López-Ibáñez 2006-09-20 22:04:35 UTC
I can confirm this in a recent build of GCC: (GNU) 4.2.0 20060913 (experimental) on i686-pc-linux-gnu.
Comment 3 Steven Bosscher 2006-09-20 22:19:50 UTC

*** This bug has been marked as a duplicate of 24929 ***