<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>6052</bug_id>
          
          <creation_ts>2005-02-07 13:07:21 +0300</creation_ts>
          <short_desc>suboptimal code</short_desc>
          <delta_ts>2010-11-04 23:25:37 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>gcc4.4</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexey Voinov">voins</reporter>
          <assigned_to name="Gleb F-Malinovskiy">glebfm</assigned_to>
          <cc>glebfm</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>21713</commentid>
    <comment_count>0</comment_count>
    <who name="Alexey Voinov">voins</who>
    <bug_when>2005-02-07 13:07:21 +0300</bug_when>
    <thetext>$ cat &gt; test.c
extern int g(int);
int f(int x) { return g(x); }

$ gcc -S -O3 test.c -o -
	.file	&quot;test.c&quot;
	.text
	.p2align 4,,15
.globl f
	.type	f, @function
f:
	pushl	%ebp
	movl	%esp, %ebp
	popl	%ebp
	jmp	g
	.size	f, .-f
	.section	.note.GNU-stack,&quot;&quot;,@progbits
	.ident	&quot;GCC: (GNU) 3.4.3 20050104 (ALT Linux, build 3.4.3-alt2)&quot;

Obviously, pushl/movl/popl code does nothing and can be completely ommited.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37997</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2006-05-13 18:24:18 +0400</bug_when>
    <thetext>look at 4.1?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38348</commentid>
    <comment_count>2</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2006-05-27 03:02:41 +0400</bug_when>
    <thetext>Same with gcc-4.1.1; maybe I should report it upstream? :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114840</commentid>
    <comment_count>3</comment_count>
    <who name="Kirill A. Shutemov">kas</who>
    <bug_when>2010-11-04 23:25:37 +0300</bug_when>
    <thetext>It seems fixed in gcc4.5:

$ gcc -S -O3 test.c -o -
        .file   &quot;test.c&quot;
        .text
        .p2align 4,,15
.globl f
        .type   f, @function
f:
.LFB0:
        .cfi_startproc
        jmp     g
        .cfi_endproc
.LFE0:
        .size   f, .-f
        .ident  &quot;GCC: (GNU) 4.5.1 20100924 (ALT Linux 4.5.1-alt1)&quot;
        .section        .note.GNU-stack,&quot;&quot;,@progbits</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>