[Bug other/52944] [4.5/4.6 Regression] __builtin_object_size(..., 1) no longer returns (size_t)-1 for consecutive flexible/zero-length array members
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Apr 13 09:31:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52944
--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-13 09:30:48 UTC ---
(In reply to comment #4)
> (In reply to comment #3)
>
> wouldn't it though ? there's still a top level union there surrounding all the
> members. so flattening it, i'd get three choices:
> - th_block; th_data
> - th_code; th_data
> - th_stuff
>
> the problem before was that it was a union followed by th_data
>
> testing locally with gcc-4.6.2, i get the object sizes of:
> - -O0: th_data:-1 th_stuff:-1
> - -O[s123]: th_data:96 th_stuff:98
Ah, yeah. That might work reliably indeed. Though I find my solutions
nicer and more explicit ;)
More information about the Gcc-bugs
mailing list