This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

target/7336: Incorrect frame pointer elimination


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]