Bug 31235 - Bootstrap comparison failure with -gstabs
Summary: Bootstrap comparison failure with -gstabs
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 13.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-16 22:43 UTC by Ferenc Kovacs
Modified: 2022-12-01 01:31 UTC (History)
4 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2007-03-31 02:23:00


Attachments
Mark array TYPE_DOMAIN as used to prevent garbage collection. (1.18 KB, patch)
2007-03-31 02:24 UTC, Jim Wilson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ferenc Kovacs 2007-03-16 22:43:46 UTC
Configured and built with:

../gcc-4.2-20070221/configure --enable-languages=c --enable-bootstrap --disable-nls && make BOOT_CFLAGS="-gstabs"

The result is:

[...]
Comparing stages 2 and 3
warning: ./cc1-checksum.o differs
Bootstrap comparison failure!
./dbxout.o differs
./insn-emit.o differs
./varasm.o differs
[...]

I recompiled these sources with stage 2 and stage 3 compilers into assembly, for dbxout.c I got the following:

--- dbxout-stage2.s	2007-03-16 21:27:01.000000000 +0100
+++ dbxout-stage3.s	2007-03-16 21:29:42.000000000 +0100
@@ -14245,12 +14245,12 @@
 	leave
 	ret
 	.size	dbxout_block, .-dbxout_block
-	.stabs	"begin_label:(0,39)=ar(5,28);0;19;(0,2)",128,0,0,-52
+	.stabs	"begin_label:(0,30)",128,0,0,-52
 	.stabn	192,0,0,.LFBB69-.LFBB69
 	.stabs	"did_output:(0,1)",128,0,0,-32
 	.stabs	"blocknum:(0,1)",128,0,0,-28
 	.stabn	192,0,0,.LBB180-.LFBB69
-	.stabs	"buf:(0,39)",128,0,0,-72
+	.stabs	"buf:(0,30)",128,0,0,-72
 	.stabs	"scope_start:(10,36)",128,0,0,-24
 	.stabn	192,0,0,.LBB181-.LFBB69
 	.stabs	"decl:(47,10)",128,0,0,-20

The other files differ in the same manner. It's very similar to http://gcc.gnu.org/ml/gcc/2001-09/msg00882.html.
Comment 1 jsm-csl@polyomino.org.uk 2007-03-16 22:50:01 UTC
Subject: Re:   New: Bootstrap comparison failure with
 -gstabs

On Fri, 16 Mar 2007, feri1024 at t-email dot hu wrote:

> Configured and built with:
> 
> ../gcc-4.2-20070221/configure --enable-languages=c --enable-bootstrap
> --disable-nls && make BOOT_CFLAGS="-gstabs"
> 
> The result is:
> 
> [...]
> Comparing stages 2 and 3
> warning: ./cc1-checksum.o differs
> Bootstrap comparison failure!
> ./dbxout.o differs
> ./insn-emit.o differs
> ./varasm.o differs

The symptoms, including the need for a special BOOT_CFLAGS when 
configuring to trigger a bootstrap failure and the list of miscomparing 
files, seem just the same as the case I analysed and reported today as 
bug 31230.

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

Comment 2 Jim Wilson 2007-03-31 02:23:00 UTC
I was able to reproduce this on an x86_64-linux machine following the instructions.

Assuming this is the same conceptual problem as 31230, I tried the same patch, in another file.  Just marking the array type domain type as used so it wouldn't be garbage collected.  It was a little harder here since we didn't have a convenient subroutine to call, so I had to move some code out of dbxout_type into a new function, but effectively there is only a one line actual code change here.

This survived a C-only BOOT_CFLAGS=-gstabs bootstrap, which seems to be good evidence that it is working.

This patch is otherwise untested.  It needs a full bootstrap, gcc testsuite run, and gdb testsuite run.
Comment 3 Jim Wilson 2007-03-31 02:24:41 UTC
Created attachment 13305 [details]
Mark array TYPE_DOMAIN as used to prevent garbage collection.

This has been tested with a C only BOOT_CFLAGS=-gstabs bootstrap.  It needs a full bootstrap, gcc testsuite run, and gdb testsuite run.
Comment 4 Eric Gallager 2018-10-05 03:03:18 UTC
(In reply to Jim Wilson from comment #3)
> Created attachment 13305 [details]
> Mark array TYPE_DOMAIN as used to prevent garbage collection.
> 
> This has been tested with a C only BOOT_CFLAGS=-gstabs bootstrap.  It needs
> a full bootstrap, gcc testsuite run, and gdb testsuite run.

Please submit to gcc-patches for review if it still applies.
Comment 5 Eric Gallager 2021-03-20 22:37:24 UTC
Note that there has been discussion of deprecating stabs support recently: https://gcc.gnu.org/pipermail/gcc-patches/2017-July/479552.html
Comment 6 Andrew Pinski 2022-12-01 01:31:12 UTC
Stabs debugging support was removed r13-2361-g7e0db0cdf01e9c so closing as won't fix.