This is the mail archive of the gcc-patches@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]

Patch for 3.3?


I'd like to nominate this bit (just this function):

2003-02-26 Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>

* cse.c (count_reg_usage): Fix handling of REG_EQUAL notes.

for 3.3.  It wasn't clear to me from the original patch request,
but this is actually a bug fix.  Here's a test case that breaks
without it on the 3.3 branch (ppc darwin, -O2 -funroll-loops)
[this was derived from gcc.c, and showed up in the bootstrap
when an intrepid soul tried it with -funroll-loops]:

struct switchstr
{
  const char *part1;
  const char **args;
  int live_cond;
  unsigned char validated;
  unsigned char ordering;
};
static struct switchstr *switches;
static int n_switches;
int x=0;
int foo() {
  int i;
  for (i = 0; i < n_switches; i++)
    if (!strcmp (switches[i].part1, "pipe"))
      break;
  if (i < n_switches )
    x=5;
}
main() {
  int i;
  switches = (struct switchstr *)malloc(sizeof(struct switchstr)*100);
  for ( i=0; i<100; i++ )
    switches[i].part1 = "x";
  switches[93].part1 = "pipe";
  n_switches = 100;
  foo();
  if ( x!=5 )
     abort();
}


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