[Bug c++/43787] [4.5/4.6 Regression] memory copy of empty class (sizeof is one)

2010-05-12 Thread jason at gcc dot gnu dot org
--- Comment #16 from jason at gcc dot gnu dot org 2010-05-13 05:23 --- Subject: Bug 43787 Author: jason Date: Thu May 13 05:23:14 2010 New Revision: 159352 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=159352 Log: PR c++/43787 gcc: * gimplify.c (gimplify_expr):

[Bug c++/43787] [4.5/4.6 Regression] memory copy of empty class (sizeof is one)

2010-05-12 Thread jason at gcc dot gnu dot org
--- Comment #17 from jason at gcc dot gnu dot org 2010-05-13 05:25 --- Fixed for 4.5.1. -- jason at gcc dot gnu dot org changed: What|Removed |Added

[Bug c++/43787] [4.5/4.6 Regression] memory copy of empty class (sizeof is one)

2010-05-05 Thread jason at gcc dot gnu dot org
--- Comment #15 from jason at gcc dot gnu dot org 2010-05-05 16:32 --- Subject: Bug 43787 Author: jason Date: Wed May 5 16:32:20 2010 New Revision: 159072 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=159072 Log: PR c++/43787 gcc: * gimplify.c (gimplify_expr):

[Bug c++/43787] [4.5/4.6 Regression] memory copy of empty class (sizeof is one)

2010-04-30 Thread jason at gcc dot gnu dot org
-- 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

[Bug c++/43787] [4.5/4.6 Regression] memory copy of empty class (sizeof is one)

2010-04-30 Thread jason at gcc dot gnu dot org
--- Comment #14 from jason at gcc dot gnu dot org 2010-05-01 00:58 --- Looks like my patch for 43075 didn't fix things completely. -- jason at gcc dot gnu dot org changed: What|Removed |Added

[Bug c++/43787] [4.5/4.6 Regression] memory copy of empty class (sizeof is one)

2010-04-19 Thread redi at gcc dot gnu dot org
--- Comment #8 from redi at gcc dot gnu dot org 2010-04-19 09:54 --- (In reply to comment #3) At the very least, you'd agree that it's a performance bug to be copying bytes from memory when the class is empty. At the severe use-case, it breaks existing code. As far as I can see,

[Bug c++/43787] [4.5/4.6 Regression] memory copy of empty class (sizeof is one)

2010-04-19 Thread bangerth at gmail dot com
--- Comment #9 from bangerth at gmail dot com 2010-04-19 22:18 --- Dereferencing the null pointer invokes undefined behavior, independent on whether the type of the dereferenced pointer is an empty class or not. Typically, dereferencing NULL results in a trap. GCC simply preserves this

[Bug c++/43787] [4.5/4.6 Regression] memory copy of empty class (sizeof is one)

2010-04-19 Thread navin dot kumar at gmail dot com
--- Comment #10 from navin dot kumar at gmail dot com 2010-04-19 23:44 --- Wolfgang, The opening post was a bad example, and it unfortunately is drawing attention. I agree, it is invalid code for deferencing a NULL pointer. However, please see my other posts, detailing how the

[Bug c++/43787] [4.5/4.6 Regression] memory copy of empty class (sizeof is one)

2010-04-19 Thread navin dot kumar at gmail dot com
--- Comment #11 from navin dot kumar at gmail dot com 2010-04-20 00:11 --- It seems okay - at -O3 gcc 4.5.0 is correctly avoiding the memory copy. This used to happen at the default optimization for gcc 4.4.2, but that's fine. I'm closing the bug. -- navin dot kumar at gmail dot

[Bug c++/43787] [4.5/4.6 Regression] memory copy of empty class (sizeof is one)

2010-04-19 Thread navin dot kumar at gmail dot com
--- Comment #12 from navin dot kumar at gmail dot com 2010-04-20 00:51 --- (In reply to comment #11) It seems okay - at -O3 gcc 4.5.0 is correctly avoiding the memory copy. This used to happen at the default optimization for gcc 4.4.2, but that's fine. I'm closing the bug.

[Bug c++/43787] [4.5/4.6 Regression] memory copy of empty class (sizeof is one)

2010-04-19 Thread navin dot kumar at gmail dot com
--- Comment #13 from navin dot kumar at gmail dot com 2010-04-20 01:13 --- Example: //test.cc class empty_t { }; empty_t foo2(empty_t* x) throw() { return *x; } When I do a diff between the assembly generated for test.cc by 4.4.3 and 4.5.0 I get the following: gcc443: xorl

[Bug c++/43787] [4.5/4.6 Regression] memory copy of empty class (sizeof is one)

2010-04-18 Thread pinskia at gcc dot gnu dot org
--- Comment #7 from pinskia at gcc dot gnu dot org 2010-04-19 00:30 --- Well at least change the summary to say what the issue is about. There is always a copy constructor for classes including POD in C++. -- pinskia at gcc dot gnu dot org changed: What|Removed