public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: voel@diku.dk
To: gcc-gnats@gcc.gnu.org
Subject: c/2243: Misplacement of label at start of function.
Date: Sun, 01 Apr 2001 00:00:00 -0000	[thread overview]
Message-ID: <20010309154642.6406.qmail@sourceware.cygnus.com> (raw)

>Number:         2243
>Category:       c
>Synopsis:       Misplacement of label at start of function.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 09 07:56:03 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Rasmus Erik Voel Jensen
>Release:        gcc version 2.95.2 19991024 (release) (andalso CodeSourcery's Online Test Compilation)
>Organization:
>Environment:
Linux 2.2.16-3, i686
>Description:
Labels in the start of a function is placed at the function
entry instead of inside the function if the following 
conditions hold:
 * the source is compiled on the i386-platform.
 * optimization is enabled (not run with -O0).
 * there is no goto's to the label.
>How-To-Repeat:
Compile the following code with ``gcc -O1 labelerr.c''. If
you then look at the objectcode it is clear that the prelude-
size > 0 (ebp is pushed on the stack, and the stackpointer
is saved).

labelerr.c:
/*
 * The label should be after the prelude, such that a jump 
 * to it would not inflect a new stackframe.
 * It is misplaced if the code is optimized end there is no 
 * goto to the label. It is only observed on the ia-32 arch.
 */
int 
main(argv, argc) 
    char      **argv;
    int         argc;
{
  label:
  printf("Preludesize = %x\n", &&label-((void *)main));
  return 1;
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2001-04-01  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-01  0:00 voel [this message]
2001-10-30 13:53 neil
2002-04-25 16:08 rth

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=20010309154642.6406.qmail@sourceware.cygnus.com \
    --to=voel@diku.dk \
    --cc=gcc-gnats@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).