* [Bug c/47150] 4.5.1/4.5.2 ICE in gimplify_expr, at gimplify.c:7146/7153 on fairly simple complex expression
2011-01-01 22:23 [Bug c/47150] New: 4.5.1/4.5.2 ICE in gimplify_expr, at gimplify.c:7146/7153 on fairly simple complex expression ewleaver at comcast dot net
@ 2011-01-01 22:52 ` hjl.tools at gmail dot com
2011-01-01 22:57 ` [Bug c/47150] [4.5/4.6 Regression] ICE in gimplify_expr at gimplify.c hjl.tools at gmail dot com
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: hjl.tools at gmail dot com @ 2011-01-01 22:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47150
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2011.01.01 22:52:36
Ever Confirmed|0 |1
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2011-01-01 22:52:36 UTC ---
Please only upload the output of "gcc -E gimplify_bug.c"
and tell us how to reproduce it.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/47150] [4.5/4.6 Regression] ICE in gimplify_expr at gimplify.c
2011-01-01 22:23 [Bug c/47150] New: 4.5.1/4.5.2 ICE in gimplify_expr, at gimplify.c:7146/7153 on fairly simple complex expression ewleaver at comcast dot net
2011-01-01 22:52 ` [Bug c/47150] " hjl.tools at gmail dot com
@ 2011-01-01 22:57 ` hjl.tools at gmail dot com
2011-01-01 22:59 ` hjl.tools at gmail dot com
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: hjl.tools at gmail dot com @ 2011-01-01 22:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47150
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Target Milestone|--- |4.5.3
Summary|4.5.1/4.5.2 ICE in |[4.5/4.6 Regression] ICE in
|gimplify_expr, at |gimplify_expr at gimplify.c
|gimplify.c:7146/7153 on |
|fairly simple complex |
|expression |
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2011-01-01 22:57:44 UTC ---
[hjl@gnu-35 rrs]$ cat pr47150.c
float _Complex cmplx(float re, float im);
void bad_test(){
float w = 2;
float _Complex b;
b = 0.5*(cmplx(0,w)+cmplx(1,w)/w);
}
[hjl@gnu-35 rrs]$ /export/gnu/import/rrs/147281/usr/bin/gcc -S pr47150.c
pr47150.c: In function \u2018bad_test\u2019:
pr47150.c:5: internal compiler error: in gimplify_expr, at gimplify.c:7045
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[hjl@gnu-35 rrs]$
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/47150] [4.5/4.6 Regression] ICE in gimplify_expr at gimplify.c
2011-01-01 22:23 [Bug c/47150] New: 4.5.1/4.5.2 ICE in gimplify_expr, at gimplify.c:7146/7153 on fairly simple complex expression ewleaver at comcast dot net
2011-01-01 22:52 ` [Bug c/47150] " hjl.tools at gmail dot com
2011-01-01 22:57 ` [Bug c/47150] [4.5/4.6 Regression] ICE in gimplify_expr at gimplify.c hjl.tools at gmail dot com
@ 2011-01-01 22:59 ` hjl.tools at gmail dot com
2011-01-03 11:16 ` jakub at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: hjl.tools at gmail dot com @ 2011-01-01 22:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47150
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jsm28 at gcc dot gnu.org
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2011-01-01 22:59:41 UTC ---
It is caused by revision 147281:
http://gcc.gnu.org/ml/gcc-cvs/2009-05/msg00255.html
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/47150] [4.5/4.6 Regression] ICE in gimplify_expr at gimplify.c
2011-01-01 22:23 [Bug c/47150] New: 4.5.1/4.5.2 ICE in gimplify_expr, at gimplify.c:7146/7153 on fairly simple complex expression ewleaver at comcast dot net
` (2 preceding siblings ...)
2011-01-01 22:59 ` hjl.tools at gmail dot com
@ 2011-01-03 11:16 ` jakub at gcc dot gnu.org
2011-01-03 16:22 ` joseph at codesourcery dot com
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-03 11:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47150
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-03 11:16:35 UTC ---
The problem is in save_expr called by convert_to_complex when converting
non-COMPLEX_EXPR _Complex float expression to _Complex double. As this is not
c_save_expr that is called there (and can't, because convert_to_complex is used
in non-Cish FEs), c_fully_fold is not called on the argument and as further
c_fully_fold doesn't dive into SAVE_EXPRs, nothing afterwards fully folds it
either, which means it survives until gimplification and crashes there.
An ugly fix would be duplicate the problematic part of convert_to_complex in
c-convert.c (if converting COMPLEX_TYPE to a different COMPLEX_TYPE and
expression is not COMPLEX_EXPR) and use c_save_expr there instead.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/47150] [4.5/4.6 Regression] ICE in gimplify_expr at gimplify.c
2011-01-01 22:23 [Bug c/47150] New: 4.5.1/4.5.2 ICE in gimplify_expr, at gimplify.c:7146/7153 on fairly simple complex expression ewleaver at comcast dot net
` (3 preceding siblings ...)
2011-01-03 11:16 ` jakub at gcc dot gnu.org
@ 2011-01-03 16:22 ` joseph at codesourcery dot com
2011-01-03 21:44 ` [Bug middle-end/47150] " rguenth at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: joseph at codesourcery dot com @ 2011-01-03 16:22 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47150
--- Comment #5 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2011-01-03 16:22:17 UTC ---
On Mon, 3 Jan 2011, jakub at gcc dot gnu.org wrote:
> The problem is in save_expr called by convert_to_complex when converting
> non-COMPLEX_EXPR _Complex float expression to _Complex double. As this is not
> c_save_expr that is called there (and can't, because convert_to_complex is used
> in non-Cish FEs), c_fully_fold is not called on the argument and as further
The non-C-family front ends seems generally to be using it in their
implementations of "convert", the legacy magic-name langhook. If this
could be eliminated (making remaining users in the language-independent
compiler use fold_convert unless they really need language-specific
semantics) then quite possibly the "convert" functions in those front ends
could go away and much of convert.c could move into c-family code (it does
checks for invalid conversions and gives errors for them, which is clearly
something that belongs in front ends) - while some of those front ends use
their own "convert" functions internally, they may well not need special
semantics for complex types that fold_convert doesn't have. But this
certainly isn't a Stage 4 fix....
> c_fully_fold doesn't dive into SAVE_EXPRs, nothing afterwards fully folds it
> either, which means it survives until gimplification and crashes there.
>
> An ugly fix would be duplicate the problematic part of convert_to_complex in
> c-convert.c (if converting COMPLEX_TYPE to a different COMPLEX_TYPE and
> expression is not COMPLEX_EXPR) and use c_save_expr there instead.
In view of the above and the notion that convert_to_complex really belongs
in the front ends, this seems reasonable.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/47150] [4.5/4.6 Regression] ICE in gimplify_expr at gimplify.c
2011-01-01 22:23 [Bug c/47150] New: 4.5.1/4.5.2 ICE in gimplify_expr, at gimplify.c:7146/7153 on fairly simple complex expression ewleaver at comcast dot net
` (4 preceding siblings ...)
2011-01-03 16:22 ` joseph at codesourcery dot com
@ 2011-01-03 21:44 ` rguenth at gcc dot gnu.org
2011-01-03 21:53 ` [Bug c/47150] " jakub at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-03 21:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47150
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
Component|c |middle-end
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/47150] [4.5/4.6 Regression] ICE in gimplify_expr at gimplify.c
2011-01-01 22:23 [Bug c/47150] New: 4.5.1/4.5.2 ICE in gimplify_expr, at gimplify.c:7146/7153 on fairly simple complex expression ewleaver at comcast dot net
` (5 preceding siblings ...)
2011-01-03 21:44 ` [Bug middle-end/47150] " rguenth at gcc dot gnu.org
@ 2011-01-03 21:53 ` jakub at gcc dot gnu.org
2011-01-05 13:31 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-03 21:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47150
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|middle-end |c
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-03 21:53:13 UTC ---
It is a C FE bug actually, so c component is correct.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/47150] [4.5/4.6 Regression] ICE in gimplify_expr at gimplify.c
2011-01-01 22:23 [Bug c/47150] New: 4.5.1/4.5.2 ICE in gimplify_expr, at gimplify.c:7146/7153 on fairly simple complex expression ewleaver at comcast dot net
` (6 preceding siblings ...)
2011-01-03 21:53 ` [Bug c/47150] " jakub at gcc dot gnu.org
@ 2011-01-05 13:31 ` jakub at gcc dot gnu.org
2011-01-06 11:07 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-05 13:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47150
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org
|gnu.org |
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-05 13:31:07 UTC ---
Created attachment 22903
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22903
gcc46-pr47150.patch
Untested fix.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/47150] [4.5/4.6 Regression] ICE in gimplify_expr at gimplify.c
2011-01-01 22:23 [Bug c/47150] New: 4.5.1/4.5.2 ICE in gimplify_expr, at gimplify.c:7146/7153 on fairly simple complex expression ewleaver at comcast dot net
` (7 preceding siblings ...)
2011-01-05 13:31 ` jakub at gcc dot gnu.org
@ 2011-01-06 11:07 ` jakub at gcc dot gnu.org
2011-01-06 11:18 ` [Bug c/47150] [4.5 " jakub at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-06 11:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47150
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-06 10:37:09 UTC ---
Author: jakub
Date: Thu Jan 6 10:37:02 2011
New Revision: 168537
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168537
Log:
PR c/47150
* c-convert.c (convert): When converting a complex expression
other than COMPLEX_EXPR to a different complex type, ensure
c_save_expr is called instead of save_expr, unless in_late_binary_op.
* c-typeck.c (convert_for_assignment): Set in_late_binary_op also
when converting COMPLEX_TYPE.
* gcc.c-torture/compile/pr47150.c: New test.
Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr47150.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-convert.c
trunk/gcc/c-typeck.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/47150] [4.5 Regression] ICE in gimplify_expr at gimplify.c
2011-01-01 22:23 [Bug c/47150] New: 4.5.1/4.5.2 ICE in gimplify_expr, at gimplify.c:7146/7153 on fairly simple complex expression ewleaver at comcast dot net
` (8 preceding siblings ...)
2011-01-06 11:07 ` jakub at gcc dot gnu.org
@ 2011-01-06 11:18 ` jakub at gcc dot gnu.org
2011-01-16 20:36 ` jakub at gcc dot gnu.org
2011-01-17 8:08 ` jakub at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-06 11:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47150
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.6.0
Summary|[4.5/4.6 Regression] ICE in |[4.5 Regression] ICE in
|gimplify_expr at gimplify.c |gimplify_expr at gimplify.c
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-06 11:07:05 UTC ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/47150] [4.5 Regression] ICE in gimplify_expr at gimplify.c
2011-01-01 22:23 [Bug c/47150] New: 4.5.1/4.5.2 ICE in gimplify_expr, at gimplify.c:7146/7153 on fairly simple complex expression ewleaver at comcast dot net
` (9 preceding siblings ...)
2011-01-06 11:18 ` [Bug c/47150] [4.5 " jakub at gcc dot gnu.org
@ 2011-01-16 20:36 ` jakub at gcc dot gnu.org
2011-01-17 8:08 ` jakub at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-16 20:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47150
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-16 20:26:37 UTC ---
Author: jakub
Date: Sun Jan 16 20:26:27 2011
New Revision: 168869
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168869
Log:
Backport from mainline
2011-01-06 Jakub Jelinek <jakub@redhat.com>
PR c/47150
* c-convert.c (convert): When converting a complex expression
other than COMPLEX_EXPR to a different complex type, ensure
c_save_expr is called instead of save_expr, unless in_late_binary_op.
* c-typeck.c (convert_for_assignment): Set in_late_binary_op also
when converting COMPLEX_TYPE.
* gcc.c-torture/compile/pr47150.c: New test.
Added:
branches/gcc-4_5-branch/gcc/testsuite/gcc.c-torture/compile/pr47150.c
Modified:
branches/gcc-4_5-branch/gcc/ChangeLog
branches/gcc-4_5-branch/gcc/c-convert.c
branches/gcc-4_5-branch/gcc/c-typeck.c
branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/47150] [4.5 Regression] ICE in gimplify_expr at gimplify.c
2011-01-01 22:23 [Bug c/47150] New: 4.5.1/4.5.2 ICE in gimplify_expr, at gimplify.c:7146/7153 on fairly simple complex expression ewleaver at comcast dot net
` (10 preceding siblings ...)
2011-01-16 20:36 ` jakub at gcc dot gnu.org
@ 2011-01-17 8:08 ` jakub at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-17 8:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47150
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-17 08:06:04 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 13+ messages in thread