diff options
| author | 2023-06-04 10:16:46 +0200 | |
|---|---|---|
| committer | 2023-06-04 10:20:27 +0200 | |
| commit | bd390afdf4eabfe13c1dd18bde23f4246ad73514 (patch) | |
| tree | 87aae438e37370773d345d6f18598681740cae21 /test.c | |
| parent | 9c6a0b4340fe430e941586134f585c27309a0084 (diff) | |
optimize away unused results when expression is only evaluated for side effects
Diffstat (limited to 'test.c')
| -rw-r--r-- | test.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -56,11 +56,9 @@ struct f2 f2test(struct f2 *r) { return *r; } -void memset(char *p, int c, unsigned long n) +void memset(volatile char *p, int c, unsigned long n) { - if (n) do { - *p++ = c; - } while (--n); + if (n) do *p++ = c; while (--n); } |