Bug 5184 - Optimizer bug in egcs-2.91.66
Optimizer bug in egcs-2.91.66
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: egcs (Show other bugs)
6.0
i386 Linux
high Severity medium
: ---
: ---
Assigned To: Cristian Gafton
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-09-17 06:04 EDT by Willi N|_er
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-02-05 13:57:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Slightly more elaborate strict_low_part patch (4.55 KB, text/plain)
1999-12-08 16:38 EST, Jim Kingdon
no flags Details

  None (edit)
Description Willi N|_er 1999-09-17 06:04:15 EDT
Hi,
when compiling the appended C-code first with
gcc -v -save-temps bug.c
and then with
gcc -v -save-temps -O bug.c
you will see garbage at the end of the output of the
optimized case.

Best regards
Willi N|_er, LinuxLab SAP AG


*********************************************
****** bug.c ********************************
*********************************************

#include <stdio.h>
#include <stdlib.h>

/*#define TRAILER 0x07*/
#define TRAILER 'A'


static char buf[40];
static char line[30] = "1234567890123456789012345678*";

static void f()
{
  char trailer[2] = { TRAILER, 0x00 };
  char* const last = buf + sizeof(line) - 2;
  memcpy(buf, line, sizeof(line));
  if (*last == '*')
  {
    memcpy(last, trailer, 2);
  }
}

int main()
{
  f();
  printf("%s\n", buf);
  return 0;
}

**************************************************
****** end of bug.c ******************************
**************************************************
Comment 1 Jim Kingdon 1999-09-23 11:35:59 EDT
I have sent a fix for this to the GCC gurus at:
  http://egcs.cygnus.com/ml/gcc-patches/1999-09/msg01103.html
We will see what they say.
Comment 2 Jim Kingdon 1999-09-26 09:39:59 EDT
The update is at:
  http://egcs.cygnus.com/ml/gcc-patches/1999-09/msg01170.html
Comment 3 Jim Kingdon 1999-09-29 18:42:59 EDT
That patch may be a good choice.  See:
  http://egcs.cygnus.com/ml/gcc-patches/1999-09/msg01240.html
Comment 4 Jim Kingdon 1999-12-08 16:38:59 EST
Created attachment 37 [details]
Slightly more elaborate strict_low_part patch
Comment 5 Bill Nottingham 2000-02-05 13:57:59 EST
Fixed in the egcs currently in Raw Hide.

Note You need to log in before you can comment on or make changes to this bug.