public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/22238] New: [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
@ 2005-06-29 23:21 reichelt at gcc dot gnu dot org
  2005-06-30  2:00 ` [Bug c++/22238] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-06-29 23:21 UTC (permalink / raw)
  To: gcc-bugs

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'

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.

-- 
           Summary: [4.0/4.1 regression] '#'obj_type_ref' not supported by
                    dump_expr
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: diagnostic, monitored
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22238


^ permalink raw reply	[flat|nested] 11+ 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 ` 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; 11+ 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] 11+ 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; 11+ 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] 11+ 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; 11+ 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] 11+ 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; 11+ 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] 11+ 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; 11+ 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] 11+ 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; 11+ 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] 11+ 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; 11+ 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] 11+ messages in thread

* [Bug c++/22238] [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
       [not found] <bug-22238-1771@http.gcc.gnu.org/bugzilla/>
  2005-10-13 19:55 ` pinskia at gcc dot gnu dot org
  2005-10-31  3:55 ` mmitchel at gcc dot gnu dot org
@ 2005-11-16 19:05 ` gdr at integrable-solutions dot net
  2 siblings, 0 replies; 11+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-11-16 19:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from gdr at integrable-solutions dot net  2005-11-16 19:05 -------
Subject: Re:  [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr

"mmitchel at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| Gaby, please apply the simple OBJ_TYPE_REF patch so that we can remove the
| regression markers from this PR.

OK.

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22238


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/22238] [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
       [not found] <bug-22238-1771@http.gcc.gnu.org/bugzilla/>
  2005-10-13 19:55 ` pinskia at gcc dot gnu dot org
@ 2005-10-31  3:55 ` mmitchel at gcc dot gnu dot org
  2005-11-16 19:05 ` gdr at integrable-solutions dot net
  2 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-10-31  3:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from mmitchel at gcc dot gnu dot org  2005-10-31 03:55 -------
Gaby, please apply the simple OBJ_TYPE_REF patch so that we can remove the
regression markers from this PR.

(I agree that a complete solution is difficult; my opinion continues to be that
we should use carets, rather than trying to print out expressions.)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22238


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/22238] [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr
       [not found] <bug-22238-1771@http.gcc.gnu.org/bugzilla/>
@ 2005-10-13 19:55 ` pinskia at gcc dot gnu dot org
  2005-10-31  3:55 ` mmitchel at gcc dot gnu dot org
  2005-11-16 19:05 ` gdr at integrable-solutions dot net
  2 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-13 19:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2005-10-13 19:55 -------
Any news on getting this partial patch committed, as this will at least bring
us back to pre 4.0 times.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22238


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-11-16 19:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
     [not found] <bug-22238-1771@http.gcc.gnu.org/bugzilla/>
2005-10-13 19:55 ` pinskia at gcc dot gnu dot org
2005-10-31  3:55 ` mmitchel at gcc dot gnu dot org
2005-11-16 19:05 ` gdr at integrable-solutions dot net

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