Bug 86441 - gcc 3.2.2-10 failed to compile glibc when -O3 is used
gcc 3.2.2-10 failed to compile glibc when -O3 is used
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: gcc (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
: 86215 88220 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-03-21 19:27 EST by hjl
Modified: 2007-04-18 12:52 EDT (History)
3 users (show)

See Also:
Fixed In Version: 3.2.2-13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-08-05 12:23:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
A testcase (178.04 KB, text/plain)
2003-03-21 19:28 EST, hjl
no flags Details

  None (edit)
Description hjl 2003-03-21 19:27:14 EST
I got

# /usr/gcc-3.2-redhat-8/bin/gcc -S -O3 -g foo.i
foo.i:4617: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.
Comment 1 hjl 2003-03-21 19:28:31 EST
Created attachment 90692 [details]
A testcase
Comment 2 hjl 2003-03-28 11:13:07 EST
It also affects x86. When -O3 is used, the build finished. But the debug
information is bogus:

# gdb build-i686-linux.old/elf/ld-linux.so.2
 
 
dlopen failed on 'libthread_db.so.1' - /lib/tls/libthread_db.so.1: undefined
symbol: ps_get_thread_area
GDB will not be able to debug pthreads.
 
GNU gdb 2003-03-04-cvs
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) r
Starting program: /export/build/gnu/glibc/build-i686-linux.old/elf/ld-linux.so.2  
Die: DW_TAG_formal_parameter (abbrev = 30, offset = 3958)
        has children: FALSE
        attributes:
                DW_AT_name (DW_FORM_string) string: "sym"
                DW_AT_decl_file (DW_FORM_data1) constant: 2
                DW_AT_decl_line (DW_FORM_data2) constant: 365
                DW_AT_type (DW_FORM_ref4) constant: 2598
Dwarf Error: Cannot find type of die [in module
/export/build/gnu/glibc/build-i686-linux.old/elf/ld-linux.so.2]
(gdb)

I believe it is the same problem as ia64. The only difference is cc1 doesn't
die when the corrupted memory is accessed.

Comment 3 Jakub Jelinek 2003-03-28 11:53:48 EST
I guess it might be related to what I'm debugging ATM:
/* ICE if run in efence.  */
/* { dg-do compile } */
/* { dg-options "-O3 -g" } */

typedef int T;
int bar (T *, const char *);

int
foo (const char *x)
{
  auto inline int try (T *y);
  static T t;

  inline int try (T *y)
    {
      return bar (y, x);
    }

  return try (&t);
}

Can you try commenting out remove_children call in dwarf2out.c (gen_subprogram_die)?
I'm still trying to understand why some DIEs are at compile_unit level and some
are at subroutine level only.
Comment 4 hjl 2003-03-28 12:29:45 EST
The call to remove_children is the cause of the whole problem. It frees
a die which is still referenced by the call to add_AT_die_ref from
modified_type_die. On ia64, cc1 dies because memory corruption. But on x86,
bogus debug info is generated.
Comment 5 Elena Zannoni 2003-04-07 17:56:02 EDT
*** Bug 86215 has been marked as a duplicate of this bug. ***
Comment 6 Elena Zannoni 2003-04-07 17:58:21 EDT
*** Bug 88220 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.