seen with 4.3, 4.4 and trunk: $ gcc -c main.i main.c: In function 'main': main.c:22:5: error: void value not ignored as it ought to be main.c:22:5: error: void value not ignored as it ought to be main.c:22:8: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at tree-ssa.c:1233 Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-snapshot/README.Bugs> for instructions.
Created attachment 19878 [details] preprocessed source
We get 6493 STRIP_USELESS_TYPE_CONVERSION (*expr_p); (gdb) call debug_tree (*expr_p) <nop_expr 0x7ffff5b99150 type <boolean_type 0x7ffff7ee4888 _Bool public unsigned QI size <integer_cst 0x7ffff7ed2730 constant 8> unit size <integer_cst 0x7ffff7ed2758 constant 1> align 8 symtab 0 alias set -1 canonical type 0x7ffff7ee4888 precision 1 min <integer_cst 0x7ffff7ed2b68 0> max <integer_cst 0x7ffff7ed2bb8 1>> arg 0 <cond_expr 0x7ffff5b48280 type <error_mark 0x7ffff7edab70> The FEs shouldn't feed us random crap really ...
Reduced testcase: int main(void) { int gpf; if(gpf ? (void) (0) : f ()) ; } --- CUT --- Looking into it.
I get: t1.c:4:7: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in get_narrower, at tree.c:7654 Now.
I have a patch to c_common_truthvalue_conversion which fixes this issue.
No longer working on this one.
trunk 20100918 fails with: gcc -g -O0 -c foo.c foo.c: In function 'main': foo.c:4:5: error: void value not ignored as it ought to be foo.c:4:5: error: void value not ignored as it ought to be foo.c:4:7: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in get_narrower, at tree.c:7856 Please submit a full bug report, with preprocessed source if appropriate.
This is a regression since my stock RedHat gcc 4.1.2 compiler doesn't ICE. I have a patch that should address Joseph's comments to Andrew's original patch. I'll submit it once it's finished testing. Thanks
Author: nicola Date: Thu Jan 27 02:09:13 2011 New Revision: 169319 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169319 Log: In gcc/: 2011-01-26 Nicola Pero <nicola.pero@meta-innovation.com> PR c/43082 * c-typeck.c (c_objc_common_truthvalue_conversion): If we are passed a VOID_TYPE expression, immediately emit an error and return error_mark_node. In gcc/testsuite/: 2011-01-26 Nicola Pero <nicola.pero@meta-innovation.com> Andrew Pinski <pinskia@gmail.com> PR c/43082 * gcc.dg/pr43082.c: New. Added: trunk/gcc/testsuite/gcc.dg/pr43082.c Modified: trunk/gcc/ChangeLog trunk/gcc/c-typeck.c trunk/gcc/testsuite/ChangeLog
Fixed in GCC trunk/4.6.0. Thanks
Author: dnovillo Date: Wed Feb 2 17:55:55 2011 New Revision: 169639 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169639 Log: In gcc/: 2011-01-26 Nicola Pero <nicola.pero@meta-innovation.com> PR c/43082 * c-typeck.c (c_objc_common_truthvalue_conversion): If we are passed a VOID_TYPE expression, immediately emit an error and return error_mark_node. In gcc/testsuite/: 2011-01-26 Nicola Pero <nicola.pero@meta-innovation.com> Andrew Pinski <pinskia@gmail.com> PR c/43082 * gcc.dg/pr43082.c: New. Added: branches/google/integration/gcc/testsuite/gcc.dg/pr43082.c Modified: branches/google/integration/gcc/ChangeLog branches/google/integration/gcc/c-typeck.c branches/google/integration/gcc/testsuite/ChangeLog