Bug 5184 - Optimizer bug in egcs-2.91.66
Summary: Optimizer bug in egcs-2.91.66
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: egcs   
(Show other bugs)
Version: 6.0
Hardware: i386
OS: Linux
high
medium
Target Milestone: ---
Assignee: Cristian Gafton
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-09-17 10:04 UTC by Willi N|_er
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-02-05 18:57:47 UTC
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 21:38 UTC, Jim Kingdon
no flags Details

Description Willi N|_er 1999-09-17 10:04:15 UTC
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 15:35:59 UTC
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 13:39:59 UTC
The update is at:
  http://egcs.cygnus.com/ml/gcc-patches/1999-09/msg01170.html

Comment 3 Jim Kingdon 1999-09-29 22:42:59 UTC
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 21:38:59 UTC
Created attachment 37 [details]
Slightly more elaborate strict_low_part patch

Comment 5 Bill Nottingham 2000-02-05 18:57:59 UTC
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.