Bug 87338 - [8/9 Regression] gcc 8.2 fails to bootstrap on ia64
Summary: [8/9 Regression] gcc 8.2 fails to bootstrap on ia64
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 8.2.0
: P3 normal
Target Milestone: 8.5
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2018-09-17 17:20 UTC by Jason Duerstock
Modified: 2021-04-30 09:02 UTC (History)
4 users (show)

See Also:
Host:
Target: ia64-*-*
Build:
Known to work: 8.4.1, 9.3.1
Known to fail:
Last reconfirmed: 2019-05-21 00:00:00


Attachments
Proposed patch (764 bytes, patch)
2019-04-25 14:04 UTC, Jessica Clarke
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Duerstock 2018-09-17 17:20:44 UTC
In GCC 8.2, the compiler fails to bootstrap due to many files differing between stage2 and stage3.  After removing the "STAGE2_CFLAGS += -gtoggle" line from src/config/bootstrap-debug.mk, the compiler successfully bootstraps.

This is with the Debian gcc-8 packaging.
Comment 1 Jason Duerstock 2018-09-17 18:30:34 UTC
Here is the full build log: https://buildd.debian.org/status/fetch.php?pkg=gcc-8&arch=ia64&ver=8.2.0-6&stamp=1536516302&raw=0
Comment 2 Richard Biener 2018-09-18 07:31:47 UTC
Does it work with GCC 7.3.0?
Comment 3 Jason Duerstock 2018-09-18 11:10:04 UTC
Yes.  From the Debian build log: https://buildd.debian.org/status/fetch.php?pkg=gcc-7&arch=ia64&ver=7.3.0-29&stamp=1536161281&raw=0
Comment 4 Andreas Schwab 2018-09-19 07:53:11 UTC
I cannot reproduce that with the current 8.2 branch.
Comment 5 John Paul Adrian Glaubitz 2018-09-20 21:15:35 UTC
According to the build logs [1], one of the major differences when the regression was introduced, was the use of a newer binutils version:

With binutils_2.30, gcc-8.1.0 builds fine:

> https://buildd.debian.org/status/fetch.php?pkg=gcc-8&arch=ia64&ver=8.1.0-9&stamp=1530078388&raw=0

With binutils_2.30.90.20180710, the build fails:

> https://buildd.debian.org/status/fetch.php?pkg=gcc-8&arch=ia64&ver=8.1.0-10&stamp=1531402269&raw=0

The changelog for the Debian gcc-8 package can be found here:

> http://metadata.ftp-master.debian.org/changelogs/main/g/gcc-8/gcc-8_8.2.0-7_changelog

The changes for 8.1.0-10 were:

  * Update to SVN 20180712 (r262577) from the gcc-8-branch.
    - Fix PR libstdc++/86272, PR libstdc++/86127, PR target/85904,
      PR libstdc++/85098, PR libstdc++/85671, PR libstdc++/83982,
      PR libstdc++/86292, PR libstdc++/86138, PR libstdc++/84087,
      PR libstdc++/86398, PR hsa/86371, PR tree-optimization/86492,
      PR c++/86400, PR target/86285 (PPC), PR debug/86064,
      PR target/86222 (PPC), PR rtl-optimization/85645,
      PR rtl-optimization/85645, PR target/86314 (x86), PR sanitizer/86406,
      PR c++/86398, PR c++/86378, PR c++/86320, PR c++/80290,
      PR fortran/82969, PR fortran/86242, PR fortran/82865.
  * Enable decimal float support on kfreebsd-amd64. Closes: #897416.

@Jason: Can you try building 8.1.0-9 from snapshot.debian.org with binutils_2.30.90.20180710?
Comment 6 Jessica Clarke 2019-04-25 14:04:02 UTC
Created attachment 46245 [details]
Proposed patch

Currently performing a test build with this patch, but applying `s/^.LBI[0-9]*:$/[&]/g` to the stage2 (the one with debug info enabled) assembly for one of the differing files fixed the differences to the stage3 file, so I'm confident this will fix it (assuming my change actually compiles).
Comment 7 Richard Biener 2019-04-25 14:17:48 UTC
CCing ia64 port maintainer
Comment 8 Jessica Clarke 2019-04-25 14:20:37 UTC
Oh, and the reason it didn't show up with an older binutils is because it didn't support dwarf2 debug_view:

> checking assembler for dwarf2 debug_view support... no
Comment 9 Jessica Clarke 2019-04-25 17:50:46 UTC
(In reply to James Clarke from comment #6)
> Created attachment 46245 [details]
> Proposed patch
> 
> Currently performing a test build with this patch, but applying
> `s/^.LBI[0-9]*:$/[&]/g` to the stage2 (the one with debug info enabled)
> assembly for one of the differing files fixed the differences to the stage3
> file, so I'm confident this will fix it (assuming my change actually
> compiles).

Patch confirmed to work locally (also, stage2 and stage3 should be swapped in the above comment, since stage2 is the one that *disables* debug info). I will send it to the mailing list shortly.
Comment 10 John Paul Adrian Glaubitz 2019-04-29 10:35:42 UTC
Debian includes the patch now and consequently gcc-8 builds fine again:

> https://buildd.debian.org/status/fetch.php?pkg=gcc-8&arch=ia64&ver=8.3.0-7&stamp=1556533635&raw=0
Comment 11 Jeffrey A. Law 2019-05-21 15:42:31 UTC
Author: law
Date: Tue May 21 15:42:00 2019
New Revision: 271472

URL: https://gcc.gnu.org/viewcvs?rev=271472&root=gcc&view=rev
Log:
	PR bootstrap/87338
	* dwarf2out.c (dwarf2out_inline_entry): Use ASM_OUTPUT_DEBUG_LABEL
	instead of ASM_GENERATE_INTERNAL_LABEL and ASM_OUTPUT_LABEL.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c
Comment 12 Jeffrey A. Law 2019-05-21 15:59:41 UTC
Fixed on trunk so far.
Comment 13 Jakub Jelinek 2020-03-04 09:40:59 UTC
GCC 8.4.0 has been released, adjusting target milestone.
Comment 14 GCC Commits 2021-04-30 08:14:48 UTC
The releases/gcc-9 branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:fe18e4e0845c1821ca51e0a12c284b24a2b60f3a

commit r9-9477-gfe18e4e0845c1821ca51e0a12c284b24a2b60f3a
Author: James Clarke <jrtc27@jrtc27.com>
Date:   Fri Apr 30 10:11:17 2021 +0200

    bootstrap/87338 - gcc 8.2 fails to bootstrap on ia64
    
    This uses ASM_OUTPUT_DEBUG_LABEL instead of ASM_GENERATE_INTERNAL_LABEL
    and ASM_OUTPUT_LABEL.
    
    2019-05-21  James Clarke  <jrtc27@jrtc27.com>
    
            PR bootstrap/87338
            * dwarf2out.c (dwarf2out_inline_entry): Use ASM_OUTPUT_DEBUG_LABEL
            instead of ASM_GENERATE_INTERNAL_LABEL and ASM_OUTPUT_LABEL.
Comment 15 GCC Commits 2021-04-30 09:01:41 UTC
The releases/gcc-8 branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:491d549921d4e93fb8c751c4704070fa4bd940b2

commit r8-10931-g491d549921d4e93fb8c751c4704070fa4bd940b2
Author: James Clarke <jrtc27@jrtc27.com>
Date:   Fri Apr 30 10:11:17 2021 +0200

    bootstrap/87338 - gcc 8.2 fails to bootstrap on ia64
    
    This uses ASM_OUTPUT_DEBUG_LABEL instead of ASM_GENERATE_INTERNAL_LABEL
    and ASM_OUTPUT_LABEL.
    
    2019-05-21  James Clarke  <jrtc27@jrtc27.com>
    
            PR bootstrap/87338
            * dwarf2out.c (dwarf2out_inline_entry): Use ASM_OUTPUT_DEBUG_LABEL
            instead of ASM_GENERATE_INTERNAL_LABEL and ASM_OUTPUT_LABEL.
    
    (cherry picked from commit fe18e4e0845c1821ca51e0a12c284b24a2b60f3a)
Comment 16 Richard Biener 2021-04-30 09:02:18 UTC
Fixed.