public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19817] New: C++ front-end produces a cast instead of just &a.b (when call the deconstructor)
@ 2005-02-08 15:09 pinskia at gcc dot gnu dot org
2005-02-20 19:34 ` [Bug c++/19817] " pinskia at gcc dot gnu dot org
2005-03-10 18:17 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-08 15:09 UTC (permalink / raw)
To: gcc-bugs
The following code should be optimizated out on the tree level but is not because we have a cast
involved when calling the deconstuctor.
int t;
struct base { int i; ~base(){t = i;}};
struct vector : public base { vector(){ i = 2; }};
int f() { vector v; return t;}
extern "C" void abort ();
int main(void)
{
t = 2;
if (f() != 2)
link_error ();
if (t!= 2)
link_error ();
return 0;
}
This might be the case for PR 19786 but I don't know for sure.
--
Summary: C++ front-end produces a cast instead of just &a.b (when
call the deconstructor)
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: missed-optimization, TREE
Severity: enhancement
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19817
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/19817] C++ front-end produces a cast instead of just &a.b (when call the deconstructor)
2005-02-08 15:09 [Bug c++/19817] New: C++ front-end produces a cast instead of just &a.b (when call the deconstructor) pinskia at gcc dot gnu dot org
@ 2005-02-20 19:34 ` pinskia at gcc dot gnu dot org
2005-03-10 18:17 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-20 19:34 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-20 14:18 -------
Confirmed, This seems stupid the front-end is doing this as casts get in the way of optimizations now.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-02-20 14:18:33
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19817
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/19817] C++ front-end produces a cast instead of just &a.b (when call the deconstructor)
2005-02-08 15:09 [Bug c++/19817] New: C++ front-end produces a cast instead of just &a.b (when call the deconstructor) pinskia at gcc dot gnu dot org
2005-02-20 19:34 ` [Bug c++/19817] " pinskia at gcc dot gnu dot org
@ 2005-03-10 18:17 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-10 18:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-10 18:17 -------
The bug is in convert_to_base_statically.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19817
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/19817] C++ front-end produces a cast instead of just &a.b (when call the deconstructor)
[not found] <bug-19817-6528@http.gcc.gnu.org/bugzilla/>
@ 2007-04-15 0:05 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-04-15 0:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2007-04-15 01:05 -------
Note this was fixed at the tree level by:
2007-04-08 Jan Hubicka <jh@suse.cz>
* tree.h (maybe_fold_offset_to_component_ref): Declare.
* tree-ssa-ccp.c (maybe_fold_offset_to_component_ref): Export.
* fold-const.c (fold_unary): Use it.
But The C++ front-end should not produce this to begin with.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|TREE |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19817
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-04-15 0:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-08 15:09 [Bug c++/19817] New: C++ front-end produces a cast instead of just &a.b (when call the deconstructor) pinskia at gcc dot gnu dot org
2005-02-20 19:34 ` [Bug c++/19817] " pinskia at gcc dot gnu dot org
2005-03-10 18:17 ` pinskia at gcc dot gnu dot org
[not found] <bug-19817-6528@http.gcc.gnu.org/bugzilla/>
2007-04-15 0:05 ` pinskia 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).