--- Comment #1 from rguenth at gcc dot gnu dot org 2010-04-18 18:13 ---
I'm not sure the testcase is valid. We copy a single byte at 0.
--
rguenth at gcc dot gnu dot org changed:
What|Removed |Added
--- Comment #2 from navin dot kumar at gmail dot com 2010-04-18 18:31
---
Only GCC4.5.0 is emitting a copy-constructor that copies 1 byte of data
(probably because sizeof(empty_t) == 1 according to the C++ ABI). The
copy-constructor *should* be a noop, and indeed GCC4.4.2 issues a
--- Comment #3 from navin dot kumar at gmail dot com 2010-04-18 18:33
---
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.
--
--- Comment #4 from pinskia at gcc dot gnu dot org 2010-04-18 22:29 ---
This is invalid because you access a null pointer
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
--- Comment #5 from navin dot kumar at gmail dot com 2010-04-19 00:22
---
Andrew,
What about the performance bug?
empty_t x; // line1
empty_t y = x; // line2
Line2 should not result in copying memory for empty classes. And that was the
old behavior pre-4.5.0
--
--- Comment #6 from navin dot kumar at gmail dot com 2010-04-19 00:22
---
Andrew,
What about the performance bug?
empty_t x; // line1
empty_t y = x; // line2
Line2 should not result in copying memory for empty classes. And that was the
old behavior pre-4.5.0
--
navin dot kumar