public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/7336: Incorrect frame pointer elimination
@ 2002-07-17  3:16 velco
  0 siblings, 0 replies; only message in thread
From: velco @ 2002-07-17  3:16 UTC (permalink / raw)
  To: gcc-gnats


>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:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-07-17 10:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-17  3:16 target/7336: Incorrect frame pointer elimination velco

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).