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

Bug #626767 reported by Matt Joiner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
Fix Released
Medium
gcc-4.4 (Ubuntu)
Invalid
Low
Unassigned
gcc-4.5 (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Binary package hint: gcc-4.4

cpfs.c: In function ‘block_get’:
cpfs.c:367: error: implicit declaration of function ‘cache_get’ [-Wimplicit-function-declaration]
cpfs.c:367: warning: initialization makes pointer from integer without a cast
cpfs.c:369: error: void value not ignored as it ought to be
cpfs.c:369: error: void value not ignored as it ought to be
cpfs.c:369: error: expected ‘)’ before ‘;’ token
cpfs.c:391: error: expected expression before ‘}’ token
cpfs.c:368: confused by earlier errors, bailing out
Preprocessed source stored into /tmp/ccsLfgG3.out file, please attach this to your bugreport.

ProblemType: Crash
DistroRelease: Ubuntu 10.04
Package: cpp-4.4 4.4.3-4ubuntu5
ProcVersionSignature: Ubuntu 2.6.32-24.42-generic-pae 2.6.32.15+drm33.5
Uname: Linux 2.6.32-24-generic-pae i686
NonfreeKernelModules: nvidia
Architecture: i386
Date: Mon Aug 30 21:53:24 2010
ExecutablePath: /usr/lib/gcc/i486-linux-gnu/4.4.3/cc1
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
SourcePackage: gcc-4.4

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

Created attachment 19878
preprocessed source

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

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.

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

No longer working on this one.

Revision history for this message
Matt Joiner (anacrolix) wrote : crash running preprocessor

Binary package hint: gcc-4.4

cpfs.c: In function ‘block_get’:
cpfs.c:367: error: implicit declaration of function ‘cache_get’ [-Wimplicit-function-declaration]
cpfs.c:367: warning: initialization makes pointer from integer without a cast
cpfs.c:369: error: void value not ignored as it ought to be
cpfs.c:369: error: void value not ignored as it ought to be
cpfs.c:369: error: expected ‘)’ before ‘;’ token
cpfs.c:391: error: expected expression before ‘}’ token
cpfs.c:368: confused by earlier errors, bailing out
Preprocessed source stored into /tmp/ccsLfgG3.out file, please attach this to your bugreport.

ProblemType: Crash
DistroRelease: Ubuntu 10.04
Package: cpp-4.4 4.4.3-4ubuntu5
ProcVersionSignature: Ubuntu 2.6.32-24.42-generic-pae 2.6.32.15+drm33.5
Uname: Linux 2.6.32-24-generic-pae i686
NonfreeKernelModules: nvidia
Architecture: i386
Date: Mon Aug 30 21:53:24 2010
ExecutablePath: /usr/lib/gcc/i486-linux-gnu/4.4.3/cc1
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
SourcePackage: gcc-4.4

Revision history for this message
Matt Joiner (anacrolix) wrote :
Revision history for this message
Matthias Klose (doko) wrote :

note the proper error message before the internal compiler error.

Changed in gcc-4.4 (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Matthias Klose (doko) wrote :
Download full text (4.4 KiB)

current gcc-snapshot is more verbose:

cpfs.c:63:14: error: size of array 'static_assertion_static_assertion_at_line_63' is negative
cpfs.c: In function 'cache_init':
cpfs.c:232:5: error: 'for' loop initial declarations are only allowed in C99 mode
cpfs.c:232:5: note: use option -std=c99 or -std=gnu99 to compile your code
cpfs.c: In function 'block_get':
cpfs.c:367:30: warning: initialization makes pointer from integer without a cast [enabled by default]
cpfs.c:369:5: error: void value not ignored as it ought to be
cpfs.c:369:5: error: void value not ignored as it ought to be
cpfs.c:369:97: error: expected ')' before ';' token
cpfs.c:391:1: error: expected expression before '}' token
cpfs.c: In function 'block_put':
cpfs.c:395:30: warning: initialization makes pointer from integer without a cast [enabled by default]
cpfs.c: In function 'bitmap_manip':
cpfs.c:412:28: warning: initialization makes pointer from integer without a cast [enabled by default]
cpfs.c: In function 'cache_flush':
cpfs.c:436:5: error: 'for' loop initial declarations are only allowed in C99 mode
cpfs.c: In function 'cache_abort':
cpfs.c:462:5: error: 'for' loop initial declarations are only allowed in C99 mode
cpfs.c: In function 'cache_find':
cpfs.c:474:5: error: 'for' loop initial declarations are only allowed in C99 mode
cpfs.c: In function 'util_cpfs_enter':
cpfs.c:504:5: error: 'for' loop initial declarations are only allowed in C99 mode
cpfs.c: In function 'block_alloc':
cpfs.c:545:5: error: 'for' loop initial declarations are only allowed in C99 mode
cpfs.c:550:37: warning: initialization makes pointer from integer without a cast [enabled by default]
cpfs.c: In function 'bitmap_avail':
cpfs.c:583:5: error: 'for' loop initial declarations are only allowed in C99 mode
cpfs.c:588:39: warning: initialization makes pointer from integer without a cast [enabled by default]
cpfs.c:589:9: error: 'for' loop initial declarations are only allowed in C99 mode
cpfs.c: In function 'bitmap_reset':
cpfs.c:603:5: error: 'for' loop initial declarations are only allowed in C99 mode
cpfs.c: In function 'inode_get':
cpfs.c:636:27: warning: initialization makes pointer from integer without a cast [enabled by default]
cpfs.c: In function 'data_capacity':
cpfs.c:655:9: error: 'for' loop initial declarations are only allowed in C99 mode
cpfs.c: In function 'data_truncate_recurse':
cpfs.c:710:33: warning: initialization makes pointer from integer without a cast [enabled by default]
cpfs.c:712:9: error: 'for' loop initial declarations are only allowed in C99 mode
cpfs.c: In function 'data_truncate':
cpfs.c:749:31: warning: initialization makes pointer from integer without a cast [enabled by default]
cpfs.c:751:13: error: 'for' loop initial declarations are only allowed in C99 mode

cpfs.c: In function 'data_write_recurse':
cpfs.c:783:23: warning: initialization makes pointer from integer without a cast [enabled by default]
cpfs.c:790:33: warning: initialization makes pointer from integer without a cast [enabled by default]
cpfs.c:792:9: error: 'for' loop initial declarations are only allowed in C99 mode
cpfs.c: In function 'data_write':
cpfs.c:834:5: error: 'for' loop initial declarations are...

Read more...

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.

summary: - crash running preprocessor
+ [PR43082] ICE in tree check: expected class 'type', have 'exceptional'
+ (error_mark)
Changed in gcc-4.5 (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
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
status: Unknown → Confirmed
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

Revision history for this message
dino99 (9d9) wrote :

This version is outdated and no more supported

Changed in gcc-4.4 (Ubuntu):
status: Confirmed → Invalid
Changed in gcc-4.5 (Ubuntu):
status: Confirmed → Invalid
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.