This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/64417] New: [SH] FAIL: gcc.c-torture/compile/pr28865.c -O0 (test for excess errors)
- From: "olegendo at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 27 Dec 2014 11:24:02 +0000
- Subject: [Bug target/64417] New: [SH] FAIL: gcc.c-torture/compile/pr28865.c -O0 (test for excess errors)
- Auto-submitted: auto-generated
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.