public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113341] New: Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC
@ 2024-01-11 22:07 glaubitz at physik dot fu-berlin.de
  2024-01-11 22:13 ` [Bug target/113341] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2024-01-11 22:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341

            Bug ID: 113341
           Summary: Using GCC as the bootstrap compiler breaks LLVM on
                    32-bit PowerPC
           Product: gcc
           Version: 13.2.1
               URL: https://github.com/llvm/llvm-project/issues/72279
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glaubitz at physik dot fu-berlin.de
                CC: jrtc27 at jrtc27 dot com, segher at gcc dot gnu.org,
                    sjames at gcc dot gnu.org
  Target Milestone: ---

Using GCC on 32-bit PowerPC as the bootstrap compiler to build LLVM leads to
clang crashing during stage 2 with a backtrace. This does not happen when LLVM
is used as the bootstrap compiler.

The backtrace that clang generates can be found in the LLVM bug report [1].

The problem was observed with LLVM 17, so I initially suspected a regression in
LLVM. I was able to bisect issue which lead to the following commit in LLVM:

bc73ef0031b50f7443615fef614fb4ecaaa4bd11 is the first bad commit
commit bc73ef0031b50f7443615fef614fb4ecaaa4bd11
Author: Richard Smith <richard@metafoo.co.uk>
Date:   Thu Mar 30 14:21:31 2023 -0700

    PR60985: Fix merging of lambda closure types across modules.

However, since the problem does not show when using LLVM as the bootstrap
compiler instead of GCC, I'm suspecting that GCC is miscompiling the code.

> [1] https://github.com/llvm/llvm-project/issues/72279

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

* [Bug target/113341] Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC
  2024-01-11 22:07 [Bug target/113341] New: Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC glaubitz at physik dot fu-berlin.de
@ 2024-01-11 22:13 ` pinskia at gcc dot gnu.org
  2024-01-11 22:14 ` segher at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-11 22:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-01-11
             Status|UNCONFIRMED                 |WAITING

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This could still be a bug in LLVM too.

Without much more information, it is hard to decide.

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

* [Bug target/113341] Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC
  2024-01-11 22:07 [Bug target/113341] New: Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC glaubitz at physik dot fu-berlin.de
  2024-01-11 22:13 ` [Bug target/113341] " pinskia at gcc dot gnu.org
@ 2024-01-11 22:14 ` segher at gcc dot gnu.org
  2024-01-11 22:18 ` glaubitz at physik dot fu-berlin.de
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: segher at gcc dot gnu.org @ 2024-01-11 22:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341

--- Comment #2 from Segher Boessenkool <segher at gcc dot gnu.org> ---
We need a reduced testcase.

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

* [Bug target/113341] Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC
  2024-01-11 22:07 [Bug target/113341] New: Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC glaubitz at physik dot fu-berlin.de
  2024-01-11 22:13 ` [Bug target/113341] " pinskia at gcc dot gnu.org
  2024-01-11 22:14 ` segher at gcc dot gnu.org
@ 2024-01-11 22:18 ` glaubitz at physik dot fu-berlin.de
  2024-01-11 22:18 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2024-01-11 22:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341

--- Comment #3 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
(In reply to Andrew Pinski from comment #1)
> This could still be a bug in LLVM too.
> 
> Without much more information, it is hard to decide.

I fully agree. I filed this bug report to broaden the audience looking for
suggestions how to debug this.

(In reply to Segher Boessenkool from comment #2)
> We need a reduced testcase.

Any suggestion on how to proceed here?

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

* [Bug target/113341] Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC
  2024-01-11 22:07 [Bug target/113341] New: Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC glaubitz at physik dot fu-berlin.de
                   ` (2 preceding siblings ...)
  2024-01-11 22:18 ` glaubitz at physik dot fu-berlin.de
@ 2024-01-11 22:18 ` pinskia at gcc dot gnu.org
  2024-01-11 22:28 ` segher at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-11 22:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I should mention that LLVM has/had known issues with -flifetime-dse so it might
be useful also to show how stage1 of LLVM/clang was being built.

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

* [Bug target/113341] Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC
  2024-01-11 22:07 [Bug target/113341] New: Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC glaubitz at physik dot fu-berlin.de
                   ` (3 preceding siblings ...)
  2024-01-11 22:18 ` pinskia at gcc dot gnu.org
@ 2024-01-11 22:28 ` segher at gcc dot gnu.org
  2024-01-11 22:32 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: segher at gcc dot gnu.org @ 2024-01-11 22:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341

--- Comment #5 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to John Paul Adrian Glaubitz from comment #3)
> (In reply to Segher Boessenkool from comment #2)
> > We need a reduced testcase.
> 
> Any suggestion on how to proceed here?

Nothing in particular, no.  We need that for *any* bug though!

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

* [Bug target/113341] Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC
  2024-01-11 22:07 [Bug target/113341] New: Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC glaubitz at physik dot fu-berlin.de
                   ` (4 preceding siblings ...)
  2024-01-11 22:28 ` segher at gcc dot gnu.org
@ 2024-01-11 22:32 ` pinskia at gcc dot gnu.org
  2024-01-11 22:38 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-11 22:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The backtrace in the llvm bug report is not very useful either.
Maybe look into that first to see if it is obvious which function might be
compiling "incorrectly".  Maybe there is a bug in the new clang code which only
shows up on powerpc ...

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

* [Bug target/113341] Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC
  2024-01-11 22:07 [Bug target/113341] New: Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC glaubitz at physik dot fu-berlin.de
                   ` (5 preceding siblings ...)
  2024-01-11 22:32 ` pinskia at gcc dot gnu.org
@ 2024-01-11 22:38 ` pinskia at gcc dot gnu.org
  2024-01-11 22:42 ` jrtc27 at jrtc27 dot com
  2024-01-12  8:04 ` linkw at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-11 22:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
`-fno-lifetime-dse` is already used but I get the feeling there might be strict
aliasing issues in the code though.  What happens if you add
-fno-strict-aliasing ?

This code gives me strict aliasing violation vibes:
```
T **getAddressOfPointer(ExternalASTSource *Source) const {
    // Ensure the integer is in pointer form.
    (void)get(Source);
    return reinterpret_cast<T**>(&Ptr);
  }
```

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

* [Bug target/113341] Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC
  2024-01-11 22:07 [Bug target/113341] New: Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC glaubitz at physik dot fu-berlin.de
                   ` (6 preceding siblings ...)
  2024-01-11 22:38 ` pinskia at gcc dot gnu.org
@ 2024-01-11 22:42 ` jrtc27 at jrtc27 dot com
  2024-01-12  8:04 ` linkw at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jrtc27 at jrtc27 dot com @ 2024-01-11 22:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341

--- Comment #8 from Jessica Clarke <jrtc27 at jrtc27 dot com> ---
The clang/ subdirectory should be building itself with -fno-strict-aliasing on
GCC already

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

* [Bug target/113341] Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC
  2024-01-11 22:07 [Bug target/113341] New: Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC glaubitz at physik dot fu-berlin.de
                   ` (7 preceding siblings ...)
  2024-01-11 22:42 ` jrtc27 at jrtc27 dot com
@ 2024-01-12  8:04 ` linkw at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: linkw at gcc dot gnu.org @ 2024-01-12  8:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341

Kewen Lin <linkw at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |linkw at gcc dot gnu.org

--- Comment #9 from Kewen Lin <linkw at gcc dot gnu.org> ---
Since it's a breakage during stage2, it's concluded that some built stage1
stuffs behave unexpectedly.  You probably can try to run regression testing
just with stage1 compiler to see if there is any regression exposed.

If without any luck, then you probably have to isolate into one or several
object files, since you have "objects" for "good" and "bad" stage1 compiler,
you can be able to isolate some in between further. Once you get some isolated,
you can probably get some hints it's a bug in LLVM source or gcc.

It seems you are using gcc 13.2.1 as version field shows, you can also try some
previous versions like gcc 12 and gcc 11 to see if they work and it's
regressed.

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

end of thread, other threads:[~2024-01-12  8:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-11 22:07 [Bug target/113341] New: Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC glaubitz at physik dot fu-berlin.de
2024-01-11 22:13 ` [Bug target/113341] " pinskia at gcc dot gnu.org
2024-01-11 22:14 ` segher at gcc dot gnu.org
2024-01-11 22:18 ` glaubitz at physik dot fu-berlin.de
2024-01-11 22:18 ` pinskia at gcc dot gnu.org
2024-01-11 22:28 ` segher at gcc dot gnu.org
2024-01-11 22:32 ` pinskia at gcc dot gnu.org
2024-01-11 22:38 ` pinskia at gcc dot gnu.org
2024-01-11 22:42 ` jrtc27 at jrtc27 dot com
2024-01-12  8:04 ` linkw 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).