* [Bug c++/22238] [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
2005-06-29 23:21 [Bug c++/22238] New: [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr reichelt at gcc dot gnu dot org
@ 2005-06-30 2:00 ` pinskia at gcc dot gnu dot org
2005-06-30 2:26 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-30 2:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-30 02:00 -------
Confirmed, caused by the patch which introduced obj_type_ref. This also means we can produce better
diagnostic.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |rth at gcc dot gnu dot org
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-06-30 02:00:07
date| |
Target Milestone|--- |4.0.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22238
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/22238] [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
2005-06-29 23:21 [Bug c++/22238] New: [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr reichelt at gcc dot gnu dot org
2005-06-30 2:00 ` [Bug c++/22238] " pinskia at gcc dot gnu dot org
@ 2005-06-30 2:26 ` pinskia at gcc dot gnu dot org
2005-06-30 3:19 ` gdr at integrable-solutions dot net
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-30 2:26 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.1 |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22238
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/22238] [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
2005-06-29 23:21 [Bug c++/22238] New: [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr reichelt at gcc dot gnu dot org
2005-06-30 2:00 ` [Bug c++/22238] " pinskia at gcc dot gnu dot org
2005-06-30 2:26 ` pinskia at gcc dot gnu dot org
@ 2005-06-30 3:19 ` gdr at integrable-solutions dot net
2005-06-30 3:20 ` gdr at integrable-solutions dot net
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-06-30 3:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2005-06-30 03:19 -------
Subject: Re: New: [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
"reichelt at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| Since GCC 4.0.0 the compiler issues a hosed error message for the
| following invalid code snippet:
|
| ======================================
| struct A
| {
| virtual void foo();
| void bar() { if (foo()) ; }
| };
| ======================================
|
| The error message reads:
| bug.cc: In member function 'void A::bar()':
| bug.cc:4: error: could not convert '#'obj_type_ref' not supported by
| dump_expr#<expression error>(this)' to 'bool'
I think I crossed this silly behaviour from the error.c several types,
but it was always in a bigger context. Thanks for reducing it to this
small. I'll fix it.
| With GCC 3.4.4 I get
| bug.cc: In member function `void A::bar()':
| bug.cc:4: error: could not convert `(**((A*)this)->A::_vptr.A)(((A*)this))' to
| `bool'
| which is better, but not optimal.
Agreed.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22238
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/22238] [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
2005-06-29 23:21 [Bug c++/22238] New: [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr reichelt at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-06-30 3:19 ` gdr at integrable-solutions dot net
@ 2005-06-30 3:20 ` gdr at integrable-solutions dot net
2005-06-30 3:25 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-06-30 3:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2005-06-30 03:19 -------
Subject: Re: [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-30 02:00 -------
| Confirmed, caused by the patch which introduced obj_type_ref. This also means we can produce better
| diagnostic.
indeed. Assign it to me.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22238
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/22238] [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
2005-06-29 23:21 [Bug c++/22238] New: [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr reichelt at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-06-30 3:20 ` gdr at integrable-solutions dot net
@ 2005-06-30 3:25 ` pinskia at gcc dot gnu dot org
2005-07-03 14:11 ` gdr at gcc dot gnu dot org
2005-09-27 16:13 ` mmitchel at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-30 3:25 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |gdr at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22238
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/22238] [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
2005-06-29 23:21 [Bug c++/22238] New: [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr reichelt at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-06-30 3:25 ` pinskia at gcc dot gnu dot org
@ 2005-07-03 14:11 ` gdr at gcc dot gnu dot org
2005-09-27 16:13 ` mmitchel at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: gdr at gcc dot gnu dot org @ 2005-07-03 14:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at gcc dot gnu dot org 2005-07-03 14:10 -------
(In reply to comment #3)
> Subject: Re: [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
>
> "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
>
> | ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-30
02:00 -------
> | Confirmed, caused by the patch which introduced obj_type_ref. This also
means we can produce better
> | diagnostic.
>
> indeed. Assign it to me.
>
> -- Gaby
>
It's simple to move back to the awfull printing -- just add a case
for OBJ_TYPE_REF.
However, it is hard to fix this completely without, either
(a) having the front-end stop generating low-level three nodes;
(b) and/or moving to diagnostic with caret.
Adding the following to dump_expr():<case CALL_EXPR>
if (TREE_CODE (fn) == OBJ_TYPE_REF)
{
tree obj_type = TREE_TYPE (OBJ_TYPE_REF_OBJECT (fn));
int idx = tree_low_cst (OBJ_TYPE_REF_TOKEN (fn), 1);
fn = BINFO_VIRTUALS (TYPE_BINFO (TREE_TYPE (obj_type)));
while (idx--)
fn = TREE_CHAIN (fn);
fn = BV_FN (fn);
}
yields
22238.C: In member function 'void A::bar()':
22238.C:4: error: could not convert 'A::foo()' to 'bool'
(while an improvement, it is still suboptimal). Now, if you slightly
change the testcase to
struct A
{
virtual void foo();
};
struct B : virtual A {
void bar() { if (foo()) ; }
};
then you would get the awful
3.C: In member function 'void B::bar()':
3.C:7: error: could not convert '(((A*)this) +
(*(int*)(((B*)this)->B::<anonymous>.A::_vptr.A + -0x000000010)))->A::foo()' to
'bool'
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22238
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/22238] [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
2005-06-29 23:21 [Bug c++/22238] New: [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr reichelt at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-07-03 14:11 ` gdr at gcc dot gnu dot org
@ 2005-09-27 16:13 ` mmitchel at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:13 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.2 |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22238
^ permalink raw reply [flat|nested] 8+ messages in thread