public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: velco@fadata.bg
To: gcc-gnats@gcc.gnu.org
Subject: target/7336: Incorrect frame pointer elimination
Date: Wed, 17 Jul 2002 03:16:00 -0000	[thread overview]
Message-ID: <20020717101022.2937.qmail@fadata.bg> (raw)


>Number:         7336
>Category:       target
>Synopsis:       With -Os option, gcc incorrectly computes the elimination offset
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 17 03:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Momchil Velikov
>Release:        3.1.1 20020717 (prerelease)
>Organization:
>Environment:
System: Linux freon 2.4.18 #1 SMP Tue May 14 21:08:03 EEST 2002 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: arm-unknown-elf
configured with: /home/velco/src/gcc-3.1.1-pristine/configure --prefix=/home/velco/sim --target=arm-elf --enable-languages=c --with-cpu=arm7tdmi
>Description:
The function ``arm_compute_initial_elimination_offset'' computes
incorrect offset in certain cases where the ``-Os'' option is given.
It fails to account for a link register save, thus results differ
from the ones computed by ``arm_compute_save_reg_mask''.  
>How-To-Repeat:
Compile the following testcase with -Os, e.g. arm-elf-gcc -Os pt.c -o pt

struct pt
{
  int x;
  int y;
};

int
foo (p0, p1, p2)
     struct pt p0, p1, p2;
{
  if (
      p0.x != 0 || p0.y != 1
      || p1.x != 2 || p1.y != 3
      || p2.x != 4 || p2.y != 5
      )
    return -1;
  else
    return 0;
}

int
main()
{
  struct pt p0, p1, p2;

  p0.x = 0;
  p0.y = 1;

  p1.x = 2;
  p1.y = 3;

  p2.x = 4;
  p2.y = 5;

  if (foo (p0, p1, p2))
    abort();

  return 0;
}
>Fix:
Patch is sent to gcc-patches:
http://gcc.gnu.org/ml/gcc-patches/2002-07/msg00448.html
>Release-Note:
>Audit-Trail:
>Unformatted:


                 reply	other threads:[~2002-07-17 10:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20020717101022.2937.qmail@fadata.bg \
    --to=velco@fadata.bg \
    --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).