[Bug tree-optimization/86914] New: gcc 8.1 -O2 generates wrong code with strlen() of pointers within one-element arrays of structures

2018-08-10 Thread even.rouault at spatialys dot com
: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: even.rouault at spatialys dot com Target Milestone: --- The following code {{{ #include struct s { int i; char c[1

[Bug tree-optimization/86914] gcc 8.1 -O2 generates wrong code with strlen() of pointers within one-element arrays of structures

2018-08-11 Thread even.rouault at spatialys dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914 --- Comment #1 from Even Rouault --- Interstingly with gcc 8.2, char c[0] doesn't generate the appropriate code. The only way of making it work is to use char c[] syntax