public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
@ 2024-05-17 14:20 iains at gcc dot gnu.org
  2024-05-17 14:22 ` [Bug tree-optimization/115138] " iains at gcc dot gnu.org
                   ` (23 more replies)
  0 siblings, 24 replies; 26+ messages in thread
From: iains at gcc dot gnu.org @ 2024-05-17 14:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115138
           Summary: [15 Regression] Bootstrap compare-debug fail after
                    r15-580-gf3e5f4c58591f5
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iains at gcc dot gnu.org
                CC: rguenth at gcc dot gnu.org
  Target Milestone: ---
            Target: x86_64-darwin

The compare fail is a symbol name mismatch (AFAICT) the code is otherwise
identical.

a single fail fails gcc/d/opover.o

There's:

        .const
_CSWTCH.155:
        .byte   38
        .byte   37
        .byte   40
        .byte   39

where the stage1 compiler (and x86_64 Linux) produces _CSWTCH.154

At present, still trying to figure out how to debug this further .. it's D so
no preprocessed output - I guess will have to try tree dumps.

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
@ 2024-05-17 14:22 ` iains at gcc dot gnu.org
  2024-05-17 14:23 ` rguenther at suse dot de
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: iains at gcc dot gnu.org @ 2024-05-17 14:22 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Target Milestone|---                         |15.0
            Version|14.0                        |15.0
   Last reconfirmed|                            |2024-05-17

--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> ---
seen on several OS versions.

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
  2024-05-17 14:22 ` [Bug tree-optimization/115138] " iains at gcc dot gnu.org
@ 2024-05-17 14:23 ` rguenther at suse dot de
  2024-05-17 15:08 ` iains at gcc dot gnu.org
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: rguenther at suse dot de @ 2024-05-17 14:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from rguenther at suse dot de <rguenther at suse dot de> ---
> Am 17.05.2024 um 16:20 schrieb iains at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>:
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115138
> 
>            Bug ID: 115138
>           Summary: [15 Regression] Bootstrap compare-debug fail after
>                    r15-580-gf3e5f4c58591f5
>           Product: gcc
>           Version: 14.0
>            Status: UNCONFIRMED
>          Severity: normal
>          Priority: P3
>         Component: tree-optimization
>          Assignee: unassigned at gcc dot gnu.org
>          Reporter: iains at gcc dot gnu.org
>                CC: rguenth at gcc dot gnu.org
>  Target Milestone: ---
>            Target: x86_64-darwin
> 
> The compare fail is a symbol name mismatch (AFAICT) the code is otherwise
> identical.
> 
> a single fail fails gcc/d/opover.o
> 
> There's:
> 
>        .const
> _CSWTCH.155:
>        .byte   38
>        .byte   37
>        .byte   40
>        .byte   39
> 
> where the stage1 compiler (and x86_64 Linux) produces _CSWTCH.154
> 
> At present, still trying to figure out how to debug this further .. it's D so
> no preprocessed output - I guess will have to try tree dumps.

Did the followup fix maybe resolve this?

> --
> You are receiving this mail because:
> You are on the CC list for the bug.

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
  2024-05-17 14:22 ` [Bug tree-optimization/115138] " iains at gcc dot gnu.org
  2024-05-17 14:23 ` rguenther at suse dot de
@ 2024-05-17 15:08 ` iains at gcc dot gnu.org
  2024-05-17 17:35 ` iains at gcc dot gnu.org
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: iains at gcc dot gnu.org @ 2024-05-17 15:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to rguenther@suse.de from comment #2)
> > Am 17.05.2024 um 16:20 schrieb iains at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>:
> > 

> > where the stage1 compiler (and x86_64 Linux) produces _CSWTCH.154
> > 
> > At present, still trying to figure out how to debug this further .. it's D so
> > no preprocessed output - I guess will have to try tree dumps.
> 
> Did the followup fix maybe resolve this?

unfortunately, not - the same behaviour is seen at r15-633 (so will have to see
what can be done to debug).

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-05-17 15:08 ` iains at gcc dot gnu.org
@ 2024-05-17 17:35 ` iains at gcc dot gnu.org
  2024-05-18  8:09 ` schwab@linux-m68k.org
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: iains at gcc dot gnu.org @ 2024-05-17 17:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
so I am comparing the output of compiling gcc/d/dmd/opover.d with the stage1
and stage2 compilers.

Using -fdump-tree-all.

the .005t.original outputs are the same 
the .006t.gimple outputs already have differences in the numbering of some
vars.

the first dump file that mentions CSWTCH.15x is .032t.einline (which mentions a
reference to the object).

AFAICT the symbol CSWTCH.15x has the same value at all times; so it appears to
have been created with a different id.

I can upload the gimple if it's useful.

( one further experiment - and then I need to punt on this until there's some
more focussed way to debug it  - I am wondering if the issue has anything to do
with the default c++ std being different for stage 1 and 2+ ) - to test this
theory, will jam -std=c++11 into BOOT_CFLAGS.

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-05-17 17:35 ` iains at gcc dot gnu.org
@ 2024-05-18  8:09 ` schwab@linux-m68k.org
  2024-05-18 10:46 ` iains at gcc dot gnu.org
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: schwab@linux-m68k.org @ 2024-05-18  8:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andreas Schwab <schwab@linux-m68k.org> ---
Dup of PR115137?

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-05-18  8:09 ` schwab@linux-m68k.org
@ 2024-05-18 10:46 ` iains at gcc dot gnu.org
  2024-05-18 11:30 ` iains at gcc dot gnu.org
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: iains at gcc dot gnu.org @ 2024-05-18 10:46 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|x86_64-darwin               |x86_64-darwin, x86_64-linux

--- Comment #6 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Andreas Schwab from comment #5)
> Dup of PR115137?

honestly, I don't know, perhaps but it's not obvious.
However, I think that the debug-compare is a red herring (clearly there's some
difference in codegen).

note: https://gcc.gnu.org/pipermail/gcc-testresults/2024-May/815459.html

which seems to indicate that this does fire on x86_64 linux too - with the
right bootstrap conditions.

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-05-18 10:46 ` iains at gcc dot gnu.org
@ 2024-05-18 11:30 ` iains at gcc dot gnu.org
  2024-05-21 10:01 ` rguenth at gcc dot gnu.org
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: iains at gcc dot gnu.org @ 2024-05-18 11:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Iain Sandoe <iains at gcc dot gnu.org> ---
additional notes:

1. jamming -std=c++11 into stage2 and 3 cxxflags did not make any difference (I
was wondering if some c++17 copy elision thing might have changed the number of
temporaries).

2. still there at r15-644 (no surprise)

3. building the object using the stage3 compiler gives the same result as the
stage2 one.

4. building the object with the stage3 compiler and -fcompare-debug succeeds.

5. (although it's still out of tree) my aarch64-darwin branch, rebased onto
r15-644 also fails in the same way.

(not that any of these observations gets us any closer .. )

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2024-05-18 11:30 ` iains at gcc dot gnu.org
@ 2024-05-21 10:01 ` rguenth at gcc dot gnu.org
  2024-05-21 11:02 ` iains at gcc dot gnu.org
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-21 10:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
I've pushed a fix for PR115137, it's likely this fixes also this bug.

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2024-05-21 10:01 ` rguenth at gcc dot gnu.org
@ 2024-05-21 11:02 ` iains at gcc dot gnu.org
  2024-05-21 12:16 ` rguenth at gcc dot gnu.org
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: iains at gcc dot gnu.org @ 2024-05-21 11:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #8)
> I've pushed a fix for PR115137, it's likely this fixes also this bug.

unfortunately, not; at least, on my fastest x86 machine (AVX512) - the fail is
the same (different CSWTCH.xxx numbers between the stage1 compiler and the
stage2 - the numbers are unchanged with the r15-753 [.154 and .155
respectively]).

I don't expect the machine to make any difference - and I saw that this was
also reported by at least one person for Linux too (although bootstrapping with
O3, I think).

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2024-05-21 11:02 ` iains at gcc dot gnu.org
@ 2024-05-21 12:16 ` rguenth at gcc dot gnu.org
  2024-05-22  8:07 ` ibuclaw at gcc dot gnu.org
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-21 12:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, I won't get to it today but will try to reproduce and analyze tomorrow.

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2024-05-21 12:16 ` rguenth at gcc dot gnu.org
@ 2024-05-22  8:07 ` ibuclaw at gcc dot gnu.org
  2024-05-22  8:27 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2024-05-22  8:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from ibuclaw at gcc dot gnu.org ---
(In reply to Iain Sandoe from comment #0)
> At present, still trying to figure out how to debug this further .. it's D
> so no preprocessed output - I guess will have to try tree dumps.
Dustmite would help reduce it if you have a reliable automated test.

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2024-05-22  8:07 ` ibuclaw at gcc dot gnu.org
@ 2024-05-22  8:27 ` rguenth at gcc dot gnu.org
  2024-05-22  8:29 ` rguenth at gcc dot gnu.org
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-22  8:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
How do I reproduce this?  I tried, on x86_64-linux an all-language bootstrap
using gdc-13 for the first stage and that succeeded.  I'm now trying again
with gdc-12, just --enable-languages=d and an explicit
--with-built-config=bootstrap-debug

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2024-05-22  8:27 ` rguenth at gcc dot gnu.org
@ 2024-05-22  8:29 ` rguenth at gcc dot gnu.org
  2024-05-22  9:02 ` iains at gcc dot gnu.org
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-22  8:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #9)
> (In reply to Richard Biener from comment #8)
> > I've pushed a fix for PR115137, it's likely this fixes also this bug.
> 
> unfortunately, not; at least, on my fastest x86 machine (AVX512) - the fail
> is the same (different CSWTCH.xxx numbers between the stage1 compiler and
> the stage2 - the numbers are unchanged with the r15-753 [.154 and .155
> respectively]).

Note stage1 and stage2 are not expected to compare equal - it's stage2 and
stage3 objects that are compared.

> I don't expect the machine to make any difference - and I saw that this was
> also reported by at least one person for Linux too (although bootstrapping
> with O3, I think).

I think that was an ICE with prange.

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2024-05-22  8:29 ` rguenth at gcc dot gnu.org
@ 2024-05-22  9:02 ` iains at gcc dot gnu.org
  2024-05-22 11:59 ` rguenth at gcc dot gnu.org
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: iains at gcc dot gnu.org @ 2024-05-22  9:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #13)
> (In reply to Iain Sandoe from comment #9)
> > (In reply to Richard Biener from comment #8)
> > > I've pushed a fix for PR115137, it's likely this fixes also this bug.

> Note stage1 and stage2 are not expected to compare equal - it's stage2 and
> stage3 objects that are compared.

Right, for the runtime objects they are built with the stage2 and stage3
compilers,
but for the language objects (like the one we see here), those are built with
the stage1 and stage2 compilers.  I did check manually that the stage3 compiler
does do the same as the stage2 (and that -fdebug-compare does not fail(.


>> I don't expect the machine to make any difference - and I saw that this was
>> also reported by at least one person for Linux too (although bootstrapping
>> with O3, I think).


>I think that was an ICE with prange.


Hmm, I thougt I saw toon report the same file with a -O3 bootstrap on Linux:

make[3]: Leaving directory '/home/toon/scratch/bld2850364'
Comparing stages 2 and 3
Bootstrap comparison failure!
gcc/d/opover.o differs
make[2]: *** [Makefile:37306: compare] Error 1

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2024-05-22  9:02 ` iains at gcc dot gnu.org
@ 2024-05-22 11:59 ` rguenth at gcc dot gnu.org
  2024-05-22 15:43 ` ibuclaw at gcc dot gnu.org
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-22 11:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> ---
Indeed with boostrap-O3 I can see

Comparing stages 2 and 3
Bootstrap comparison failure!
gcc/d/opover.o differs

since both have debug info with bootstrap-O3 the difference is only

-    18: 0000000000000b0c     4 OBJECT  LOCAL  DEFAULT    6 CSWTCH.154
+    18: 0000000000000b0c     4 OBJECT  LOCAL  DEFAULT    6 CSWTCH.155

there's already differenes in SRA and even local-fnsummary.  In fact
gimplification shows

--- ../prev-gcc/d/opover.d.006t.gimple  2024-05-22 13:50:13.437438763 +0200
+++ d/opover.d.006t.gimple      2024-05-22 13:51:08.710863322 +0200
@@ -5158,57 +5158,58 @@
         overflow = 0;
         newLength.100_2 = newLength;
         newLength.101_3 = newLength.100_2;
+        newLength.102_4 = newLength.101_3;
         D.12117 = .ADD_OVERFLOW (typeInfoSize, 1);

as first difference (but the .original dumps are the same).  That's in
the __setArrayAllocLength function.

Note the opover.d compile doesn't even use -O3, so this is all extremely
odd.  It would somehow point at a miscompile of the stage2 compiler by
the stage1 compiler manifesting itself only in this change ...

So the logical next step would be to bisect stage1/stage2 object files
of d21 and see which stage2 object is miscompiled.

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2024-05-22 11:59 ` rguenth at gcc dot gnu.org
@ 2024-05-22 15:43 ` ibuclaw at gcc dot gnu.org
  2024-05-22 15:51 ` iains at gcc dot gnu.org
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2024-05-22 15:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Iain Buclaw <ibuclaw at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #15)
> Note the opover.d compile doesn't even use -O3, so this is all extremely
> odd.  It would somehow point at a miscompile of the stage2 compiler by
> the stage1 compiler manifesting itself only in this change ...
> 
> So the logical next step would be to bisect stage1/stage2 object files
> of d21 and see which stage2 object is miscompiled.
After removing `--enable-multilib` I've managed to replicate this too.

Confirmed that GDCFLAGS ignores whatever's in
`--with-build-config=bootstrap-O3` when compared next to 


Stage1 (`-g -O2` vs `-g`)
```
gdc -c  -g -O2 -fversion=IN_GCC  -fno-PIE  -fno-exceptions
-fasynchronous-unwind-tables  -Wall -Wdeprecated -fno-common -o d/opover.o -MT
d/opover.o -MMD -MP -MF d/.deps/opover.TPo -I../../gcc/d -J../../gcc/d/dmd
-J../../gcc/d/dmd/res ../../gcc/d/dmd/opover.d

g++ -std=c++11  -fno-PIE -c  -DIN_GCC_FRONTEND -g -DIN_GCC    -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-format -Wmissing-format-attribute -Wconditionally-supported
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -fno-PIE -I. -Id
-I../../gcc -I../../gcc/d -I../../gcc/../include  -I../../gcc/../libcpp/include
-I../../gcc/../libcody  -I../../gcc/../libdecnumber
-I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace  
-o d/d-attribs.o -MT d/d-attribs.o -MMD -MP -MF d/.deps/d-attribs.TPo
../../gcc/d/d-attribs.cc
```

Stage2 (`-O2 -g` vs `-O3 -g -fno-checking`)
```
/repos/gcc/build.O3/./prev-gcc/gdc -B/repos/gcc/build.O3/./prev-gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -O2 -g
-B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/libdruntime/gcc
-B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/src
-B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/src/.libs
-I/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/libdruntime
-I/repos/gcc/libphobos/libdruntime
-L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/src/.libs
-B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -c  -g
-O2 -fversion=IN_GCC  -fno-PIE  -fno-exceptions -fasynchronous-unwind-tables 
-Wall -Wdeprecated -fno-common -o d/opover.o -MT d/opover.o -MMD -MP -MF
d/.deps/opover.TPo -I../../gcc/d -J../../gcc/d/dmd -J../../gcc/d/dmd/res
../../gcc/d/dmd/opover.d

/repos/gcc/build.O3/./prev-gcc/xg++ -B/repos/gcc/build.O3/./prev-gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs 
-I/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
 -I/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/include 
-I/repos/gcc/libstdc++-v3/libsupc++
-L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs 
-fno-PIE -c  -DIN_GCC_FRONTEND -O3 -g -fno-checking -DIN_GCC    -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Wconditionally-supported
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -fno-PIE -I. -Id
-I../../gcc -I../../gcc/d -I../../gcc/../include  -I../../gcc/../libcpp/include
-I../../gcc/../libcody  -I../../gcc/../libdecnumber
-I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace  
-o d/d-attribs.o -MT d/d-attribs.o -MMD -MP -MF d/.deps/d-attribs.TPo
../../gcc/d/d-attribs.cc
```

Stage3: (`-O2 -g` vs `-O3 -g -fchecking=1`)
```
/repos/gcc/build.O3/./prev-gcc/gdc -B/repos/gcc/build.O3/./prev-gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -O2 -g
-B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/libdruntime/gcc
-B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/src
-B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/src/.libs
-I/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/libdruntime
-I/repos/gcc/libphobos/libdruntime
-L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libphobos/src/.libs
-B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -c  -g
-O2 -fversion=IN_GCC  -fno-PIE  -fno-exceptions -fasynchronous-unwind-tables 
-Wall -Wdeprecated -fno-common -o d/opover.o -MT d/opover.o -MMD -MP -MF
d/.deps/opover.TPo -I../../gcc/d -J../../gcc/d/dmd -J../../gcc/d/dmd/res
../../gcc/d/dmd/opover.d

/repos/gcc/build.O3/./prev-gcc/xg++ -B/repos/gcc/build.O3/./prev-gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs 
-I/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
 -I/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/include 
-I/repos/gcc/libstdc++-v3/libsupc++
-L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/repos/gcc/build.O3/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs 
-fno-PIE -c  -DIN_GCC_FRONTEND -O3 -g -fchecking=1 -DIN_GCC    -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Wconditionally-supported
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -fno-PIE -I. -Id
-I../../gcc -I../../gcc/d -I../../gcc/../include  -I../../gcc/../libcpp/include
-I../../gcc/../libcody  -I../../gcc/../libdecnumber
-I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace  
-o d/d-attribs.o -MT d/d-attribs.o -MMD -MP -MF d/.deps/d-attribs.TPo
../../gcc/d/d-attribs.cc
```

Also seen in the Makefiles

stage1-gcc/Makefile:GDCFLAGS = -g -O2
stage1-gcc/Makefile:CXXFLAGS = -g  
stage2-gcc/Makefile:GDCFLAGS = -g -O2
stage2-gcc/Makefile:CXXFLAGS = -O3 -g -fno-checking 
stage3-gcc/Makefile:GDCFLAGS = -g -O2
stage3-gcc/Makefile:CXXFLAGS = -O3 -g -fchecking=1

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2024-05-22 15:43 ` ibuclaw at gcc dot gnu.org
@ 2024-05-22 15:51 ` iains at gcc dot gnu.org
  2024-05-22 17:12 ` ibuclaw at gcc dot gnu.org
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: iains at gcc dot gnu.org @ 2024-05-22 15:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Iain Sandoe <iains at gcc dot gnu.org> ---
however, the opover.o mismatch is a symptom - rather than the cause.

If all the objects for the D FE are built by D, then that would tend to point
to miscompilation of something in common code (that is built with C++ and
therefore can be affected by O3).

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2024-05-22 15:51 ` iains at gcc dot gnu.org
@ 2024-05-22 17:12 ` ibuclaw at gcc dot gnu.org
  2024-05-22 17:44 ` ibuclaw at gcc dot gnu.org
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2024-05-22 17:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from Iain Buclaw <ibuclaw at gcc dot gnu.org> ---
Reduction of opover.d
```
bool __setArrayAllocLength(size_t newLength)
{
    import core.checkedint;
    bool overflow;
    addu(newLength,
         addu(0, 0, overflow),
         overflow);

    return true;
}

enum EXP
{
    greaterOrEqual,
    greaterThan,
    lessOrEqual,
    lessThan,
}

EXP reverseRelation(EXP op)
{
    switch (op)
    {
        case EXP.greaterOrEqual:  op = EXP.lessOrEqual;    break;
        case EXP.greaterThan:     op = EXP.lessThan;       break;
        case EXP.lessOrEqual:     op = EXP.greaterOrEqual; break;
        default:                  break;
    }
    return op;
}
```


Running (from the build directory)
```
./stage1-gcc/gdc -B ./stage1-gcc/ -c -O2 -g -fversion=IN_GCC \
   -I ./stage1-x86_64-pc-linux-gnu/libphobos/libdruntime \
   -I ../../libphobos/libdruntime -I ../../gcc/d/ \
   -J ../../gcc/d/dmd -J ../../gcc/d/dmd/res opover.d -o opover-1.o

../stage2-gcc/gdc -B ../stage2-gcc/ -c -O2 -g -fversion=IN_GCC \
   -I ../stage2-x86_64-pc-linux-gnu/libphobos/libdruntime \
   -I ../../libphobos/libdruntime -I ../../gcc/d/ \
   -J ../../gcc/d/dmd -J ../../gcc/d/dmd/res opover.d -o opover-2.o

cmp --ignore-initial=16 opover-1.o opover-2.o
```


Also observed from assembly output
```
--- opover-1.s  2024-05-22 19:10:36.315939819 +0200
+++ opover-2.s  2024-05-22 19:10:28.763819758 +0200
@@ -29,7 +29,7 @@ _D6opover15reverseRelationFEQBa3EXPZQj:
        movl    %edi, %eax
        cmpl    $2, %eax
        ja      .L5
-       leaq    CSWTCH.8(%rip), %rdx
+       leaq    CSWTCH.9(%rip), %rdx
        movl    (%rdx,%rax,4), %eax
 .L5:
 .LVL2:
@@ -123,9 +123,9 @@ gdc.dso_dtor:
        .quad   gdc.dso_dtor
        .section        .rodata
        .align 8
-       .type   CSWTCH.8, @object
-       .size   CSWTCH.8, 12
-CSWTCH.8:
+       .type   CSWTCH.9, @object
+       .size   CSWTCH.9, 12
+CSWTCH.9:
        .long   2
        .long   3
        .long   0
```

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2024-05-22 17:12 ` ibuclaw at gcc dot gnu.org
@ 2024-05-22 17:44 ` ibuclaw at gcc dot gnu.org
  2024-05-22 18:34 ` ibuclaw at gcc dot gnu.org
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2024-05-22 17:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from Iain Buclaw <ibuclaw at gcc dot gnu.org> ---
(In reply to Iain Buclaw from comment #18)
> Reduction of opover.d
> ```
> bool __setArrayAllocLength(size_t newLength)
> {
>     import core.checkedint;
>     bool overflow;
>     addu(newLength,
>          addu(0, 0, overflow),
>          overflow);
> 

This is likely not translatable into C/C++. The D FE emits ADD_OVERFLOW()
directly, and swapping this with __builtin_uaddll_overflow is not equivalent -
pulling out the second `addu` to its own local variable means the comparison
failure is not triggered.

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2024-05-22 17:44 ` ibuclaw at gcc dot gnu.org
@ 2024-05-22 18:34 ` ibuclaw at gcc dot gnu.org
  2024-05-22 18:58 ` ibuclaw at gcc dot gnu.org
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2024-05-22 18:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #20 from Iain Buclaw <ibuclaw at gcc dot gnu.org> ---
Stepping through both the stage1-gcc/gdc and stage2-gcc/gdc compilers, there is
an apparent divergence in behaviour at this point in gimplify.cc

 6527│   /* Now that the LHS is gimplified, re-gimplify the RHS if our initial
 6528│      guess for the predicate was wrong.  */
 6529│   gimple_predicate final_pred = rhs_predicate_for (*to_p);
 6530│   if (final_pred != initial_pred)
 6531│     {
 6532│       ret = gimplify_expr (from_p, pre_p, post_p, final_pred,
fb_rvalue);
 6533│       if (ret == GS_ERROR)
 6534│         return ret;
 6535│     }


It looks like the stage2 compiler treats the if condition as being always true
- though I could be looking at apples and oranges here as one is -O0 whilst the
other is -O2.

stage1:
```
   0x0000000001421561 <+2288>:  call   0x141dc8e
<_Z17rhs_predicate_forP9tree_node>
   0x0000000001421566 <+2293>:  mov    %rax,-0x90(%rbp)
   0x000000000142156d <+2300>:  mov    -0x90(%rbp),%rax
   0x0000000001421574 <+2307>:  cmp    -0x98(%rbp),%rax
   0x000000000142157b <+2314>:  je     0x14215c1
   0x000000000142157d <+2316>:  mov    -0x90(%rbp),%rcx
   0x0000000001421584 <+2323>:  mov    -0xf8(%rbp),%rdx
   0x000000000142158b <+2330>:  mov    -0xf0(%rbp),%rsi
   0x0000000001421592 <+2337>:  mov    -0xb0(%rbp),%rax
   0x0000000001421599 <+2344>:  mov    $0x1,%r8d
   0x000000000142159f <+2350>:  mov    %rax,%rdi
   0x00000000014215a2 <+2353>:  call   0x1456eac
<_Z13gimplify_exprPP9tree_nodePP6gimpleS4_PFbS0_Ei>
   0x00000000014215a7 <+2358>:  mov    %eax,-0xd4(%rbp)
   0x00000000014215ad <+2364>:  cmpl   $0xfffffffe,-0xd4(%rbp)
   0x00000000014215b4 <+2371>:  jne    0x14215c1
   0x00000000014215b6 <+2373>:  mov    -0xd4(%rbp),%eax
   0x00000000014215bc <+2379>:  jmp    0x1422709
   0x00000000014215c1 <+2384>:  mov    -0xb0(%rbp),%rax
```

stage2
```

   0x00000000010d637c <+668>:   call   0x105d030 <_Z13is_gimple_regP9tree_node>
   0x00000000010d6381 <+673>:   mov    $0x10a2ad0,%ecx
   0x00000000010d6386 <+678>:   mov    %r12,%rdx
   0x00000000010d6389 <+681>:   mov    %rbx,%rsi
   0x00000000010d638c <+684>:   test   %al,%al
   0x00000000010d638e <+686>:   mov    $0x10a21d0,%eax
   0x00000000010d6393 <+691>:   mov    $0x1,%r8d
   0x00000000010d6399 <+697>:   mov    %r14,%rdi
   0x00000000010d639c <+700>:   cmovne %rax,%rcx
   0x00000000010d63a0 <+704>:   call   0x10b3700
<_Z13gimplify_exprPP9tree_nodePP6gimpleS4_PFbS0_Ei>
   0x00000000010d63a5 <+709>:   cmp    $0xfffffffe,%eax
   0x00000000010d63a8 <+712>:   je     0x10d6538
```

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2024-05-22 18:34 ` ibuclaw at gcc dot gnu.org
@ 2024-05-22 18:58 ` ibuclaw at gcc dot gnu.org
  2024-05-23  9:24 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2024-05-22 18:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from Iain Buclaw <ibuclaw at gcc dot gnu.org> ---
Now doing a fair comparison:

Command:

g++-11 -std=c++11  \
   -fno-PIE -c -O3 -g -fno-checking -DIN_GCC -fno-exceptions \
  -fno-rtti -fasynchronous-unwind-tables \
  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format \
  -Wmissing-format-attribute -Wconditionally-supported \
  -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros \
  -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -fno-PIE \
  -I../stage1-gcc -I../../gcc -I../../gcc/. -I../../gcc/../include  \
  -I../../gcc/../libcpp/include -I../../gcc/../libcody  \
  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid \
  -I../libdecnumber -I../../gcc/../libbacktrace   \
  -o gimplify.o ../../gcc/gimplify.cc

Optimized-tree dump around line 6529.
```
  <bb 81> [local count: 302659225]:
  # _272 = PHI <is_gimple_reg_rhs_or_call(79), is_gimple_mem_rhs_or_call(80)>
  # DEBUG lhs => NULL
  # DEBUG final_pred => _272
  # DEBUG BEGIN_STMT
  if (_272 != _547)
    goto <bb 83>; [53.47%]
  else
    goto <bb 82>; [46.53%]

  <bb 82> [local count: 301785332]:
  # DEBUG BEGIN_STMT
  _66 = MEM[(union tree_node * *)_1 + 32B];
  _67 = _66->base.code;
  if (_67 == 163)
    goto <bb 84>; [34.00%]
  else
    goto <bb 93>; [66.00%]

  <bb 83> [local count: 161831887]:
  # DEBUG BEGIN_STMT
  ret_268 = gimplify_expr (_796, pre_p_252(D), post_p_253(D), _272, 1);
  # DEBUG ret => ret_268
  # DEBUG BEGIN_STMT
  if (ret_268 == -2)
    goto <bb 14>; [0.54%]
  else
    goto <bb 82>; [99.46%]
```


Command #2:

../stage1-gcc/xg++ -B../stage1-gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ \
  -nostdinc++ -B../stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs \
  -B../stage1-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs  \
  -I../stage1-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu  \
  -I../stage1-x86_64-pc-linux-gnu/libstdc++-v3/include  \
  -I../../libstdc++-v3/libsupc++ \
  -L../stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs \
  -L../stage1-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs  \
  -fno-PIE -c -O3 -g -fno-checking -DIN_GCC  -fno-exceptions \
  -fno-rtti -fasynchronous-unwind-tables \
  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual \
  -Wmissing-format-attribute -Wconditionally-supported \
  -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros \
  -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -fno-PIE \
  -I../stage2-gcc -I../../gcc -I../../gcc/. -I../../gcc/../include  \
  -I../../gcc/../libcpp/include -I../../gcc/../libcody  \
  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid \
  -I../libdecnumber -I../../gcc/../libbacktrace   \
  -o gimplify.o ../../gcc/gimplify.cc


Output.
```
  <bb 83> [local count: 302659226]:
  # _274 = PHI <is_gimple_reg_rhs_or_call(82), is_gimple_mem_rhs_or_call(81)>
  # DEBUG lhs => NULL
  # DEBUG final_pred => _274
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_270 = gimplify_expr (_723, pre_p_253(D), post_p_254(D), _274, 1);
  # DEBUG ret => ret_270
  # DEBUG BEGIN_STMT
  if (ret_270 == -2)
    goto <bb 16>; [0.54%]
  else
    goto <bb 84>; [99.46%]

  <bb 84> [local count: 301785333]:
  # DEBUG BEGIN_STMT
  _66 = MEM[(union tree_node * *)_1 + 32B];
  _67 = _66->base.code;
  if (_67 == 163)
    goto <bb 85>; [34.00%]
  else
    goto <bb 90>; [66.00%]
```

Is this helpful enough to narrow it down?

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (20 preceding siblings ...)
  2024-05-22 18:58 ` ibuclaw at gcc dot gnu.org
@ 2024-05-23  9:24 ` rguenth at gcc dot gnu.org
  2024-05-23 12:39 ` cvs-commit at gcc dot gnu.org
  2024-05-23 12:39 ` rguenth at gcc dot gnu.org
  23 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-23  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #22 from Richard Biener <rguenth at gcc dot gnu.org> ---
Yes!  Testing a fix for

int foo (int) {}
int bar (int) {}

typedef int (*pred)(int);

int x, y;
pred A () { if (x) return foo; else return bar; }
pred B () { if (y) return foo; else return bar; }
int __attribute__((noipa)) baz()
{
  pred a = A();
  pred b = B();
  if (a != b)
    return 42;
  return 0;
}

int main()
{
  if (baz () != 0)
    __builtin_abort ();
  y = 1;
  if (baz () != 42)
    __builtin_abort ();
  return 0;
}

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (21 preceding siblings ...)
  2024-05-23  9:24 ` rguenth at gcc dot gnu.org
@ 2024-05-23 12:39 ` cvs-commit at gcc dot gnu.org
  2024-05-23 12:39 ` rguenth at gcc dot gnu.org
  23 siblings, 0 replies; 26+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-23 12:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #23 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:61f5b3c59ed20438d7d9918d7a83d29a21097d4e

commit r15-791-g61f5b3c59ed20438d7d9918d7a83d29a21097d4e
Author: Richard Biener <rguenther@suse.de>
Date:   Thu May 23 11:26:14 2024 +0200

    tree-optimization/115138 - ptr-vs-ptr and FUNCTION_DECLs

    I failed to realize we do not represent FUNCTION_DECLs or LABEL_DECLs
    in vars explicitly and thus have to compare pt.vars_contains_nonlocal.

            PR tree-optimization/115138
            * tree-ssa-alias.cc (ptrs_compare_unequal): Make sure
            pt.vars_contains_nonlocal differs since we do not represent
            FUNCTION_DECLs or LABEL_DECLs in vars explicitly.

            * gcc.dg/torture/pr115138.c: New testcase.

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

* [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
  2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
                   ` (22 preceding siblings ...)
  2024-05-23 12:39 ` cvs-commit at gcc dot gnu.org
@ 2024-05-23 12:39 ` rguenth at gcc dot gnu.org
  23 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-23 12:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #24 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

* Re: [Bug tree-optimization/115138] [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5
@ 2024-05-26  5:35 lorena feirer
  0 siblings, 0 replies; 26+ messages in thread
From: lorena feirer @ 2024-05-26  5:35 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



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

end of thread, other threads:[~2024-05-26  5:39 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-17 14:20 [Bug tree-optimization/115138] New: [15 Regression] Bootstrap compare-debug fail after r15-580-gf3e5f4c58591f5 iains at gcc dot gnu.org
2024-05-17 14:22 ` [Bug tree-optimization/115138] " iains at gcc dot gnu.org
2024-05-17 14:23 ` rguenther at suse dot de
2024-05-17 15:08 ` iains at gcc dot gnu.org
2024-05-17 17:35 ` iains at gcc dot gnu.org
2024-05-18  8:09 ` schwab@linux-m68k.org
2024-05-18 10:46 ` iains at gcc dot gnu.org
2024-05-18 11:30 ` iains at gcc dot gnu.org
2024-05-21 10:01 ` rguenth at gcc dot gnu.org
2024-05-21 11:02 ` iains at gcc dot gnu.org
2024-05-21 12:16 ` rguenth at gcc dot gnu.org
2024-05-22  8:07 ` ibuclaw at gcc dot gnu.org
2024-05-22  8:27 ` rguenth at gcc dot gnu.org
2024-05-22  8:29 ` rguenth at gcc dot gnu.org
2024-05-22  9:02 ` iains at gcc dot gnu.org
2024-05-22 11:59 ` rguenth at gcc dot gnu.org
2024-05-22 15:43 ` ibuclaw at gcc dot gnu.org
2024-05-22 15:51 ` iains at gcc dot gnu.org
2024-05-22 17:12 ` ibuclaw at gcc dot gnu.org
2024-05-22 17:44 ` ibuclaw at gcc dot gnu.org
2024-05-22 18:34 ` ibuclaw at gcc dot gnu.org
2024-05-22 18:58 ` ibuclaw at gcc dot gnu.org
2024-05-23  9:24 ` rguenth at gcc dot gnu.org
2024-05-23 12:39 ` cvs-commit at gcc dot gnu.org
2024-05-23 12:39 ` rguenth at gcc dot gnu.org
2024-05-26  5:35 lorena feirer

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).