Closed SteveFosdick closed 3 years ago
And, if I temporarily remove -Werror, there are some more, similar, warnings:
In function ‘jit_opcode_make_uop1’,
inlined from ‘jit_opcode_find_replace2.constprop’ at jit_opcode.c:34:3:
jit_opcode.c:41:10: warning: ‘memset’ writing 12 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
41 | (void) memset(p_uop, '\0', sizeof(struct jit_uop));
| ^
In function ‘jit_opcode_make_uop1’,
inlined from ‘jit_opcode_find_replace1’ at jit_opcode.c:16:3,
inlined from ‘jit_compiler_try_make_dynamic_opcode’ at jit_compiler.c:1652:7,
inlined from ‘jit_compiler_check_dynamics’ at jit_compiler.c:2003:7,
inlined from ‘jit_compiler_compile_block’ at jit_compiler.c:2386:3,
inlined from ‘jit_compile’ at jit.c:566:25:
jit_opcode.c:41:10: warning: ‘memset’ writing 12 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
41 | (void) memset(p_uop, '\0', sizeof(struct jit_uop));
| ^
In function ‘jit_opcode_make_uop1’,
inlined from ‘jit_compiler_try_make_dynamic_opcode’ at jit_compiler.c:1782:5,
inlined from ‘jit_compiler_check_dynamics’ at jit_compiler.c:2003:7,
inlined from ‘jit_compiler_compile_block’ at jit_compiler.c:2386:3,
inlined from ‘jit_compile’ at jit.c:566:25:
jit_opcode.c:41:10: warning: ‘memset’ writing 12 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
41 | (void) memset(p_uop, '\0', sizeof(struct jit_uop));
| ^
In function ‘jit_opcode_make_uop1’,
inlined from ‘jit_opcode_find_replace1’ at jit_opcode.c:16:3,
inlined from ‘jit_optimizer_optimize’ at jit_optimizer.c:1054:7,
inlined from ‘jit_compiler_compile_block’ at jit_compiler.c:2407:17,
inlined from ‘jit_compile’ at jit.c:566:25:
jit_opcode.c:41:10: warning: ‘memset’ writing 12 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
41 | (void) memset(p_uop, '\0', sizeof(struct jit_uop));
| ^
Thanks! Looks like gcc 11.1 is doing some fancy propagation of statically determinable pointer properties. I like it!
I'll find something with gcc 11.1 and address these.
When compiling beebjit, using build_opt.sh, compilation stops with the following from gcc:
This is on commit 0e576642e05ee3d4361faeb69327d29de00068c2