Re: [patch c/c++]: Fix for PR c/52991 issue about ignored packed-attribute for ms-structure-layout

2012-12-15 Thread Eric Botcazou
I think this hunk still just shows that the ms-bitfield-code fails to handle TYPE_PACKED properly. Simply adjusting rli-record_align does not look like the correct solution to me. Btw, did you test struct-layout against 4.7 with ms-bitfields as Jakub noted how to do that? Ideally this

Re: [patch c/c++]: Fix for PR c/52991 issue about ignored packed-attribute for ms-structure-layout

2012-12-13 Thread Richard Biener
On Wed, Dec 12, 2012 at 5:23 PM, Kai Tietz ktiet...@googlemail.com wrote: 2012/12/12 Richard Biener richard.guent...@gmail.com: On Wed, Dec 12, 2012 at 4:11 PM, Richard Henderson r...@redhat.com wrote: On 12/12/2012 02:57 AM, Richard Biener wrote: That looks wrong. Having both TYPE_PACKED and

Re: [patch c/c++]: Fix for PR c/52991 issue about ignored packed-attribute for ms-structure-layout

2012-12-13 Thread Jakub Jelinek
On Thu, Dec 13, 2012 at 11:03:58AM +0100, Richard Biener wrote: struct X { char c; short s; char c2; short s2; } __attribute__((packed,aligned(2))); As struct-layout-1.exp tests show, this is something that was ABI-wise changed already several times. That said, for

Re: [patch c/c++]: Fix for PR c/52991 issue about ignored packed-attribute for ms-structure-layout

2012-12-13 Thread Richard Biener
On Thu, Dec 13, 2012 at 11:07 AM, Jakub Jelinek ja...@redhat.com wrote: On Thu, Dec 13, 2012 at 11:03:58AM +0100, Richard Biener wrote: struct X { char c; short s; char c2; short s2; } __attribute__((packed,aligned(2))); As struct-layout-1.exp tests show, this is something that

Re: [patch c/c++]: Fix for PR c/52991 issue about ignored packed-attribute for ms-structure-layout

2012-12-13 Thread Jakub Jelinek
On Thu, Dec 13, 2012 at 11:29:47AM +0100, Richard Biener wrote: On Thu, Dec 13, 2012 at 11:07 AM, Jakub Jelinek ja...@redhat.com wrote: On Thu, Dec 13, 2012 at 11:03:58AM +0100, Richard Biener wrote: struct X { char c; short s; char c2; short s2; }

Re: [patch c/c++]: Fix for PR c/52991 issue about ignored packed-attribute for ms-structure-layout

2012-12-13 Thread Kai Tietz
2012/12/13 Jakub Jelinek ja...@redhat.com: On Thu, Dec 13, 2012 at 11:29:47AM +0100, Richard Biener wrote: On Thu, Dec 13, 2012 at 11:07 AM, Jakub Jelinek ja...@redhat.com wrote: On Thu, Dec 13, 2012 at 11:03:58AM +0100, Richard Biener wrote: struct X { char c; short s; char

Re: [patch c/c++]: Fix for PR c/52991 issue about ignored packed-attribute for ms-structure-layout

2012-12-13 Thread Richard Biener
On Thu, Dec 13, 2012 at 1:02 PM, Kai Tietz ktiet...@googlemail.com wrote: 2012/12/13 Jakub Jelinek ja...@redhat.com: On Thu, Dec 13, 2012 at 11:29:47AM +0100, Richard Biener wrote: On Thu, Dec 13, 2012 at 11:07 AM, Jakub Jelinek ja...@redhat.com wrote: On Thu, Dec 13, 2012 at 11:03:58AM

Re: [patch c/c++]: Fix for PR c/52991 issue about ignored packed-attribute for ms-structure-layout

2012-12-12 Thread Richard Biener
On Tue, Dec 11, 2012 at 11:04 PM, Kai Tietz ktiet...@googlemail.com wrote: Hello, This fixes an old regression about ms-structure-layout in combination with packed-attribute. ChangeLog 2012-12-11 Kai Tietz PR c/52991 * stor-layout.c (start_record_layout): Handle

Re: [patch c/c++]: Fix for PR c/52991 issue about ignored packed-attribute for ms-structure-layout

2012-12-12 Thread Richard Henderson
On 12/12/2012 02:57 AM, Richard Biener wrote: That looks wrong. Having both TYPE_PACKED and TYPE_ALIGN != BITS_PER_UNIT is inconsistent, so this part of the patch should not be necessary. No, that is the only way to give a 4 byte int 2 byte alignment: use both packed and aligned attributes.

Re: [patch c/c++]: Fix for PR c/52991 issue about ignored packed-attribute for ms-structure-layout

2012-12-12 Thread Richard Biener
On Wed, Dec 12, 2012 at 4:11 PM, Richard Henderson r...@redhat.com wrote: On 12/12/2012 02:57 AM, Richard Biener wrote: That looks wrong. Having both TYPE_PACKED and TYPE_ALIGN != BITS_PER_UNIT is inconsistent, so this part of the patch should not be necessary. No, that is the only way to

Re: [patch c/c++]: Fix for PR c/52991 issue about ignored packed-attribute for ms-structure-layout

2012-12-12 Thread Kai Tietz
2012/12/12 Richard Biener richard.guent...@gmail.com: On Wed, Dec 12, 2012 at 4:11 PM, Richard Henderson r...@redhat.com wrote: On 12/12/2012 02:57 AM, Richard Biener wrote: That looks wrong. Having both TYPE_PACKED and TYPE_ALIGN != BITS_PER_UNIT is inconsistent, so this part of the patch

Re: [patch c/c++]: Fix for PR c/52991 issue about ignored packed-attribute for ms-structure-layout

2012-12-12 Thread Kai Tietz
Hi, I added two testcases to this patch. So that we might detect regressions about this issue later more easily. 2012-12-12 Kai Tietz PR c/52991 * stor-layout.c (start_record_layout): Handle packed-attribute for ms-structure-layout.

[patch c/c++]: Fix for PR c/52991 issue about ignored packed-attribute for ms-structure-layout

2012-12-11 Thread Kai Tietz
Hello, This fixes an old regression about ms-structure-layout in combination with packed-attribute. ChangeLog 2012-12-11 Kai Tietz PR c/52991 * stor-layout.c (start_record_layout): Handle packed-attribute for ms-structure-layout. (update_alignment_for_field):