[PR43082] ICE in tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p

Bug #521112 reported by Steven Sroka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
Fix Released
Medium
gcc-4.4 (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: gcc-4.4

I was just compiling a simple C programming through Netbeans 6.8 when Apport popped up saying cc(1) crashed.

ProblemType: Crash
Architecture: amd64
CheckboxSubmission: 8fd4227425960116f6d27ff3861ffb00
CheckboxSystem: e704f33cc0866ff0f0256a33de39ea1c
Date: Fri Feb 12 12:41:53 2010
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/lib/gcc/x86_64-linux-gnu/4.4.1/cc1
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
LiveMediaBuild: Linux Mint KDE64 CE 8 "Helena" - Release x86_64 (20100209.1)
NonfreeKernelModules: fglrx
Package: cpp-4.4 4.4.1-4ubuntu9
ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
SourcePackage: gcc-4.4
Uname: Linux 2.6.31-19-generic x86_64

Revision history for this message
Steven Sroka (lin-unix) wrote :
Revision history for this message
In , Matthias Klose (doko) wrote :

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.

Revision history for this message
In , Matthias Klose (doko) wrote :

Created attachment 19878
preprocessed source

Revision history for this message
Matthias Klose (doko) wrote : Re: GCC 4.4 crashed with using Netbeans 6.8

the bug is in your code, however gcc shouldn't ICE.

$ 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

Changed in gcc-4.4 (Ubuntu):
importance: Undecided → Low
status: New → Triaged
summary: - GCC 4.4 crashed with using Netbeans 6.8
+ [PR43082] ICE in tree check: expected class 'type', have 'exceptional'
+ (error_mark) in useless_type_conversion_p
Changed in gcc:
status: Unknown → New
Revision history for this message
In , Rguenth (rguenth) wrote :

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 ...

Changed in gcc:
status: New → Confirmed
Revision history for this message
In , Pinskia (pinskia) wrote :

Reduced testcase:
int main(void)
{
    int gpf;
    if(gpf ? (void) (0) : f ()) ;
}
--- CUT ---
Looking into it.

Revision history for this message
In , Pinskia (pinskia) wrote :

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.

Revision history for this message
In , Pinskia (pinskia) wrote :

I have a patch to c_common_truthvalue_conversion which fixes this issue.

Changed in gcc:
status: Confirmed → In Progress
Revision history for this message
In , Pinskia (pinskia) wrote :

No longer working on this one.

Changed in gcc:
status: In Progress → Confirmed
Revision history for this message
In , Matthias Klose (doko) wrote :

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.

Revision history for this message
In , Nicola-gcc (nicola-gcc) wrote :

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

Changed in gcc:
importance: Unknown → Medium
Revision history for this message
In , Nicola-gcc (nicola-gcc) wrote :

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 <email address hidden>

 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 <email address hidden>
     Andrew Pinski <email address hidden>

 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

Revision history for this message
In , Nicola-gcc (nicola-gcc) wrote :

Fixed in GCC trunk/4.6.0.

Thanks

Changed in gcc:
status: Confirmed → Fix Released
Revision history for this message
In , Dnovillo (dnovillo) wrote :

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 <email address hidden>

 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 <email address hidden>
     Andrew Pinski <email address hidden>

 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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.