* [Bug libstdc++/67503] String cannot be loaded from binary representation
2015-09-08 16:28 [Bug libstdc++/67503] New: String cannot be loaded from binary representation radventure at yandex dot ru
@ 2015-09-08 16:32 ` redi at gcc dot gnu.org
2015-09-08 16:40 ` pinskia at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2015-09-08 16:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67503
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
That's not valid, you can't do that with non-trivial types.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/67503] String cannot be loaded from binary representation
2015-09-08 16:28 [Bug libstdc++/67503] New: String cannot be loaded from binary representation radventure at yandex dot ru
2015-09-08 16:32 ` [Bug libstdc++/67503] " redi at gcc dot gnu.org
@ 2015-09-08 16:40 ` pinskia at gcc dot gnu.org
2015-09-08 16:54 ` radventure at yandex dot ru
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-09-08 16:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67503
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Also there is an alignment issue with your example too.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/67503] String cannot be loaded from binary representation
2015-09-08 16:28 [Bug libstdc++/67503] New: String cannot be loaded from binary representation radventure at yandex dot ru
2015-09-08 16:32 ` [Bug libstdc++/67503] " redi at gcc dot gnu.org
2015-09-08 16:40 ` pinskia at gcc dot gnu.org
@ 2015-09-08 16:54 ` radventure at yandex dot ru
2015-09-08 16:56 ` radventure at yandex dot ru
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: radventure at yandex dot ru @ 2015-09-08 16:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67503
--- Comment #3 from radventure at yandex dot ru ---
I can solve the alignment but prbolem will not be fixed.
I agree with remark about "non-trivial types" but this code works in previous
gcc versions and works in visual c++ 2015.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/67503] String cannot be loaded from binary representation
2015-09-08 16:28 [Bug libstdc++/67503] New: String cannot be loaded from binary representation radventure at yandex dot ru
` (2 preceding siblings ...)
2015-09-08 16:54 ` radventure at yandex dot ru
@ 2015-09-08 16:56 ` radventure at yandex dot ru
2015-09-08 17:03 ` redi at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: radventure at yandex dot ru @ 2015-09-08 16:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67503
radventure at yandex dot ru changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|INVALID |WONTFIX
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/67503] String cannot be loaded from binary representation
2015-09-08 16:28 [Bug libstdc++/67503] New: String cannot be loaded from binary representation radventure at yandex dot ru
` (3 preceding siblings ...)
2015-09-08 16:56 ` radventure at yandex dot ru
@ 2015-09-08 17:03 ` redi at gcc dot gnu.org
2015-09-08 17:05 ` radventure at yandex dot ru
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2015-09-08 17:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67503
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|WONTFIX |INVALID
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to radventure from comment #3)
> I can solve the alignment but prbolem will not be fixed.
> I agree with remark about "non-trivial types" but this code works in
> previous gcc versions and works in visual c++ 2015.
It was never valid before and it's not valid now. Just because it appeared to
work previously doesn't make it valid.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/67503] String cannot be loaded from binary representation
2015-09-08 16:28 [Bug libstdc++/67503] New: String cannot be loaded from binary representation radventure at yandex dot ru
` (4 preceding siblings ...)
2015-09-08 17:03 ` redi at gcc dot gnu.org
@ 2015-09-08 17:05 ` radventure at yandex dot ru
2015-09-08 17:08 ` radventure at yandex dot ru
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: radventure at yandex dot ru @ 2015-09-08 17:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67503
--- Comment #5 from radventure at yandex dot ru ---
When you use local buffer for storing string value it not necessary to have
pointer to it. And we can reduce the size of string by the syzeof(pointer).
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/67503] String cannot be loaded from binary representation
2015-09-08 16:28 [Bug libstdc++/67503] New: String cannot be loaded from binary representation radventure at yandex dot ru
` (5 preceding siblings ...)
2015-09-08 17:05 ` radventure at yandex dot ru
@ 2015-09-08 17:08 ` radventure at yandex dot ru
2015-09-08 17:09 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: radventure at yandex dot ru @ 2015-09-08 17:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67503
--- Comment #6 from radventure at yandex dot ru ---
(In reply to Jonathan Wakely from comment #4)
> (In reply to radventure from comment #3)
> > I can solve the alignment but prbolem will not be fixed.
> > I agree with remark about "non-trivial types" but this code works in
> > previous gcc versions and works in visual c++ 2015.
>
> It was never valid before and it's not valid now. Just because it appeared
> to work previously doesn't make it valid.
Code validity it's great. But what about backward compatibility?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/67503] String cannot be loaded from binary representation
2015-09-08 16:28 [Bug libstdc++/67503] New: String cannot be loaded from binary representation radventure at yandex dot ru
` (6 preceding siblings ...)
2015-09-08 17:08 ` radventure at yandex dot ru
@ 2015-09-08 17:09 ` pinskia at gcc dot gnu.org
2015-09-08 17:12 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-09-08 17:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67503
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is just like having a struct like:
Struct
{
Char a[4];
Char *b = a;
};
Sorry for char and struct being in the wrong case. Also using a c++11 feature
to show the case easier. This is a valid thing to do and that is exactly what
the new std::string does. This saves space and allows for short strings not
have to an extra allocation.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/67503] String cannot be loaded from binary representation
2015-09-08 16:28 [Bug libstdc++/67503] New: String cannot be loaded from binary representation radventure at yandex dot ru
` (7 preceding siblings ...)
2015-09-08 17:09 ` pinskia at gcc dot gnu.org
@ 2015-09-08 17:12 ` pinskia at gcc dot gnu.org
2015-09-08 17:15 ` radventure at yandex dot ru
2015-09-08 17:25 ` radventure at yandex dot ru
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-09-08 17:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67503
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to radventure from comment #5)
> When you use local buffer for storing string value it not necessary to have
> pointer to it. And we can reduce the size of string by the syzeof(pointer).
Well an union would work here except it would make all other code more messy.
There are a few places need to check that it equals the array before doing
something special.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/67503] String cannot be loaded from binary representation
2015-09-08 16:28 [Bug libstdc++/67503] New: String cannot be loaded from binary representation radventure at yandex dot ru
` (8 preceding siblings ...)
2015-09-08 17:12 ` pinskia at gcc dot gnu.org
@ 2015-09-08 17:15 ` radventure at yandex dot ru
2015-09-08 17:25 ` radventure at yandex dot ru
10 siblings, 0 replies; 12+ messages in thread
From: radventure at yandex dot ru @ 2015-09-08 17:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67503
--- Comment #9 from radventure at yandex dot ru ---
I understand the "small string optimization" idea. I agree about allocation
counting. But I don't see space economy, now sizeof(string) is 28 bytes in
32-bit environment instead of 4 bytes early.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/67503] String cannot be loaded from binary representation
2015-09-08 16:28 [Bug libstdc++/67503] New: String cannot be loaded from binary representation radventure at yandex dot ru
` (9 preceding siblings ...)
2015-09-08 17:15 ` radventure at yandex dot ru
@ 2015-09-08 17:25 ` radventure at yandex dot ru
10 siblings, 0 replies; 12+ messages in thread
From: radventure at yandex dot ru @ 2015-09-08 17:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67503
--- Comment #10 from radventure at yandex dot ru ---
(In reply to radventure from comment #9)
> I understand the "small string optimization" idea. I agree about allocation
> counting. But I don't see space economy, now sizeof(string) is 28 bytes in
> 32-bit environment instead of 4 bytes early.
Now sizeof(string) is 24 bytes.
^ permalink raw reply [flat|nested] 12+ messages in thread