Date: Tue, 24 Apr 2018 08:45:19 +0000 From: bugzilla-noreply@freebsd.org To: toolchain@FreeBSD.org Subject: [Bug 227723] clang 6.0 breaks php56/opcache Message-ID: <bug-227723-29464-uPMGOoDKgt@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-227723-29464@https.bugs.freebsd.org/bugzilla/> References: <bug-227723-29464@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227723 --- Comment #4 from lampa@fit.vutbr.cz --- test case was for constant, which was optimized to immediate, here is anoth= er 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 =3D -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. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-227723-29464-uPMGOoDKgt>