public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/47581] New: [4.6 regression] Unnecessary adjustments to stack pointer
@ 2011-02-01 21:27 tony.poppleton at gmail dot com
  2011-02-01 22:56 ` [Bug rtl-optimization/47581] " rguenth at gcc dot gnu.org
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: tony.poppleton at gmail dot com @ 2011-02-01 21:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47581

           Summary: [4.6 regression] Unnecessary adjustments to stack
                    pointer
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tony.poppleton@gmail.com


Whilst investigating PR4079 (which affects PPC), I found some strange
adjustments to the stack pointer when compiling with 4.6.0 (20110129) on x86.

For reference, the C code from that PR is:

unsigned mulh(unsigned a, unsigned b)
{
        return ((unsigned long long)a * (unsigned long long)b) >> 32;
}

On 4.5.2 using "-O2 -m32 -fomit-frame-pointer", this produced the following
succinct code:
mulh:
        movl    8(%esp), %eax
        mull    4(%esp)
        movl    %edx, %eax
        ret
        .size   mulh, .-mulh
        .ident  "GCC: (GNU) 4.5.2"

However on 4.6.0 with the same arguments:
mulh:
.LFB0:
        .cfi_startproc
        subl    $4, %esp           <== isn't this unnecessary?
        .cfi_def_cfa_offset 8
        movl    12(%esp), %eax     <== this could just be 8(%esp)
        mull    8(%esp)            <== this could just be 4(%esp)
        addl    $4, %esp           <== isn't this unnecessary?
        .cfi_def_cfa_offset 4
        movl    %edx, %eax
        ret
        .cfi_endproc
.LFE0:
        .size   mulh, .-mulh
        .ident  "GCC: (GNU) 4.6.0 20110129 (experimental)"


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2012-07-02 10:34 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-01 21:27 [Bug rtl-optimization/47581] New: [4.6 regression] Unnecessary adjustments to stack pointer tony.poppleton at gmail dot com
2011-02-01 22:56 ` [Bug rtl-optimization/47581] " rguenth at gcc dot gnu.org
2011-02-01 23:20 ` [Bug middle-end/47581] " hjl.tools at gmail dot com
2011-02-02 11:23 ` jakub at gcc dot gnu.org
2011-02-02 12:12 ` rguenth at gcc dot gnu.org
2011-02-02 12:25 ` jakub at gcc dot gnu.org
2011-02-02 13:52 ` jakub at gcc dot gnu.org
2011-02-02 14:18 ` hjl.tools at gmail dot com
2011-02-02 14:57 ` hjl.tools at gmail dot com
2011-02-02 15:05 ` [Bug middle-end/47581] [4.5/4.6 " hjl.tools at gmail dot com
2011-02-02 15:14 ` jakub at gcc dot gnu.org
2011-02-08 15:02 ` rguenth at gcc dot gnu.org
2011-02-15 11:53 ` jakub at gcc dot gnu.org
2011-02-15 13:05 ` [Bug middle-end/47581] [4.5 " jakub at gcc dot gnu.org
2011-03-25 20:01 ` jakub at gcc dot gnu.org
2011-06-27 15:52 ` jakub at gcc dot gnu.org
2011-10-26 17:46 ` jakub at gcc dot gnu.org
2012-03-01 15:04 ` jakub at gcc dot gnu.org
2012-03-01 20:29 ` pinskia at gcc dot gnu.org
2012-07-02 10:34 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).