public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "andi-gcc at firstfloor dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/42586] load-modify-store on x86 should be a single instruction
Date: Sun, 03 Jan 2010 13:19:00 -0000	[thread overview]
Message-ID: <20100103131859.31197.qmail@sourceware.org> (raw)
In-Reply-To: <bug-42586-7834@http.gcc.gnu.org/bugzilla/>



------- Comment #19 from andi-gcc at firstfloor dot org  2010-01-03 13:18 -------

Here's another example with the bogus stack frame problem with a tail call
(the embarassing website has quite a lot of similar cases, normally
near the tail of the tables with 16 vs 22 bytes e.g. against sun cc
which also does tail optimization):


typedef long __clock_t;

typedef __clock_t clock_t;

struct lprofS_sSTACK_RECORD;

typedef struct lprofS_sSTACK_RECORD lprofS_STACK_RECORD;

struct lprofS_sSTACK_RECORD

{

  clock_t time_marker_function_local_time;

  clock_t time_marker_function_total_time;

  char *file_defined;

  char *function_name;

  char *source_code;

  long line_defined;

  long current_line;

  float local_time;

  float total_time;

  lprofS_STACK_RECORD *next;

};

typedef lprofS_STACK_RECORD *lprofS_STACK;

struct lprofP_sSTATE;

typedef struct lprofP_sSTATE lprofP_STATE;

struct lprofP_sSTATE

{

  int stack_level;

  lprofS_STACK stack_top;

};

extern void lprofC_start_timer (clock_t * time_marker);

void lprofM_resume_local_time (lprofP_STATE * S);

void

lprofM_resume_local_time (lprofP_STATE * S)

{



  {

    lprofC_start_timer (&(S->stack_top)->time_marker_function_local_time);

    return;

  }

}

gives with -m32 -fomit-frame-pointer -O2 and 4.5.0 20091219

 subl    $12, %esp
        movl    16(%esp), %eax
        movl    4(%eax), %eax
        movl    %eax, 16(%esp)
        addl    $12, %esp
        jmp     lprofC_start_timer

The subl/addl are completely unnecessary


-- 


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


  parent reply	other threads:[~2010-01-03 13:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-03  6:04 [Bug rtl-optimization/42586] New: load-modify-store on x86 should be " andi-gcc at firstfloor dot org
2010-01-03  6:27 ` [Bug rtl-optimization/42586] " pinskia at gcc dot gnu dot org
2010-01-03  6:28 ` pinskia at gcc dot gnu dot org
2010-01-03  6:30 ` [Bug tree-optimization/42586] SRA does not always work pinskia at gcc dot gnu dot org
2010-01-03  6:33 ` pinskia at gcc dot gnu dot org
2010-01-03  6:35 ` pinskia at gcc dot gnu dot org
2010-01-03  6:39 ` pinskia at gcc dot gnu dot org
2010-01-03  6:55 ` [Bug tree-optimization/42586] New: load-modify-store on x86 should be \ single instruction andi-gcc at firstfloor dot org
2010-01-03  6:57 ` pinskia at gcc dot gnu dot org
2010-01-03  7:00 ` andi-gcc at firstfloor dot org
2010-01-03  7:02 ` pinskia at gcc dot gnu dot org
2010-01-03  7:03 ` andi-gcc at firstfloor dot org
2010-01-03  7:07 ` pinskia at gcc dot gnu dot org
2010-01-03  7:10 ` pinskia at gcc dot gnu dot org
2010-01-03  7:10 ` pinskia at gcc dot gnu dot org
2010-01-03  7:47 ` andi-gcc at firstfloor dot org
2010-01-03  7:49 ` pinskia at gcc dot gnu dot org
2010-01-03  8:13 ` andi-gcc at firstfloor dot org
2010-01-03 11:11 ` [Bug tree-optimization/42586] load-modify-store on x86 should be a " rguenth at gcc dot gnu dot org
2010-01-03 13:19 ` andi-gcc at firstfloor dot org [this message]
2010-01-25 17:51 ` jamborm at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100103131859.31197.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).