* [Bug middle-end/100998] bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0'
2021-06-09 17:58 [Bug c/100998] New: bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0' fossum at us dot ibm.com
@ 2021-06-09 18:35 ` pinskia at gcc dot gnu.org
2021-06-09 18:38 ` pinskia at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-06-09 18:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100998
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|c |middle-end
Keywords| |wrong-code
Last reconfirmed| |2021-06-09
Ever confirmed|0 |1
Status|UNCONFIRMED |WAITING
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So the tree level looks fine for me:
_1 = (unsigned int) i_5(D);
_2 = -_1;
_9 = (unsigned int) m_6(D);
_3 = _2 & _9;
_4 = _3 - _1;
_7 = (int) _4;
---- CUT ----
This is for:
int f (long int m, long int i)
{
return ((m & ~(i - 1)) - i);
}
---- CUT ----
The assembly produced for both x86_64 and aarch64 looks correct.
What target is this on?
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/100998] bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0'
2021-06-09 17:58 [Bug c/100998] New: bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0' fossum at us dot ibm.com
2021-06-09 18:35 ` [Bug middle-end/100998] " pinskia at gcc dot gnu.org
@ 2021-06-09 18:38 ` pinskia at gcc dot gnu.org
2021-06-09 18:42 ` [Bug target/100998] [12 Regression] " pinskia at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-06-09 18:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100998
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|1 |0
Status|WAITING |UNCONFIRMED
Target| |powerpc
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
If this is powerpc and on power10, then it is most likely caused by r12-1020.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/100998] [12 Regression] bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0'
2021-06-09 17:58 [Bug c/100998] New: bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0' fossum at us dot ibm.com
2021-06-09 18:35 ` [Bug middle-end/100998] " pinskia at gcc dot gnu.org
2021-06-09 18:38 ` pinskia at gcc dot gnu.org
@ 2021-06-09 18:42 ` pinskia at gcc dot gnu.org
2021-06-09 18:51 ` bergner at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-06-09 18:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100998
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |12.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/100998] [12 Regression] bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0'
2021-06-09 17:58 [Bug c/100998] New: bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0' fossum at us dot ibm.com
` (2 preceding siblings ...)
2021-06-09 18:42 ` [Bug target/100998] [12 Regression] " pinskia at gcc dot gnu.org
@ 2021-06-09 18:51 ` bergner at gcc dot gnu.org
2021-06-09 19:05 ` bergner at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: bergner at gcc dot gnu.org @ 2021-06-09 18:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100998
Peter Bergner <bergner at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |acsawdey at gcc dot gnu.org,
| |bergner at gcc dot gnu.org,
| |segher at gcc dot gnu.org
--- Comment #3 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #2)
> If this is powerpc and on power10, then it is most likely caused by r12-1020.
Not arguing with you, but how did you pinpoint this commit?
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/100998] [12 Regression] bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0'
2021-06-09 17:58 [Bug c/100998] New: bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0' fossum at us dot ibm.com
` (3 preceding siblings ...)
2021-06-09 18:51 ` bergner at gcc dot gnu.org
@ 2021-06-09 19:05 ` bergner at gcc dot gnu.org
2021-06-09 19:10 ` pinskia at gcc dot gnu.org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: bergner at gcc dot gnu.org @ 2021-06-09 19:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100998
--- Comment #4 from Peter Bergner <bergner at gcc dot gnu.org> ---
FYI, I'll give Gordon a build without that patch to test with and see if his
issue goes away with that.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/100998] [12 Regression] bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0'
2021-06-09 17:58 [Bug c/100998] New: bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0' fossum at us dot ibm.com
` (4 preceding siblings ...)
2021-06-09 19:05 ` bergner at gcc dot gnu.org
@ 2021-06-09 19:10 ` pinskia at gcc dot gnu.org
2021-06-09 19:32 ` bergner at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-06-09 19:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100998
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Peter Bergner from comment #3)
> (In reply to Andrew Pinski from comment #2)
> > If this is powerpc and on power10, then it is most likely caused by r12-1020.
>
> Not arguing with you, but how did you pinpoint this commit?
It is just a guess based on understanding what the RTL would look like and what
changes were going on in the powerpc backend and the reporter is from IBM and
you work on the powerpc backend. Also the code looks correct on both aarch64
and x86_64 so I figured it is most likely a target issue.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/100998] [12 Regression] bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0'
2021-06-09 17:58 [Bug c/100998] New: bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0' fossum at us dot ibm.com
` (5 preceding siblings ...)
2021-06-09 19:10 ` pinskia at gcc dot gnu.org
@ 2021-06-09 19:32 ` bergner at gcc dot gnu.org
2021-06-09 20:09 ` bergner at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: bergner at gcc dot gnu.org @ 2021-06-09 19:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100998
Peter Bergner <bergner at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |acsawdey at gcc dot gnu.org
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0 |1
--- Comment #6 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #5)
> It is just a guess based on understanding what the RTL would look like and
> what changes were going on in the powerpc backend and the reporter is from
> IBM and you work on the powerpc backend. Also the code looks correct on
> both aarch64 and x86_64 so I figured it is most likely a target issue.
And you guessed well! I built a mainline compiler for Gordon with Aaron's
commit reverted and the issue goes away. Assigning this to Aaron to debug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/100998] [12 Regression] bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0'
2021-06-09 17:58 [Bug c/100998] New: bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0' fossum at us dot ibm.com
` (6 preceding siblings ...)
2021-06-09 19:32 ` bergner at gcc dot gnu.org
@ 2021-06-09 20:09 ` bergner at gcc dot gnu.org
2021-06-09 20:15 ` pinskia at gcc dot gnu.org
2021-06-09 20:25 ` bergner at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: bergner at gcc dot gnu.org @ 2021-06-09 20:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100998
--- Comment #7 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Peter Bergner from comment #6)
> And you guessed well! I built a mainline compiler for Gordon with Aaron's
> commit reverted and the issue goes away. Assigning this to Aaron to debug.
Talking with Aaron offline, he pointed me at his
52e130652a76ff3d14c0f572fcd79fa53637ce2c fix which is already upstream.
Checking my sources, I don't have that, so I will retry with an updated
compiler.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/100998] [12 Regression] bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0'
2021-06-09 17:58 [Bug c/100998] New: bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0' fossum at us dot ibm.com
` (7 preceding siblings ...)
2021-06-09 20:09 ` bergner at gcc dot gnu.org
@ 2021-06-09 20:15 ` pinskia at gcc dot gnu.org
2021-06-09 20:25 ` bergner at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-06-09 20:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100998
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Peter Bergner from comment #7)
> (In reply to Peter Bergner from comment #6)
> > And you guessed well! I built a mainline compiler for Gordon with Aaron's
> > commit reverted and the issue goes away. Assigning this to Aaron to debug.
>
> Talking with Aaron offline, he pointed me at his
> 52e130652a76ff3d14c0f572fcd79fa53637ce2c fix which is already upstream.
> Checking my sources, I don't have that, so I will retry with an updated
> compiler.
Yes that looks like it could be in this case, since we are getting 0 - 2 rather
2 - 0
That is for:
_3 = _2 & _9;
_4 = _3 - _1;
before that patch, it would be doing basically _1 - _3 instead of the above.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/100998] [12 Regression] bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0'
2021-06-09 17:58 [Bug c/100998] New: bug in experimental GCC12 with optimization '-O1', disappears with optimization '-O0' fossum at us dot ibm.com
` (8 preceding siblings ...)
2021-06-09 20:15 ` pinskia at gcc dot gnu.org
@ 2021-06-09 20:25 ` bergner at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: bergner at gcc dot gnu.org @ 2021-06-09 20:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100998
Peter Bergner <bergner at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #9 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Peter Bergner from comment #7)
> Talking with Aaron offline, he pointed me at his
> 52e130652a76ff3d14c0f572fcd79fa53637ce2c fix which is already upstream.
> Checking my sources, I don't have that, so I will retry with an updated
> compiler.
Ok, it's confirmed with a new build using Aaron's fallow-on fix the issue goes
away, so I'll close this as ALREADY_FIXED. Thanks for your help Andrew!
^ permalink raw reply [flat|nested] 11+ messages in thread