public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42219] New: [4.5 Regression] ICE with "const void" as parameter type
@ 2009-11-29 15:58 reichelt at gcc dot gnu dot org
2009-11-29 15:58 ` [Bug c++/42219] " reichelt at gcc dot gnu dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-11-29 15:58 UTC (permalink / raw)
To: gcc-bugs
The following invalid code snippet triggers an ICE on trunk:
=============================
void foo(const void);
void bar()
{
void (*pf)() = foo;
}
=============================
bug.cc:1:16: error: '<anonymous>' has incomplete type
bug.cc:1:20: error: invalid use of 'const void'
bug.cc: In function 'void bar()':
bug.cc:5:18: error: invalid conversion from 'void (*)(<type error>)' to 'void
(*)()'
bug.cc:5:18: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in useless_type_conversion_p, at tree-ssa.c:1426
Please submit a full bug report, [etc.]
--
Summary: [4.5 Regression] ICE with "const void" as parameter type
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code, error-recovery, monitored
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42219
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/42219] [4.5 Regression] ICE with "const void" as parameter type
2009-11-29 15:58 [Bug c++/42219] New: [4.5 Regression] ICE with "const void" as parameter type reichelt at gcc dot gnu dot org
@ 2009-11-29 15:58 ` reichelt at gcc dot gnu dot org
2009-11-29 16:04 ` rguenth at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-11-29 15:58 UTC (permalink / raw)
To: gcc-bugs
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42219
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/42219] [4.5 Regression] ICE with "const void" as parameter type
2009-11-29 15:58 [Bug c++/42219] New: [4.5 Regression] ICE with "const void" as parameter type reichelt at gcc dot gnu dot org
2009-11-29 15:58 ` [Bug c++/42219] " reichelt at gcc dot gnu dot org
@ 2009-11-29 16:04 ` rguenth at gcc dot gnu dot org
2009-11-30 3:39 ` hjl dot tools at gmail dot com
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-11-29 16:04 UTC (permalink / raw)
To: gcc-bugs
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42219
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/42219] [4.5 Regression] ICE with "const void" as parameter type
2009-11-29 15:58 [Bug c++/42219] New: [4.5 Regression] ICE with "const void" as parameter type reichelt at gcc dot gnu dot org
2009-11-29 15:58 ` [Bug c++/42219] " reichelt at gcc dot gnu dot org
2009-11-29 16:04 ` rguenth at gcc dot gnu dot org
@ 2009-11-30 3:39 ` hjl dot tools at gmail dot com
2009-11-30 10:02 ` rguenth at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-11-30 3:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from hjl dot tools at gmail dot com 2009-11-30 03:39 -------
It is caused by revision 150519:
http://gcc.gnu.org/ml/gcc-cvs/2009-08/msg00199.html
--
hjl dot tools at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-11-30 03:39:26
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42219
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/42219] [4.5 Regression] ICE with "const void" as parameter type
2009-11-29 15:58 [Bug c++/42219] New: [4.5 Regression] ICE with "const void" as parameter type reichelt at gcc dot gnu dot org
` (2 preceding siblings ...)
2009-11-30 3:39 ` hjl dot tools at gmail dot com
@ 2009-11-30 10:02 ` rguenth at gcc dot gnu dot org
2009-12-11 16:31 ` jason at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-11-30 10:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2009-11-30 10:02 -------
Err - well. I can certainly paper over the problem by ignoring
error_mark_node,
but ... why does the bogus type survive until gimplification?
Thus,
<function_type 0x7ffff6f0cdc8
type <void_type 0x7ffff7eeae70 void VOID
align 8 symtab 0 alias set -1 canonical type 0x7ffff7eeae70
pointer_to_this <pointer_type 0x7ffff7eeaf18>>
QI
size <integer_cst 0x7ffff7ed5730 type <integer_type 0x7ffff7eea0a8
bit_size_type> constant 8>
unit size <integer_cst 0x7ffff7ed5758 type <integer_type 0x7ffff7eea000
long unsigned int> constant 1>
align 8 symtab 0 alias set -1 structural equality
arg-types <tree_list 0x7ffff6f01a78 value <error_mark 0x7ffff7eddc90>
chain <tree_list 0x7ffff7efb578 value <void_type 0x7ffff7eeae70 void>>>
pointer_to_this <pointer_type 0x7ffff6f1e0a8>>
as the type for foo in
pf = (void (*<T3f1>) (void)) foo
?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42219
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/42219] [4.5 Regression] ICE with "const void" as parameter type
2009-11-29 15:58 [Bug c++/42219] New: [4.5 Regression] ICE with "const void" as parameter type reichelt at gcc dot gnu dot org
` (3 preceding siblings ...)
2009-11-30 10:02 ` rguenth at gcc dot gnu dot org
@ 2009-12-11 16:31 ` jason at gcc dot gnu dot org
2009-12-11 21:04 ` jason at gcc dot gnu dot org
2009-12-14 8:46 ` reichelt at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-12-11 16:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jason at gcc dot gnu dot org 2009-12-11 16:31 -------
The problem is that we create a FUNCTION_TYPE with error_mark_node parameter
type for error recovery, and then ptr_reasonably_similar tries to consider
conversions that are almost right in order to give better error messages (and
allow some with -fpermissive), and it thinks any function types are close
enough without noticing that we're dealing with an erroneous one.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jason at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2009-11-30 03:39:26 |2009-12-11 16:31:31
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42219
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/42219] [4.5 Regression] ICE with "const void" as parameter type
2009-11-29 15:58 [Bug c++/42219] New: [4.5 Regression] ICE with "const void" as parameter type reichelt at gcc dot gnu dot org
` (4 preceding siblings ...)
2009-12-11 16:31 ` jason at gcc dot gnu dot org
@ 2009-12-11 21:04 ` jason at gcc dot gnu dot org
2009-12-14 8:46 ` reichelt at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-12-11 21:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jason at gcc dot gnu dot org 2009-12-11 21:04 -------
Subject: Bug 42219
Author: jason
Date: Fri Dec 11 21:03:55 2009
New Revision: 155177
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155177
Log:
PR c++/42219
* typeck.c (error_type_p): New.
(ptr_reasonably_similar): Use it.
* cp-tree.h: Declare it.
Added:
trunk/gcc/testsuite/g++.dg/conversion/err-recover1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42219
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/42219] [4.5 Regression] ICE with "const void" as parameter type
2009-11-29 15:58 [Bug c++/42219] New: [4.5 Regression] ICE with "const void" as parameter type reichelt at gcc dot gnu dot org
` (5 preceding siblings ...)
2009-12-11 21:04 ` jason at gcc dot gnu dot org
@ 2009-12-14 8:46 ` reichelt at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-12-14 8:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from reichelt at gcc dot gnu dot org 2009-12-14 08:46 -------
Fixed.
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42219
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-12-14 8:46 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-29 15:58 [Bug c++/42219] New: [4.5 Regression] ICE with "const void" as parameter type reichelt at gcc dot gnu dot org
2009-11-29 15:58 ` [Bug c++/42219] " reichelt at gcc dot gnu dot org
2009-11-29 16:04 ` rguenth at gcc dot gnu dot org
2009-11-30 3:39 ` hjl dot tools at gmail dot com
2009-11-30 10:02 ` rguenth at gcc dot gnu dot org
2009-12-11 16:31 ` jason at gcc dot gnu dot org
2009-12-11 21:04 ` jason at gcc dot gnu dot org
2009-12-14 8:46 ` reichelt at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).