[Bug middle-end/106818] code is genereated differently with or without 'extern'

2022-09-02 Thread pangbw at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106818 --- Comment #5 from baoshan --- Per Andrew's request: For GCC built for RISC-V, With the following code: struct sss_t { int i; int j; } sss; extern char array[sizeof(struct sss_t )]; void foo() { struct sss_t *p = (struct sss_t

[Bug middle-end/106818] code is genereated differently with or without 'extern'

2022-09-02 Thread pangbw at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106818 --- Comment #6 from baoshan --- > really of unknown alignment then sharing the lui might not work. Can you elaborate why shareing the lui might not work?

[Bug c/106818] New: code is genereated differently with or without 'extern'

2022-09-02 Thread pangbw at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106818 Bug ID: 106818 Summary: code is genereated differently with or without 'extern' Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal

[Bug c/106818] code is genereated differently with or without 'extern'

2022-09-02 Thread pangbw at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106818 --- Comment #1 from baoshan --- With 'extern', four 'sb' are ued to store value into "p->i"; while without 'extern', only one 'sw' is used.