pro64-support
[Top] [All Lists]

followup on inliner bug

To: pro64-support@xxxxxxxxxxx
Subject: followup on inliner bug
From: David Goodwin <goodwin@xxxxxxxxxxxxx>
Date: Mon, 15 Jan 2001 08:44:38 -0800 (PST)
Reply-to: goodwin@xxxxxxxxxxxxx
Sender: owner-pro64-support@xxxxxxxxxxx
In October I sent in the following bug. It was not fixed in
pro64-0.01.0-12. Were you able to reproduce it? What is the status on a
fix?

Thanks,

David



Compiling the attached example at -O3 causes the inliner to do a couple of
things that appear wrong.

sgicc -O3 -S alias.c

static int x;
static int y;

static int *get_x(){ return &x;}
static int *get_y(){ int *p = &y; return p;}
int foo(int);

int test()
{
  (*(get_x())) = 8;
  foo(x);
  (*(get_y())) = 9;
  return x + y;
}


1. Correctness problem: The inliner changes some symbol table flags for x
   and y that cause alias problems in be. Diffing the whirl after gccfe and
   inline, it seems the only thing the inliner does is change 'x's
   "addr_saved" to "addr_passed", and add "addr_passed" to 'y'. Removing
   'x's "addr_saved" causes be to think that the load of 'x' for the call
   to "foo" can't alias with the store of 8 into get_x's return value. Of
   course that is wrong.

2. Performance problem: Neither get_x or get_y are inlined!!



<Prev in Thread] Current Thread [Next in Thread>
  • followup on inliner bug, David Goodwin <=