Bug 50244 - gcc-2.96-85 segfault: g++ -g -O
Summary: gcc-2.96-85 segfault: g++ -g -O
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
(Show other bugs)
Version: 7.1
Hardware: i386 Linux
medium
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
: 50795 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-07-29 00:36 UTC by Daniel Karlsson
Modified: 2007-04-18 16:35 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-08-03 18:17:25 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)

Description Daniel Karlsson 2001-07-29 00:36:12 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.6 i686)

Description of problem:
The following program makes g++ segfault when using options -g and -O.
Workaround: name the union, don't use -g or -O


How reproducible:
Always

Steps to Reproduce:
1.Save source to bug.cc
2.g++ -g -O -c bug.cc

	

Actual Results:  g++ internal error: segfault in A &A::func2(double &)

Expected Results:  g++ not segfaulting ;)

Additional info:

struct A {
  int func1();
  A &func2(double &);
};
 
int
A::func1()
{
  return 0;
}
 
A &
A::func2(double &arg)
{
  union {
    double x;
    char y[8];
  };
  y[0] = func1();
  arg = x;
  return *this;
}

Comment 1 Jakub Jelinek 2001-08-03 18:17:21 UTC
I've fixed this in http://gcc.gnu.org/ml/gcc-patches/2001-08/msg00154.html.
Will be fixed in gcc-2.96-96.

Comment 2 Jakub Jelinek 2001-08-20 12:46:18 UTC
*** Bug 50795 has been marked as a duplicate of this bug. ***


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