[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-16 Thread nickc at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 Nick Clifton changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-16 Thread nickc at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #26 from Nick Clifton --- Author: nickc Date: Thu Jan 16 12:17:48 2014 New Revision: 206661 URL: http://gcc.gnu.org/viewcvs?rev=206661&root=gcc&view=rev Log: PR middle-end/28865 * varasm.c (output_constant): Return the number of

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-14 Thread joseph at codesourcery dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #25 from joseph at codesourcery dot com --- On Mon, 13 Jan 2014, jakub at gcc dot gnu.org wrote: > But the glibc headers case you're mentioning wasn't initializing the flexible > array members, right? (Or even initialization with {}

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-14 Thread amodra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #24 from Alan Modra --- Nick's latest patch passes bootstrap and regression testing powerpc64-linux.

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-13 Thread nickc at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 Nick Clifton changed: What|Removed |Added Attachment #31802|0 |1 is obsolete|

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-13 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #22 from Jakub Jelinek --- But the glibc headers case you're mentioning wasn't initializing the flexible array members, right? (Or even initialization with {} initializer is fine I guess). I mean, while C doesn't allow it, if you don

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-13 Thread joseph at codesourcery dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #21 from joseph at codesourcery dot com --- The reason for laxity about flexible array member constraints is existing code violating them, as in the glibc header code quoted in

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-13 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 Jakub Jelinek changed: What|Removed |Added CC||jsm28 at gcc dot gnu.org --- Comment #20

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-13 Thread amodra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #19 from Alan Modra --- Jakub, you're correct. I should have read the standard on flexible array members before poking at this bug last year. Nick's patch is looking good to me. ISO/IEC 9899:1999 is quite clear that the answer to co

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-11 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #18 from Jakub Jelinek --- I disagree. DECL_SIZE and .size are IMHO correct here at this point, and component sizes (FIELD_DECL) can't match, because we shouldn't be changing the type of the decl to some other type just because it got

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-10 Thread amodra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #17 from Alan Modra --- I believe Eric's comment http://gcc.gnu.org/ml/gcc-patches/2013-05/msg00179.html points at the correct fix, but it's a bit messy. You need to recursively descend both "decl" and "init" in code like c-decl.c:fin

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-10 Thread amodra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #16 from Alan Modra --- Hi Nick, that patch looks exactly like my first attempt to fix this bug. I forget the details now but I'm fairly certain it wasn't a complete fix, which is why I didn't submit my patch.. Note that the underlyi

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-10 Thread nickc at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #15 from Nick Clifton --- Created attachment 31802 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31802&action=edit Fix gcc's emission of assembler directives for a variable length structure Hi Guys, I think that the problem i

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-09 Thread bergner at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 Peter Bergner changed: What|Removed |Added CC||bergner at gcc dot gnu.org --- Comment #1

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-09 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #13 from Jakub Jelinek --- Runtime testcase that presumably fails on -fsection-anchors targets: struct A { int a; char b[]; }; union B { struct A a; char b[sizeof (struct A) + 31]; }; union B b = { { 1, "123456789012345678901234567890"

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-09 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #12

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2014-01-09 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 Jakub Jelinek changed: What|Removed |Added CC||nickc at gcc dot gnu.org --- Comment #11

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2013-05-04 Thread amodra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #10 from Alan Modra 2013-05-04 14:39:34 UTC --- Incidentall, I expect the patch referred to in comment #6 will ICE with tree-checking on due to CONSTRUCTOR nodes not having the required fields for DECL_SIZE_UNIT.

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2013-05-04 Thread amodra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #9 from Alan Modra 2013-05-04 14:34:39 UTC --- >From what I see on current mainline for a testcase based on glibc/nss/nss_files/files-init.c the var_decl size and the type size agree and are correct. What causes a problem with

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2013-04-20 Thread sch...@linux-m68k.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 Andreas Schwab changed: What|Removed |Added Keywords||wrong-code Target Milestone|-

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2013-04-09 Thread fredrickprashanth at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #7 from Fredrick 2013-04-09 18:10:34 UTC --- HJ, Thanks for pointing the patch. The patch works. I tested it on x86-64. Could this patch be integrated into the mainline GCC? Thanks, Fredrick

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2013-04-08 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 H.J. Lu changed: What|Removed |Added Known to fail|| --- Comment #6 from H.J. Lu 2013-04

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2013-04-08 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 Andrew Pinski changed: What|Removed |Added CC||algrant at acm dot org --- Comm

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2013-04-08 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 Andrew Pinski changed: What|Removed |Added CC||fredrickprashanth at gmail

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2007-12-03 Thread lauro dot venancio at gmail dot com
--- Comment #3 from lauro dot venancio at gmail dot com 2007-12-03 23:42 --- I think I'm facing a related problem. GCC is emitting unaligned array elements. struct ccstm { int32_t val; const char descr[]; }; static const struct ccstm canon_d30custom[] = { { 1, "Long

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2006-08-27 Thread pinskia at gcc dot gnu dot org
--- Comment #2 from pinskia at gcc dot gnu dot org 2006-08-28 03:08 --- Confirmed, not a regression. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added

[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size

2006-08-27 Thread qrczak at knm dot org dot pl
--- Comment #1 from qrczak at knm dot org dot pl 2006-08-27 22:15 --- A question: when this is fixed, what should be C-level sizeof obj? I hope it would include the flexible array component. This would allow to detect in autoconf whether this bug is fixed, and would be consistent with t