* [Bug rtl-optimization/104675] [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
@ 2022-02-24 10:29 ` jakub at gcc dot gnu.org
2022-02-24 10:32 ` pinskia at gcc dot gnu.org
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-24 10:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |9.5
Priority|P3 |P2
Ever confirmed|0 |1
Last reconfirmed| |2022-02-24
Status|UNCONFIRMED |NEW
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r6-779-gbc4315fbb0075e29d9a246bf73ff4c56ccf8fa6b
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/104675] [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
2022-02-24 10:29 ` [Bug rtl-optimization/104675] " jakub at gcc dot gnu.org
@ 2022-02-24 10:32 ` pinskia at gcc dot gnu.org
2022-02-24 10:52 ` jakub at gcc dot gnu.org
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-24 10:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It was this part:
(-1 - A -> ~A): Remove unnecessary condition.
Which caused the issue.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/104675] [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
2022-02-24 10:29 ` [Bug rtl-optimization/104675] " jakub at gcc dot gnu.org
2022-02-24 10:32 ` pinskia at gcc dot gnu.org
@ 2022-02-24 10:52 ` jakub at gcc dot gnu.org
2022-02-24 11:00 ` [Bug tree-optimization/104675] " pinskia at gcc dot gnu.org
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-24 10:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|10.3.1, 11.2.1, 12.0, |
|6.5.0, 7.5.0, 8.5.0, 9.4.1 |
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It isn't just that match.pd change though, consider:
_Complex int foo (_Complex int a) { return (-1 + -1i) - a; }
_Complex int bar (_Complex int a) { return - a - (1 + 1i); }
_Complex int baz (_Complex int a) { _Complex int b = -1 + -1i; return b - a; }
_Complex int qux (_Complex int a) { _Complex int b = 1 + 1i; return - a - b; }
I think both:
/* -A - 1 -> ~A */
(simplify
(minus (convert? (negate @0)) integer_each_onep)
(if (!TYPE_OVERFLOW_TRAPS (type)
&& tree_nop_conversion_p (type, TREE_TYPE (@0)))
(bit_not (convert @0))))
/* -1 - A -> ~A */
(simplify
(minus integer_all_onesp @0)
(bit_not @0))
needs to punt for COMPLEX_TYPE.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (2 preceding siblings ...)
2022-02-24 10:52 ` jakub at gcc dot gnu.org
@ 2022-02-24 11:00 ` pinskia at gcc dot gnu.org
2022-02-24 11:13 ` jakub at gcc dot gnu.org
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-24 11:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
>
> I think both:
> /* -A - 1 -> ~A */
> (simplify
> (minus (convert? (negate @0)) integer_each_onep)
> (if (!TYPE_OVERFLOW_TRAPS (type)
> && tree_nop_conversion_p (type, TREE_TYPE (@0)))
> (bit_not (convert @0))))
>
> /* -1 - A -> ~A */
> (simplify
> (minus integer_all_onesp @0)
> (bit_not @0))
> needs to punt for COMPLEX_TYPE.
Yes agreed. In fact that is basically what I wrote to the original patch on the
mailing list a few minutes ago.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (3 preceding siblings ...)
2022-02-24 11:00 ` [Bug tree-optimization/104675] " pinskia at gcc dot gnu.org
@ 2022-02-24 11:13 ` jakub at gcc dot gnu.org
2022-02-24 14:28 ` glisse at gcc dot gnu.org
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-24 11:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 52507
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52507&action=edit
gcc12-pr104675.patch
Full untested patch.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (4 preceding siblings ...)
2022-02-24 11:13 ` jakub at gcc dot gnu.org
@ 2022-02-24 14:28 ` glisse at gcc dot gnu.org
2022-02-25 9:56 ` cvs-commit at gcc dot gnu.org
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: glisse at gcc dot gnu.org @ 2022-02-24 14:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
--- Comment #6 from Marc Glisse <glisse at gcc dot gnu.org> ---
I am only learning now that bit ops don't exist for complex numbers :-/
I don't really see why not, but that's a different question. Thanks for fixing
this.
Looking to see if I could quickly find other similar issues, I only noticed 2
ICEs
typedef _Complex unsigned T;
T f(T x){
return (x/2)*2;
}
T g(T x){
return (x*2)/2;
}
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (5 preceding siblings ...)
2022-02-24 14:28 ` glisse at gcc dot gnu.org
@ 2022-02-25 9:56 ` cvs-commit at gcc dot gnu.org
2022-02-25 10:53 ` jakub at gcc dot gnu.org
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-25 9:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:758671b88b78d7629376b118ec6ca6bcfbabbd36
commit r12-7385-g758671b88b78d7629376b118ec6ca6bcfbabbd36
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Feb 25 10:55:17 2022 +0100
match.pd: Don't create BIT_NOT_EXPRs for COMPLEX_TYPE [PR104675]
We don't support BIT_{AND,IOR,XOR,NOT}_EXPR on complex types,
&/|/^ are just rejected for them, and ~ is parsed as CONJ_EXPR.
So, we should avoid simplifications which turn valid complex type
expressions into something that will ICE during expansion.
2022-02-25 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/104675
* match.pd (-A - 1 -> ~A, -1 - A -> ~A): Don't simplify for
COMPLEX_TYPE.
* gcc.dg/pr104675-1.c: New test.
* gcc.dg/pr104675-2.c: New test.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (6 preceding siblings ...)
2022-02-25 9:56 ` cvs-commit at gcc dot gnu.org
@ 2022-02-25 10:53 ` jakub at gcc dot gnu.org
2022-02-25 20:25 ` cvs-commit at gcc dot gnu.org
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-25 10:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 52512
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52512&action=edit
gcc12-pr104675-2.patch
Untested fix for the issue Marc mentioned above.
In theory we could handle also integral vectors if uniform_vector_cst_p, but
let's defer that to GCC 13.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (7 preceding siblings ...)
2022-02-25 10:53 ` jakub at gcc dot gnu.org
@ 2022-02-25 20:25 ` cvs-commit at gcc dot gnu.org
2022-02-25 20:27 ` [Bug tree-optimization/104675] [9/10/11 " jakub at gcc dot gnu.org
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-25 20:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:f62115c9b770a66c5378f78a2d5866243d560573
commit r12-7394-gf62115c9b770a66c5378f78a2d5866243d560573
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Feb 25 21:25:12 2022 +0100
match.pd: Further complex simplification fixes [PR104675]
Mark mentioned in the PR further 2 simplifications that also ICE
with complex types.
For these, eventually (but IMO GCC 13 materials) we could support it
for vector types if it would be uniform vector constants.
Currently integer_pow2p is true only for INTEGER_CSTs and COMPLEX_CSTs
and we can't use bit_and etc. for complex type.
2022-02-25 Jakub Jelinek <jakub@redhat.com>
Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/104675
* match.pd (t * 2U / 2 -> t & (~0 / 2), t / 2U * 2 -> t & ~1):
Restrict simplifications to INTEGRAL_TYPE_P.
* gcc.dg/pr104675-3.c : New test.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10/11 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (8 preceding siblings ...)
2022-02-25 20:25 ` cvs-commit at gcc dot gnu.org
@ 2022-02-25 20:27 ` jakub at gcc dot gnu.org
2022-03-29 5:53 ` cvs-commit at gcc dot gnu.org
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-25 20:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11/12 Regression] |[9/10/11 Regression] ICE:
|ICE: in expand_expr_real_2, |in expand_expr_real_2, at
|at expr.cc:9773 at -O with |expr.cc:9773 at -O with
|__real__ + __imag__ |__real__ + __imag__
|extraction |extraction
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10/11 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (9 preceding siblings ...)
2022-02-25 20:27 ` [Bug tree-optimization/104675] [9/10/11 " jakub at gcc dot gnu.org
@ 2022-03-29 5:53 ` cvs-commit at gcc dot gnu.org
2022-03-29 5:53 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-29 5:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:1305c28bc0665504643ff364595b7d6bb222745d
commit r11-9719-g1305c28bc0665504643ff364595b7d6bb222745d
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Feb 25 10:55:17 2022 +0100
match.pd: Don't create BIT_NOT_EXPRs for COMPLEX_TYPE [PR104675]
We don't support BIT_{AND,IOR,XOR,NOT}_EXPR on complex types,
&/|/^ are just rejected for them, and ~ is parsed as CONJ_EXPR.
So, we should avoid simplifications which turn valid complex type
expressions into something that will ICE during expansion.
2022-02-25 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/104675
* match.pd (-A - 1 -> ~A, -1 - A -> ~A): Don't simplify for
COMPLEX_TYPE.
* gcc.dg/pr104675-1.c: New test.
* gcc.dg/pr104675-2.c: New test.
(cherry picked from commit 758671b88b78d7629376b118ec6ca6bcfbabbd36)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10/11 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (10 preceding siblings ...)
2022-03-29 5:53 ` cvs-commit at gcc dot gnu.org
@ 2022-03-29 5:53 ` cvs-commit at gcc dot gnu.org
2022-03-30 8:15 ` [Bug tree-optimization/104675] [9/10 " jakub at gcc dot gnu.org
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-29 5:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:1a2772a3fe41bc0c33c4620540dae0103dcf7289
commit r11-9722-g1a2772a3fe41bc0c33c4620540dae0103dcf7289
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Feb 25 21:25:12 2022 +0100
match.pd: Further complex simplification fixes [PR104675]
Mark mentioned in the PR further 2 simplifications that also ICE
with complex types.
For these, eventually (but IMO GCC 13 materials) we could support it
for vector types if it would be uniform vector constants.
Currently integer_pow2p is true only for INTEGER_CSTs and COMPLEX_CSTs
and we can't use bit_and etc. for complex type.
2022-02-25 Jakub Jelinek <jakub@redhat.com>
Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/104675
* match.pd (t * 2U / 2 -> t & (~0 / 2), t / 2U * 2 -> t & ~1):
Restrict simplifications to INTEGRAL_TYPE_P.
* gcc.dg/pr104675-3.c : New test.
(cherry picked from commit f62115c9b770a66c5378f78a2d5866243d560573)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (11 preceding siblings ...)
2022-03-29 5:53 ` cvs-commit at gcc dot gnu.org
@ 2022-03-30 8:15 ` jakub at gcc dot gnu.org
2022-05-10 8:24 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-03-30 8:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11 Regression] ICE: |[9/10 Regression] ICE: in
|in expand_expr_real_2, at |expand_expr_real_2, at
|expr.cc:9773 at -O with |expr.cc:9773 at -O with
|__real__ + __imag__ |__real__ + __imag__
|extraction |extraction
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 11.3 too.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (12 preceding siblings ...)
2022-03-30 8:15 ` [Bug tree-optimization/104675] [9/10 " jakub at gcc dot gnu.org
@ 2022-05-10 8:24 ` cvs-commit at gcc dot gnu.org
2022-05-10 8:24 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10 8:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:1a8b7fb748f95646f314d5dd7a5af48542c3e925
commit r10-10688-g1a8b7fb748f95646f314d5dd7a5af48542c3e925
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Feb 25 10:55:17 2022 +0100
match.pd: Don't create BIT_NOT_EXPRs for COMPLEX_TYPE [PR104675]
We don't support BIT_{AND,IOR,XOR,NOT}_EXPR on complex types,
&/|/^ are just rejected for them, and ~ is parsed as CONJ_EXPR.
So, we should avoid simplifications which turn valid complex type
expressions into something that will ICE during expansion.
2022-02-25 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/104675
* match.pd (-A - 1 -> ~A, -1 - A -> ~A): Don't simplify for
COMPLEX_TYPE.
* gcc.dg/pr104675-1.c: New test.
* gcc.dg/pr104675-2.c: New test.
(cherry picked from commit 758671b88b78d7629376b118ec6ca6bcfbabbd36)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (13 preceding siblings ...)
2022-05-10 8:24 ` cvs-commit at gcc dot gnu.org
@ 2022-05-10 8:24 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:25 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10 8:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:3749dcd31f55ac72a162ecf83a40fa3278d3b086
commit r10-10690-g3749dcd31f55ac72a162ecf83a40fa3278d3b086
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Feb 25 21:25:12 2022 +0100
match.pd: Further complex simplification fixes [PR104675]
Mark mentioned in the PR further 2 simplifications that also ICE
with complex types.
For these, eventually (but IMO GCC 13 materials) we could support it
for vector types if it would be uniform vector constants.
Currently integer_pow2p is true only for INTEGER_CSTs and COMPLEX_CSTs
and we can't use bit_and etc. for complex type.
2022-02-25 Jakub Jelinek <jakub@redhat.com>
Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/104675
* match.pd (t * 2U / 2 -> t & (~0 / 2), t / 2U * 2 -> t & ~1):
Restrict simplifications to INTEGRAL_TYPE_P.
* gcc.dg/pr104675-3.c : New test.
(cherry picked from commit f62115c9b770a66c5378f78a2d5866243d560573)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (14 preceding siblings ...)
2022-05-10 8:24 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11 6:25 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:25 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:36 ` jakub at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-11 6:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:ff9fe8ef031ed29247b283201f6cfcf729502e11
commit r9-10134-gff9fe8ef031ed29247b283201f6cfcf729502e11
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Feb 25 10:55:17 2022 +0100
match.pd: Don't create BIT_NOT_EXPRs for COMPLEX_TYPE [PR104675]
We don't support BIT_{AND,IOR,XOR,NOT}_EXPR on complex types,
&/|/^ are just rejected for them, and ~ is parsed as CONJ_EXPR.
So, we should avoid simplifications which turn valid complex type
expressions into something that will ICE during expansion.
2022-02-25 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/104675
* match.pd (-A - 1 -> ~A, -1 - A -> ~A): Don't simplify for
COMPLEX_TYPE.
* gcc.dg/pr104675-1.c: New test.
* gcc.dg/pr104675-2.c: New test.
(cherry picked from commit 758671b88b78d7629376b118ec6ca6bcfbabbd36)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (15 preceding siblings ...)
2022-05-11 6:25 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11 6:25 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:36 ` jakub at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-11 6:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
--- Comment #17 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:870a9a8e82269a4213660459eabf0744d583e0c3
commit r9-10136-g870a9a8e82269a4213660459eabf0744d583e0c3
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Feb 25 21:25:12 2022 +0100
match.pd: Further complex simplification fixes [PR104675]
Mark mentioned in the PR further 2 simplifications that also ICE
with complex types.
For these, eventually (but IMO GCC 13 materials) we could support it
for vector types if it would be uniform vector constants.
Currently integer_pow2p is true only for INTEGER_CSTs and COMPLEX_CSTs
and we can't use bit_and etc. for complex type.
2022-02-25 Jakub Jelinek <jakub@redhat.com>
Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/104675
* match.pd (t * 2U / 2 -> t & (~0 / 2), t / 2U * 2 -> t & ~1):
Restrict simplifications to INTEGRAL_TYPE_P.
* gcc.dg/pr104675-3.c : New test.
(cherry picked from commit f62115c9b770a66c5378f78a2d5866243d560573)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug tree-optimization/104675] [9/10 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction
2022-02-24 10:24 [Bug rtl-optimization/104675] New: [9/10/11/12 Regression] ICE: in expand_expr_real_2, at expr.cc:9773 at -O with __real__ + __imag__ extraction zsojka at seznam dot cz
` (16 preceding siblings ...)
2022-05-11 6:25 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11 6:36 ` jakub at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-11 6:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 19+ messages in thread