[Bug 227723] clang 6.0 breaks php56/opcache
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Tue Apr 24 08:45:22 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227723
--- Comment #4 from lampa at fit.vutbr.cz ---
test case was for constant, which was optimized to immediate, here is another
with variable:
#include <stdio.h>
#include <stdlib.h>
#define EX_TMP_VAR(ex, n) ((temp_variable*)(((char*)(ex)) +
((int)(n))))
#define EX_TMP_VAR_NUM(ex, n) (EX_TMP_VAR(ex, 0) - (1 + (n)))
#define VAR_NUM(v) ((unsigned int)(EX_TMP_VAR_NUM(0, 0) - EX_TMP_VAR(0, v)))
typedef struct TV {
long tmp;
char tmp3[30];
} temp_variable;
int num = -1000;
int main()
{
printf("%x\n", VAR_NUM(num));
return 0;
}
clang50 result is 18
clang60 result is 60000018
The only difference in generated code (clang50 first, clang60 second):
< movslq num(%rip), %rax
---
> movl num(%rip), %eax
movq $-40, %rcx
subq %rax, %rcx
shrq $3, %rcx
It looks like num is not sign extended before pointer arithmetic.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-toolchain
mailing list