Bug 112497 - [14 Regression] Bootstrap comparison failure: gcc/analyzer/constraint-manager.o differs on loongarch64-linux-gnu
Summary: [14 Regression] Bootstrap comparison failure: gcc/analyzer/constraint-manager...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: 14.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2023-11-12 16:05 UTC by Xi Ruoyao
Modified: 2023-11-12 18:11 UTC (History)
4 users (show)

See Also:
Host: loongarch64-linux-gnu
Target: loongarch64-linux-gnu
Build: loongarch64-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2023-11-12 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xi Ruoyao 2023-11-12 16:05:46 UTC
A very recent regression.  Will bisect.
Comment 1 Xi Ruoyao 2023-11-12 17:39:29 UTC
Starts from r14-5367:

Author: Jin Ma <jinma@linux.alibaba.com>
Date:   Sat Nov 11 13:11:45 2023 -0700

    [PATCH v2] In the pipeline, USE or CLOBBER should delay execution if it star
ts a new live range.
Comment 2 Xi Ruoyao 2023-11-12 17:40:39 UTC
FWIW, GCC configured with:

--with-system-zlib --disable-fixincludes --enable-default-ssp --enable-default-pie --disable-werror --disable-multilib
Comment 3 Jeffrey A. Law 2023-11-12 17:48:44 UTC
If at all possible, cc Jin Ma in this since it's his change, I just reviewed and committed the bits on Jin's behalf.
Comment 4 Xi Ruoyao 2023-11-12 17:50:48 UTC
(In reply to Jeffrey A. Law from comment #3)
> If at all possible, cc Jin Ma in this since it's his change, I just reviewed
> and committed the bits on Jin's behalf.

I've replied the gcc-patch thread.  It seems Jin Ma does not have a Bugzilla account.

Generally how do we debug a comparison failure?  I've not seen it before.
Comment 5 Jeffrey A. Law 2023-11-12 17:59:32 UTC
This failure means the stage1 and stage2 compilers generated different code for the same input.

So when I need to debug this I usually start by first getting that source code.  Based in the title of this bugzilla you're going to want the .ii file for constraint-manager as built by either the stage1 or stage2 compiler.

Then I feed that into the stage1 and stage2 compiler with the same optimization options to verify that they indeed generate different code.  Sometimes that doesn't work when the issue is debug insns, but that's where I start.

Once I have confirmed the two compilers generate different code, then I try to isolate where/why.  This can often be done by looking a debug dumps to narrow things down to a pass that's behaving differently.  Alternately you can replace objects in the stage2 compiler with those from the stage1 compiler to narrow it down to a single .o that causes the compiler's behavior to diverge.

Then it's usually a matter going into the debugger and understanding why the given pass is behaving differently.

It's a long, painful process.

*Sometimes* you can just build the stage1 compiler and run the testsuite and see if there are new failures on your target.  It doesn't always generate something useful, but when it does it's often faster than the process I mentioned above.
Comment 6 Xi Ruoyao 2023-11-12 18:11:15 UTC
The problematic commit reverted at r14-5371.  I've tested the reversion locally, so marking this fixed.