This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/64417] New: [SH] FAIL: gcc.c-torture/compile/pr28865.c -O0 (test for excess errors)


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64417

            Bug ID: 64417
           Summary: [SH] FAIL: gcc.c-torture/compile/pr28865.c   -O0
                    (test for excess errors)
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: olegendo at gcc dot gnu.org

On SH, the test case 

struct var_len
{
  int field1;
  const char field2[];
};

static const struct var_len var_array[] = 
{
  { 1, "Long exposure noise reduction" },
  { 2, "Shutter/AE lock buttons" },
  { 3, "Mirror lockup" }
};

without optimization compiles to:
    .little
    .section    .rodata
    .align 2
    .type    _var_array, @object
    .size    _var_array, 12
_var_array:
    .long    1
    .string    "Long exposure noise reduction"
    .long    2
    .string    "Shutter/AE lock buttons"
    .long    3
    .string    "Mirror lockup"
    .ident    "GCC: (GNU) 5.0.0 20141226 (experimental)"

The structs in the array are misaligned.  Either the struct size has to be
aligned to 4 bytes (adding '\0' chars to the strings or inserting .align 2) or
the 32 bit values have to be output as byte arrays.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]