* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
@ 2020-03-20 8:43 ` rguenth at gcc dot gnu.org
2020-03-26 12:36 ` marxin at gcc dot gnu.org
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-03-20 8:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
2020-03-20 8:43 ` [Bug tree-optimization/91322] [10 regression] alias-4 test failure rguenth at gcc dot gnu.org
@ 2020-03-26 12:36 ` marxin at gcc dot gnu.org
2020-03-26 13:37 ` wdijkstr at arm dot com
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-26 12:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |WAITING
CC| |marxin at gcc dot gnu.org
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
I've just run the test-case on aarch64 and it works fine (-O2, -O2 -flto, -O3
-flto -fno-early-inlining). And lto.exp testsuite works fine on aarch64.
@Wilco: Can you please double-check?
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
2020-03-20 8:43 ` [Bug tree-optimization/91322] [10 regression] alias-4 test failure rguenth at gcc dot gnu.org
2020-03-26 12:36 ` marxin at gcc dot gnu.org
@ 2020-03-26 13:37 ` wdijkstr at arm dot com
2020-03-26 15:00 ` marxin at gcc dot gnu.org
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wdijkstr at arm dot com @ 2020-03-26 13:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
Wilco <wdijkstr at arm dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wdijkstr at arm dot com
--- Comment #2 from Wilco <wdijkstr at arm dot com> ---
(In reply to Martin Liška from comment #1)
> I've just run the test-case on aarch64 and it works fine (-O2, -O2 -flto,
> -O3 -flto -fno-early-inlining). And lto.exp testsuite works fine on aarch64.
> @Wilco: Can you please double-check?
Yes it now works on AArch64, but I still see failures on Arm.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2020-03-26 13:37 ` wdijkstr at arm dot com
@ 2020-03-26 15:00 ` marxin at gcc dot gnu.org
2020-04-03 12:01 ` marxin at gcc dot gnu.org
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-26 15:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Wilco from comment #2)
> (In reply to Martin Liška from comment #1)
> > I've just run the test-case on aarch64 and it works fine (-O2, -O2 -flto,
> > -O3 -flto -fno-early-inlining). And lto.exp testsuite works fine on aarch64.
> > @Wilco: Can you please double-check?
>
> Yes it now works on AArch64, but I still see failures on Arm.
Can you please analyze (or bisect that) what happens?
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2020-03-26 15:00 ` marxin at gcc dot gnu.org
@ 2020-04-03 12:01 ` marxin at gcc dot gnu.org
2020-04-03 13:36 ` clyon at gcc dot gnu.org
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-04-03 12:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |avieira at gcc dot gnu.org,
| |clyon at gcc dot gnu.org
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
I'm adding ARM guys, I hope they can try to reproduce that.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2020-04-03 12:01 ` marxin at gcc dot gnu.org
@ 2020-04-03 13:36 ` clyon at gcc dot gnu.org
2020-04-03 13:37 ` clyon at gcc dot gnu.org
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-04-03 13:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
--- Comment #5 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Created attachment 48183
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48183&action=edit
executable asm from objdump
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2020-04-03 13:36 ` clyon at gcc dot gnu.org
@ 2020-04-03 13:37 ` clyon at gcc dot gnu.org
2020-04-03 13:37 ` clyon at gcc dot gnu.org
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-04-03 13:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
--- Comment #6 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Created attachment 48184
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48184&action=edit
GCC passes dumps
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (6 preceding siblings ...)
2020-04-03 13:37 ` clyon at gcc dot gnu.org
@ 2020-04-03 13:37 ` clyon at gcc dot gnu.org
2020-04-03 15:30 ` hubicka at gcc dot gnu.org
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-04-03 13:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
--- Comment #7 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Created attachment 48185
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48185&action=edit
qemu execution trace
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (7 preceding siblings ...)
2020-04-03 13:37 ` clyon at gcc dot gnu.org
@ 2020-04-03 15:30 ` hubicka at gcc dot gnu.org
2020-04-03 15:33 ` marxin at gcc dot gnu.org
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: hubicka at gcc dot gnu.org @ 2020-04-03 15:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
--- Comment #8 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Do we have compile farm machine where this can be reproduced?
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (8 preceding siblings ...)
2020-04-03 15:30 ` hubicka at gcc dot gnu.org
@ 2020-04-03 15:33 ` marxin at gcc dot gnu.org
2020-04-03 19:38 ` wdijkstr at arm dot com
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-04-03 15:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
--- Comment #9 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #8)
> Do we have compile farm machine where this can be reproduced?
I guess we don't have any.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (9 preceding siblings ...)
2020-04-03 15:33 ` marxin at gcc dot gnu.org
@ 2020-04-03 19:38 ` wdijkstr at arm dot com
2020-04-04 11:49 ` hubicka at gcc dot gnu.org
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: wdijkstr at arm dot com @ 2020-04-03 19:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
--- Comment #10 from Wilco <wdijkstr at arm dot com> ---
(In reply to Christophe Lyon from comment #6)
> Created attachment 48184 [details]
> GCC passes dumps
So according to that, in 105t.vrp1 it removes the branch and unconditionally
calls abort:
Folding statement: _4 = _3 == 0B;
Matching expression match.pd:1737, gimple-match.c:708
Matching expression match.pd:1740, gimple-match.c:772
Matching expression match.pd:1747, gimple-match.c:826
Not folded
Folding statement: if (_5 == 0)
gimple_simplified to if (1 != 0)
Folded into: if (1 != 0)
Folding statement: return;
Not folded
Folding statement: __builtin_abort ();
Not folded
Removing dead stmt _5 = __builtin_constant_p (_4);
It doesn't make sense, these are the VRP ranges:
_1: short int * * VARYING
_2: short int * * VARYING
_3: short int * VARYING
_4: bool VARYING
_5: int [0, 0]
_10: struct a * VARYING
So somehow it decides that __builtin_constant_p (VARYING) == [0,0]???
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (10 preceding siblings ...)
2020-04-03 19:38 ` wdijkstr at arm dot com
@ 2020-04-04 11:49 ` hubicka at gcc dot gnu.org
2020-04-04 13:14 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: hubicka at gcc dot gnu.org @ 2020-04-04 11:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
--- Comment #11 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
The problem is that on ARM sizeof (short) == sizeof (int)
and LTO will glob all short and int pointers together. So this is missed
optimization only.
We do this globing sort of by design. For GCC11 I plan to refine type merging
again a bit but until then we could either xfail this testcase or change int to
long which is 4 bytes.
Not a release blocker though.
I would welcome if someone could test the testcase adjustment (I was doing LTO
by hand)
diff --git a/gcc/testsuite/g++.dg/lto/alias-4_0.C
b/gcc/testsuite/g++.dg/lto/alias-4_0.C
index 410c3140baf..0ab12adef5b 100644
--- a/gcc/testsuite/g++.dg/lto/alias-4_0.C
+++ b/gcc/testsuite/g++.dg/lto/alias-4_0.C
@@ -5,7 +5,7 @@ short *ptr_init, **ptr=&ptr_init;
__attribute__ ((used))
struct a {
- int *aptr;
+ long *aptr;
} a, *aptr=&a;
void
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (11 preceding siblings ...)
2020-04-04 11:49 ` hubicka at gcc dot gnu.org
@ 2020-04-04 13:14 ` jakub at gcc dot gnu.org
2020-04-04 19:51 ` Jan Hubicka
2020-04-04 19:51 ` hubicka at ucw dot cz
` (4 subsequent siblings)
17 siblings, 1 reply; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-04 13:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Which ARM target has 16-bit int?
I don't see INT_TYPE_SIZE nor SHORT_TYPE_SIZE defined in config/arm/*, neither
BITS_PER_WORD, so all depends on UNITS_PER_WORD, which is 4 and thus short is
16-bit and int is 32-bit.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bug tree-optimization/91322] [10 regression] alias-4 test failure
2020-04-04 13:14 ` jakub at gcc dot gnu.org
@ 2020-04-04 19:51 ` Jan Hubicka
0 siblings, 0 replies; 19+ messages in thread
From: Jan Hubicka @ 2020-04-04 19:51 UTC (permalink / raw)
To: jakub at gcc dot gnu.org; +Cc: gcc-bugs
> Which ARM target has 16-bit int?
> I don't see INT_TYPE_SIZE nor SHORT_TYPE_SIZE defined in config/arm/*, neither
> BITS_PER_WORD, so all depends on UNITS_PER_WORD, which is 4 and thus short is
> 16-bit and int is 32-bit.
Hmm, you are right - I messed up target triplets. With arm-linux-gnueabi
I see 4 byte int and the testcase calls abort.
However it is still missed optimization. I will check why we end up
with different code than x86 LTO.
Honza
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] alias-4 test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (12 preceding siblings ...)
2020-04-04 13:14 ` jakub at gcc dot gnu.org
@ 2020-04-04 19:51 ` hubicka at ucw dot cz
2020-04-09 9:43 ` [Bug tree-optimization/91322] [10 regression] g++.dg/lto/alias-4_0.C " rguenth at gcc dot gnu.org
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: hubicka at ucw dot cz @ 2020-04-04 19:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
--- Comment #13 from Jan Hubicka <hubicka at ucw dot cz> ---
> Which ARM target has 16-bit int?
> I don't see INT_TYPE_SIZE nor SHORT_TYPE_SIZE defined in config/arm/*, neither
> BITS_PER_WORD, so all depends on UNITS_PER_WORD, which is 4 and thus short is
> 16-bit and int is 32-bit.
Hmm, you are right - I messed up target triplets. With arm-linux-gnueabi
I see 4 byte int and the testcase calls abort.
However it is still missed optimization. I will check why we end up
with different code than x86 LTO.
Honza
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] g++.dg/lto/alias-4_0.C test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (13 preceding siblings ...)
2020-04-04 19:51 ` hubicka at ucw dot cz
@ 2020-04-09 9:43 ` rguenth at gcc dot gnu.org
2020-04-09 9:57 ` wilco at gcc dot gnu.org
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-04-09 9:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10 regression] alias-4 |[10 regression]
|test failure |g++.dg/lto/alias-4_0.C test
| |failure
Status|WAITING |NEW
Keywords| |alias, missed-optimization
Target| |arm
--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
FAIL: g++.dg/lto/alias-4 cp_lto_alias-4_0.o-cp_lto_alias-4_0.o execute -O3
-flto -fno-early-inlining
on periodic testing on armv8l-linux-gnueabihf
Adjusting summary - we also have gcc.dg/alias-4.c.
So we're failing to disambiguate loads against stores here for some reason
(we sure need either IPA PTA or TBAA for this to work - it's unclear
what's special here about 'arm' - all loads and stores are pointers
and there's one aggregate assignment involving struct a, also containing
a pointer)
# VUSE <.MEM_6(D)>
# PT = nonlocal escaped null
_1 = ptrD.5611;
# .MEM_7 = VDEF <.MEM_6(D)>
*_1 = 0B;
# VUSE <.MEM_7>
# PT = nonlocal escaped null
_10 = aptrD.5614;
# .MEM_11 = VDEF <.MEM_7>
*_10 = aD.5615;
# VUSE <.MEM_11>
# PT = nonlocal escaped null
_2 = ptrD.5611;
# VUSE <.MEM_11>
# PT = nonlocal escaped null
_3 = *_2;
_4 = _3 == 0B;
So I'm quite sure the missed optimization isn't a regression? (can somebody
quickly check GCC 9 whether the testcase is optimized there on ARM?)
Which makes it a testsuite issue to solve for GCC 10, for example by
xfail-ing it on affected platforms.
The actual issue can probably be simplified quite a bit into a testcase
for alias analysis and FRE1.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] g++.dg/lto/alias-4_0.C test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (14 preceding siblings ...)
2020-04-09 9:43 ` [Bug tree-optimization/91322] [10 regression] g++.dg/lto/alias-4_0.C " rguenth at gcc dot gnu.org
@ 2020-04-09 9:57 ` wilco at gcc dot gnu.org
2020-04-09 12:13 ` cvs-commit at gcc dot gnu.org
2020-04-09 12:18 ` hubicka at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: wilco at gcc dot gnu.org @ 2020-04-09 9:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
--- Comment #15 from Wilco <wilco at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #14)
> So I'm quite sure the missed optimization isn't a regression? (can somebody
> quickly check GCC 9 whether the testcase is optimized there on ARM?)
It fails on both AArch64 and Arm all the way back to GCC6 (oldest compiler I
tried). So it's not a regression but this is all target independent so I
wouldn't expect this to fail.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] g++.dg/lto/alias-4_0.C test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (15 preceding siblings ...)
2020-04-09 9:57 ` wilco at gcc dot gnu.org
@ 2020-04-09 12:13 ` cvs-commit at gcc dot gnu.org
2020-04-09 12:18 ` hubicka at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-09 12:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jan Hubicka <hubicka@gcc.gnu.org>:
https://gcc.gnu.org/g:f60979edbfcf6ce2cbf2cb09b8af8c125ff7774f
commit r10-7654-gf60979edbfcf6ce2cbf2cb09b8af8c125ff7774f
Author: Jan Hubicka <jh@suse.cz>
Date: Thu Apr 9 14:12:36 2020 +0200
Avoid g++.dg/lto/alias-4_0.C test failure on ARM [PR91322]
PR tree-optimization/91322
* g++.dg/lto/alias-4_0.C: Avoid conflict with va_list on ARM and
add
a template testing that.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/91322] [10 regression] g++.dg/lto/alias-4_0.C test failure
[not found] <bug-91322-4@http.gcc.gnu.org/bugzilla/>
` (16 preceding siblings ...)
2020-04-09 12:13 ` cvs-commit at gcc dot gnu.org
@ 2020-04-09 12:18 ` hubicka at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: hubicka at gcc dot gnu.org @ 2020-04-09 12:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91322
Jan Hubicka <hubicka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #17 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
So this turned out to be disabled ODR based TBAA for this struct since on ARM
the builtin va_list type has same structure.
I fixed the fialure by adjusting the structure and next stage1 we can make ODR
TBAA to not give up in this case.
^ permalink raw reply [flat|nested] 19+ messages in thread