Bug 50244

Summary: gcc-2.96-85 segfault: g++ -g -O
Product: [Retired] Red Hat Linux Reporter: Daniel Karlsson <chaotica>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: low Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
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: --- Target Upstream Version:
Embargoed:

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. ***