public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/45712]  New: Segmentation violation when compiling spec source on either x86 or ppc with debugging
@ 2010-09-17 23:18 meissner at gcc dot gnu dot org
  2010-09-17 23:19 ` [Bug middle-end/45712] " meissner at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: meissner at gcc dot gnu dot org @ 2010-09-17 23:18 UTC (permalink / raw)
  To: gcc-bugs

The attached file that is derived from the spec 2006 benchmark suite fails if
you compile it with minimal optimization and -g.  If I remove the -g option, it
compiles fine.

I initially noticed this on powerpc64-linux-gnu, but it looked like a machine
independent bug, so I tried it on a x86_64-unknown-linux-gnu system.

The debugger trace is:
Current directory is /home/meissner/fsf-build-x86_64/trunk/gcc/
GNU gdb (GDB) Fedora (7.1-34.fc13)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /data/meissner/fsf-build-x86_64/trunk/gcc/cc1...done.
Breakpoint 1 at 0x5bc070: file /home/meissner/fsf-src/trunk/gcc/diagnostic.c,
line 878.
Breakpoint 2 at 0x5bce30: file /home/meissner/fsf-src/trunk/gcc/diagnostic.c,
line 819.
Breakpoint 3 at 0x483bd8
Breakpoint 4 at 0x483568
(gdb) r -O -g -quiet foo2.c
Starting program: /data/meissner/fsf-build-x86_64/trunk/gcc/cc1 -O -g -quiet
foo2.c

Program received signal SIGSEGV, Segmentation fault.
0x0000000000bcbb98 in get_symbol_constant_value (sym=0x7ffff06aa640) at
/home/meissner/fsf-src/trunk/gcc/gimple-fold.c:67
Missing separate debuginfos, use: debuginfo-install glibc-2.12-3.x86_64
libgcc-4.4.4-10.fc13.x86_64 libstdc++-4.4.4-10.fc13.x86_64
(gdb) where
#0  0x0000000000bcbb98 in get_symbol_constant_value (sym=0x7ffff06aa640) at
/home/meissner/fsf-src/trunk/gcc/gimple-fold.c:67
#1  0x0000000000bcbf5f in maybe_fold_reference (expr=0x7ffff05e7a80, is_lhs=0
'\000') at /home/meissner/fsf-src/trunk/gcc/gimple-fold.c:554
#2  0x0000000000bcf428 in fold_stmt_1 (gsi=0x7fffffffc3f0, inplace=<value
optimized out>) at /home/meissner/fsf-src/trunk/gcc/gimple-fold.c:1559
#3  0x0000000000a00e34 in fold_marked_statements (first=34,
statements=0x132ce20) at /home/meissner/fsf-src/trunk/gcc/tree-inline.c:4115
#4  0x0000000000a086c5 in optimize_inline_calls (fn=0x7ffff0557500) at
/home/meissner/fsf-src/trunk/gcc/tree-inline.c:4214
#5  0x00000000009dd62f in inline_transform (node=<value optimized out>) at
/home/meissner/fsf-src/trunk/gcc/ipa-inline.c:2165
#6  inline_transform (node=<value optimized out>) at
/home/meissner/fsf-src/trunk/gcc/ipa-inline.c:2139
#7  0x000000000073b619 in execute_one_ipa_transform_pass () at
/home/meissner/fsf-src/trunk/gcc/passes.c:1473
#8  execute_all_ipa_transforms () at
/home/meissner/fsf-src/trunk/gcc/passes.c:1504
#9  0x000000000083454d in tree_rest_of_compilation (fndecl=0x7ffff0557500) at
/home/meissner/fsf-src/trunk/gcc/tree-optimize.c:445
#10 0x00000000009d2326 in cgraph_expand_function (node=0x7ffff0757d70) at
/home/meissner/fsf-src/trunk/gcc/cgraphunit.c:1469
#11 0x00000000009d4d2a in cgraph_expand_all_functions () at
/home/meissner/fsf-src/trunk/gcc/cgraphunit.c:1548
#12 cgraph_optimize () at /home/meissner/fsf-src/trunk/gcc/cgraphunit.c:1804
#13 0x00000000009d528a in cgraph_finalize_compilation_unit () at
/home/meissner/fsf-src/trunk/gcc/cgraphunit.c:1012
#14 0x00000000004adfa4 in c_write_global_declarations () at
/home/meissner/fsf-src/trunk/gcc/c-decl.c:9732
#15 0x00000000007dbd5c in compile_file (argc=5, argv=0x7fffffffc978) at
/home/meissner/fsf-src/trunk/gcc/toplev.c:967
#16 do_compile (argc=5, argv=0x7fffffffc978) at
/home/meissner/fsf-src/trunk/gcc/toplev.c:2394
#17 toplev_main (argc=5, argv=0x7fffffffc978) at
/home/meissner/fsf-src/trunk/gcc/toplev.c:2435
#18 0x0000003db681ec5d in __libc_start_main () from /lib64/libc.so.6
#19 0x0000000000494f19 in _start ()
(gdb) print sym
$1 = (union tree_node *) 0x7ffff06aa640
(gdb) pt
 <var_decl 0x7ffff06aa640 cactuspriv_
    type <record_type 0x7ffff0750e70 asm_written type_0 BLK
        size <integer_cst 0x7ffff0868c30 constant 448>
        unit size <integer_cst 0x7ffff0710b18 constant 56>
        align 64 symtab -260754336 alias set -1 canonical type 0x7ffff0750e70
        fields <field_decl 0x7ffff074ca18 cctk_run_title type <pointer_type
0x7ffff0793930>
            unsigned DI file foo2.c line 98 col 9
            size <integer_cst 0x7ffff076c7a8 constant 64>
            unit size <integer_cst 0x7ffff076c7d0 constant 8>
            align 64 offset_align 128
            offset <integer_cst 0x7ffff076c410 constant 0>
            bit offset <integer_cst 0x7ffff076cb18 constant 0> context
<record_type 0x7ffff0750e70> chain <field_decl 0x7ffff074cab0
cctk_timer_output>> context <translation_unit_decl 0x7ffff074b730 D.2979>
        chain <type_decl 0x7ffff074b508 D.2681>>
    used public external common BLK file foo2.c line 109 col 3 size
<integer_cst 0x7ffff0868c30 448> unit size <integer_cst 0x7ffff0710b18 56>
    align 64 chain <function_decl 0x7ffff0745c00 CCTK_StaggerVars>>
(gdb) print varpool_get_node (sym)
$2 = (struct varpool_node *) 0x0
(gdb) quit
A debugging session is active.

        Inferior 1 [process 20829] will be killed.

Quit anyway? (y or n) y

Debugger finished

It fails because get_symbol_constant_value calls varpool_get_node, which in
turns returns a NULL pointer.


-- 
           Summary: Segmentation violation when compiling spec source on
                    either x86 or ppc with debugging
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: meissner at gcc dot gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45712


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug middle-end/45712] Segmentation violation when compiling spec source on either x86 or ppc with debugging
  2010-09-17 23:18 [Bug middle-end/45712] New: Segmentation violation when compiling spec source on either x86 or ppc with debugging meissner at gcc dot gnu dot org
@ 2010-09-17 23:19 ` meissner at gcc dot gnu dot org
  2010-09-17 23:21 ` meissner at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: meissner at gcc dot gnu dot org @ 2010-09-17 23:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from meissner at gcc dot gnu dot org  2010-09-17 23:19 -------
Created an attachment (id=21824)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21824&action=view)
Source file that shows the problem.

This is a somewhat cutdown source file that shows the problem.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45712


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug middle-end/45712] Segmentation violation when compiling spec source on either x86 or ppc with debugging
  2010-09-17 23:18 [Bug middle-end/45712] New: Segmentation violation when compiling spec source on either x86 or ppc with debugging meissner at gcc dot gnu dot org
  2010-09-17 23:19 ` [Bug middle-end/45712] " meissner at gcc dot gnu dot org
@ 2010-09-17 23:21 ` meissner at gcc dot gnu dot org
  2010-09-18  9:28 ` [Bug middle-end/45712] [4.6 Regression] " rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: meissner at gcc dot gnu dot org @ 2010-09-17 23:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from meissner at gcc dot gnu dot org  2010-09-17 23:21 -------
Created an attachment (id=21825)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21825&action=view)
Potential patch to fix the problem

This bandaid patch will allow the compiler to not segfault, but I'm unsure
whether the real fix is make sure that varpool_get_node does not return a NULL
pointer.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45712


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug middle-end/45712] [4.6 Regression] Segmentation violation when compiling spec source on either x86 or ppc with debugging
  2010-09-17 23:18 [Bug middle-end/45712] New: Segmentation violation when compiling spec source on either x86 or ppc with debugging meissner at gcc dot gnu dot org
  2010-09-17 23:19 ` [Bug middle-end/45712] " meissner at gcc dot gnu dot org
  2010-09-17 23:21 ` meissner at gcc dot gnu dot org
@ 2010-09-18  9:28 ` rguenth at gcc dot gnu dot org
  2010-09-20 21:26 ` meissner at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-18  9:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-09-18 09:28 -------
It should never return NULL for global vars.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-09-18 09:28:21
               date|                            |
            Summary|Segmentation violation when |[4.6 Regression]
                   |compiling spec source on    |Segmentation violation when
                   |either x86 or ppc with      |compiling spec source on
                   |debugging                   |either x86 or ppc with
                   |                            |debugging
   Target Milestone|---                         |4.6.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45712


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug middle-end/45712] [4.6 Regression] Segmentation violation when compiling spec source on either x86 or ppc with debugging
  2010-09-17 23:18 [Bug middle-end/45712] New: Segmentation violation when compiling spec source on either x86 or ppc with debugging meissner at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-09-18  9:28 ` [Bug middle-end/45712] [4.6 Regression] " rguenth at gcc dot gnu dot org
@ 2010-09-20 21:26 ` meissner at gcc dot gnu dot org
  2010-09-21  0:00 ` hjl dot tools at gmail dot com
  2010-09-21 10:29 ` hubicka at gcc dot gnu dot org
  5 siblings, 0 replies; 8+ messages in thread
From: meissner at gcc dot gnu dot org @ 2010-09-20 21:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from meissner at gcc dot gnu dot org  2010-09-20 21:26 -------
FWIW, updating the source to subversion id 164441 seems to mask the failure on
the powerpc, but the x86 still segfaults.  I suspect that the bug is not
actually fixed, but just doesn't show up at the current time on the powerpc.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45712


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug middle-end/45712] [4.6 Regression] Segmentation violation when compiling spec source on either x86 or ppc with debugging
  2010-09-17 23:18 [Bug middle-end/45712] New: Segmentation violation when compiling spec source on either x86 or ppc with debugging meissner at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-09-20 21:26 ` meissner at gcc dot gnu dot org
@ 2010-09-21  0:00 ` hjl dot tools at gmail dot com
  2010-09-21 10:29 ` hubicka at gcc dot gnu dot org
  5 siblings, 0 replies; 8+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-09-21  0:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hjl dot tools at gmail dot com  2010-09-21 00:00 -------
It is caused by revision 163808:

http://gcc.gnu.org/ml/gcc-cvs/2010-09/msg00099.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45712


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug middle-end/45712] [4.6 Regression] Segmentation violation when compiling spec source on either x86 or ppc with debugging
  2010-09-17 23:18 [Bug middle-end/45712] New: Segmentation violation when compiling spec source on either x86 or ppc with debugging meissner at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-09-21  0:00 ` hjl dot tools at gmail dot com
@ 2010-09-21 10:29 ` hubicka at gcc dot gnu dot org
  5 siblings, 0 replies; 8+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2010-09-21 10:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hubicka at gcc dot gnu dot org  2010-09-21 10:29 -------
this should be fixed by patch introducing static_object_in_other_unit_p.
However it seems bit strange that we can get into VAR_DECL not in a varpool by
folding.  I know this is possible for vtables and type infos, but this seems
like an ordinary var.  I will investigat it.
but the ICE should be gone.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45712


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug middle-end/45712] [4.6 Regression] Segmentation violation when compiling spec source on either x86 or ppc with debugging
       [not found] <bug-45712-4@http.gcc.gnu.org/bugzilla/>
@ 2010-09-29 19:15 ` rguenth at gcc dot gnu.org
  0 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-09-29 19:15 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45712

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-09-29 15:39:54 UTC ---
Fixed.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-09-29 15:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-17 23:18 [Bug middle-end/45712] New: Segmentation violation when compiling spec source on either x86 or ppc with debugging meissner at gcc dot gnu dot org
2010-09-17 23:19 ` [Bug middle-end/45712] " meissner at gcc dot gnu dot org
2010-09-17 23:21 ` meissner at gcc dot gnu dot org
2010-09-18  9:28 ` [Bug middle-end/45712] [4.6 Regression] " rguenth at gcc dot gnu dot org
2010-09-20 21:26 ` meissner at gcc dot gnu dot org
2010-09-21  0:00 ` hjl dot tools at gmail dot com
2010-09-21 10:29 ` hubicka at gcc dot gnu dot org
     [not found] <bug-45712-4@http.gcc.gnu.org/bugzilla/>
2010-09-29 19:15 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).