* [Bug middle-end/46547] [4.5/4.6 Regression] internal compiler error when converting a long double complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
@ 2010-11-18 20:18 ` pinskia at gcc dot gnu.org
2010-11-18 20:20 ` [Bug c/46547] " pinskia at gcc dot gnu.org
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-11-18 20:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Known to work| |4.3.2
Keywords| |ice-on-valid-code
Last reconfirmed| |2010.11.18 20:16:14
Component|c |middle-end
Ever Confirmed|0 |1
Summary|internal compiler error |[4.5/4.6 Regression]
|when converting a long |internal compiler error
|double complex to a bool |when converting a long
| |double complex to a bool
Known to fail| |4.5.0, 4.6.0
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-11-18 20:16:14 UTC ---
Confirmed.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5/4.6 Regression] internal compiler error when converting a long double complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
2010-11-18 20:18 ` [Bug middle-end/46547] [4.5/4.6 Regression] " pinskia at gcc dot gnu.org
@ 2010-11-18 20:20 ` pinskia at gcc dot gnu.org
2010-11-18 20:20 ` [Bug c/46547] [4.5/4.6 Regression] internal compiler error when converting a " pinskia at gcc dot gnu.org
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-11-18 20:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|middle-end |c
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-11-18 20:17:50 UTC ---
<<< Unknown tree: c_maybe_const_expr
SAVE_EXPR <*s++ > >>>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5/4.6 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
2010-11-18 20:18 ` [Bug middle-end/46547] [4.5/4.6 Regression] " pinskia at gcc dot gnu.org
2010-11-18 20:20 ` [Bug c/46547] " pinskia at gcc dot gnu.org
@ 2010-11-18 20:20 ` pinskia at gcc dot gnu.org
2010-11-18 20:51 ` pinskia at gcc dot gnu.org
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-11-18 20:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jsm28 at gcc dot gnu.org
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-11-18 20:19:43 UTC ---
Any complex type will cause this ICE.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5/4.6 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
` (2 preceding siblings ...)
2010-11-18 20:20 ` [Bug c/46547] [4.5/4.6 Regression] internal compiler error when converting a " pinskia at gcc dot gnu.org
@ 2010-11-18 20:51 ` pinskia at gcc dot gnu.org
2010-11-19 8:47 ` jakub at gcc dot gnu.org
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-11-18 20:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.5.2
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5/4.6 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
` (3 preceding siblings ...)
2010-11-18 20:51 ` pinskia at gcc dot gnu.org
@ 2010-11-19 8:47 ` jakub at gcc dot gnu.org
2010-11-19 8:56 ` jakub at gcc dot gnu.org
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-19 8:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
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> 2010-11-19 08:38:53 UTC ---
The problem is that c_fully_fold_internal doesn't recurse on the RHS of a
MODIFY_EXPR:
/* The RHS of a MODIFY_EXPR was fully folded when building that
expression for the sake of conversion warnings. */
While this is true, here RHS was INDIRECT_REF of a POSTINCREMENT_EXPR of
PARM_DECL, all with COMPLEX_TYPE or pointers to that and it was fully folded.
But afterwards when this RHS is convert()ed to the LHS type,
c_common_truthvalue_conversion is called and introduces new C_MAYBE_CONST_EXPRs
into it.
I wonder if we couldn't swap the order of c_fully_fold and
convert_for_assignment
in build_modify_expr:
newrhs = c_fully_fold (newrhs, false, NULL);
if (rhs_semantic_type)
newrhs = build1 (EXCESS_PRECISION_EXPR, rhs_semantic_type, newrhs);
newrhs = convert_for_assignment (location, lhstype, newrhs, rhs_origtype,
ic_assign, npc, NULL_TREE, NULL_TREE,
0);
so that it would be fully folding also whatever was added by
convert_for_assignment. Joseph?
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5/4.6 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
` (4 preceding siblings ...)
2010-11-19 8:47 ` jakub at gcc dot gnu.org
@ 2010-11-19 8:56 ` jakub at gcc dot gnu.org
2010-11-19 13:02 ` joseph at codesourcery dot com
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-19 8:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-19 08:46:46 UTC ---
Actually, reading that comment again it, the conversion warnings are probably
emitted during convert_for_assignment and thus the earlier c_fully_fold is
needed. Perhaps we need another c_fully_fold if convert_for_assignment
returned something different from the passed argument, or remove the if (code
!= MODIFY_EXPR) guard for c_fully_fold_internal on the RHS of a MODIFY_EXPR.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5/4.6 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
` (5 preceding siblings ...)
2010-11-19 8:56 ` jakub at gcc dot gnu.org
@ 2010-11-19 13:02 ` joseph at codesourcery dot com
2010-11-19 13:19 ` hjl.tools at gmail dot com
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: joseph at codesourcery dot com @ 2010-11-19 13:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
--- Comment #6 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2010-11-19 13:01:35 UTC ---
My inclination is that the problem is a missing check of
in_late_binary_op. Specifically, that c_common_truthvalue_conversion
should call save_expr instead of c_save_expr if in_late_binary_op (which
in turn requires that in_late_binary_op move from c-tree.h/c-typeck.c to
being defined/declared in c-family code).
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5/4.6 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
` (6 preceding siblings ...)
2010-11-19 13:02 ` joseph at codesourcery dot com
@ 2010-11-19 13:19 ` hjl.tools at gmail dot com
2010-11-19 13:22 ` hjl.tools at gmail dot com
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: hjl.tools at gmail dot com @ 2010-11-19 13:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> 2010-11-19 13:18:21 UTC ---
It is caused by revision 46547:
http://gcc.gnu.org/ml/gcc-cvs/2009-03/msg00761.html
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5/4.6 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
` (7 preceding siblings ...)
2010-11-19 13:19 ` hjl.tools at gmail dot com
@ 2010-11-19 13:22 ` hjl.tools at gmail dot com
2010-11-19 17:30 ` jsm28 at gcc dot gnu.org
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: hjl.tools at gmail dot com @ 2010-11-19 13:22 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> 2010-11-19 13:18:55 UTC ---
It is caused by revision 145254:
http://gcc.gnu.org/ml/gcc-cvs/2009-03/msg00761.html
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5/4.6 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
` (8 preceding siblings ...)
2010-11-19 13:22 ` hjl.tools at gmail dot com
@ 2010-11-19 17:30 ` jsm28 at gcc dot gnu.org
2010-11-19 18:40 ` jsm28 at gcc dot gnu.org
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2010-11-19 17:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jsm28 at gcc dot gnu.org
|gnu.org |
--- Comment #9 from Joseph S. Myers <jsm28 at gcc dot gnu.org> 2010-11-19 17:20:15 UTC ---
Testing a patch.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5/4.6 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
` (9 preceding siblings ...)
2010-11-19 17:30 ` jsm28 at gcc dot gnu.org
@ 2010-11-19 18:40 ` jsm28 at gcc dot gnu.org
2010-11-19 20:46 ` [Bug c/46547] [4.5 " jsm28 at gcc dot gnu.org
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2010-11-19 18:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
--- Comment #10 from Joseph S. Myers <jsm28 at gcc dot gnu.org> 2010-11-19 18:33:02 UTC ---
Author: jsm28
Date: Fri Nov 19 18:32:57 2010
New Revision: 166951
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166951
Log:
PR c/46547
* c-tree.h (in_late_binary_op): Move to c-family/c-common.h.
* c-typeck.c (in_late_binary_op): Move to c-family/c-common.c.
c-family:
* c-common.c (in_late_binary_op): Define.
(c_common_truthvalue_conversion): Check in_late_binary_op before
calling c_save_expr.
* c-common.h (in_late_binary_op): Declare.
testsuite:
* gcc.c-torture/compile/pr46547-1.c: New test.
Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr46547-1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-common.c
trunk/gcc/c-family/c-common.h
trunk/gcc/c-tree.h
trunk/gcc/c-typeck.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
` (10 preceding siblings ...)
2010-11-19 18:40 ` jsm28 at gcc dot gnu.org
@ 2010-11-19 20:46 ` jsm28 at gcc dot gnu.org
2010-11-19 20:56 ` jsm28 at gcc dot gnu.org
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2010-11-19 20:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
--- Comment #11 from Joseph S. Myers <jsm28 at gcc dot gnu.org> 2010-11-19 20:45:07 UTC ---
Author: jsm28
Date: Fri Nov 19 20:45:00 2010
New Revision: 166957
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166957
Log:
PR c/46547
* c-common.c (in_late_binary_op): Define.
(c_common_truthvalue_conversion): Check in_late_binary_op before
calling c_save_expr.
* c-common.h (in_late_binary_op): Declare.
* c-tree.h (in_late_binary_op): Move to c-common.h.
* c-typeck.c (in_late_binary_op): Move to c-common.c.
testsuite:
* gcc.c-torture/compile/pr46547-1.c: New test.
Added:
branches/gcc-4_5-branch/gcc/testsuite/gcc.c-torture/compile/pr46547-1.c
Modified:
branches/gcc-4_5-branch/gcc/ChangeLog
branches/gcc-4_5-branch/gcc/c-common.c
branches/gcc-4_5-branch/gcc/c-common.h
branches/gcc-4_5-branch/gcc/c-tree.h
branches/gcc-4_5-branch/gcc/c-typeck.c
branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
` (11 preceding siblings ...)
2010-11-19 20:46 ` [Bug c/46547] [4.5 " jsm28 at gcc dot gnu.org
@ 2010-11-19 20:56 ` jsm28 at gcc dot gnu.org
2010-11-19 21:03 ` dominiq at lps dot ens.fr
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2010-11-19 20:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Known to work| |4.5.2
Resolution| |FIXED
--- Comment #12 from Joseph S. Myers <jsm28 at gcc dot gnu.org> 2010-11-19 20:54:28 UTC ---
Fixed for 4.5.2 and 4.6.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
` (12 preceding siblings ...)
2010-11-19 20:56 ` jsm28 at gcc dot gnu.org
@ 2010-11-19 21:03 ` dominiq at lps dot ens.fr
2010-11-19 23:47 ` jakub at gcc dot gnu.org
2010-11-19 23:48 ` jakub at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: dominiq at lps dot ens.fr @ 2010-11-19 21:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
--- Comment #13 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2010-11-19 21:01:04 UTC ---
Revision 166951 breaks bootstrap with obj-c++ enabled:
ld: duplicate symbol _in_late_binary_op in c-family/c-common.o and
objcp/objcp-act.o
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
` (13 preceding siblings ...)
2010-11-19 21:03 ` dominiq at lps dot ens.fr
@ 2010-11-19 23:47 ` jakub at gcc dot gnu.org
2010-11-19 23:48 ` jakub at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-19 23:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-19 23:44:51 UTC ---
Author: jakub
Date: Fri Nov 19 23:44:47 2010
New Revision: 166964
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166964
Log:
PR c/46547
* objc-act.c (in_late_binary_op): Remove.
Modified:
trunk/gcc/objc/ChangeLog
trunk/gcc/objc/objc-act.c
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/46547] [4.5 Regression] internal compiler error when converting a complex to a bool
2010-11-18 20:05 [Bug c/46547] New: internal compiler error when converting a long double complex to a bool kumbera1 at llnl dot gov
` (14 preceding siblings ...)
2010-11-19 23:47 ` jakub at gcc dot gnu.org
@ 2010-11-19 23:48 ` jakub at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-19 23:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46547
--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-19 23:47:01 UTC ---
Author: jakub
Date: Fri Nov 19 23:46:57 2010
New Revision: 166965
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166965
Log:
PR c/46547
* objc-act.c (in_late_binary_op): Remove.
Modified:
branches/gcc-4_5-branch/gcc/objc/ChangeLog
branches/gcc-4_5-branch/gcc/objc/objc-act.c
^ permalink raw reply [flat|nested] 17+ messages in thread