Bug 50244 - gcc-2.96-85 segfault: g++ -g -O
Summary: gcc-2.96-85 segfault: g++ -g -O
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.1
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
: 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:
Clone Of:
Environment:
Last Closed: 2001-08-03 18:17:25 UTC
Embargoed:


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.