php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76429 zend_accelerator_util_funcs.c error: unknown register name ‘%ymm0’ in ‘asm
Submitted: 2018-06-08 01:16 UTC Modified: 2018-06-12 04:08 UTC
Votes:4
Avg. Score:4.2 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: eva2000 at centminmod dot com Assigned: laruence (profile)
Status: Assigned Package: opcache
PHP Version: 7.3.0alpha1 OS: centos 7.5
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-06-08 01:16 UTC] eva2000 at centminmod dot com
Description:
------------
Test source compile of PHP 7.3.0alpha1 results in failure at opcache section but only on Intel Xeon Gold Skylake server with CentOS 7.5 64bit (running in Ubuntu 18.04 LTS with LXD 3.1 based CentOS 7.5 container https://github.com/centminmod/centminmod-lxd). PHP 7.3.0alpha + Zend Opcache successfully compiles on Xeon E3-1270v1 Sandybridge system though. Both Xeon Gold Skylake and Xeon E3-1270v1 systems using CentOS 7.5 GCC 4.8.5

make stage:

/bin/sh /svr-setup/php-7.3.0alpha1/fpm-build/libtool --silent --preserve-dup-deps --mode=compile ccache /usr/bin/gcc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/opcache/ -I/svr-setup/php-7.3.0alpha1/ext/opcache/ -DPHP_ATOM_INC -I/svr-setup/php-7.3.0alpha1/fpm-build/include -I/svr-setup/php-7.3.0alpha1/fpm-build/main -I/svr-setup/php-7.3.0alpha1 -I/svr-setup/php-7.3.0alpha1/fpm-build/ext/date/lib -I/svr-setup/php-7.3.0alpha1/ext/date/lib -I/usr/include/libxml2 -I/usr/include/enchant -I/usr/X11 -I/usr/include/freetype2 -I/usr/include/imap -I/svr-setup/php-7.3.0alpha1/ext/mbstring/oniguruma -I/svr-setup/php-7.3.0alpha1/fpm-build/ext/mbstring/oniguruma -I/svr-setup/php-7.3.0alpha1/ext/mbstring/libmbfl -I/svr-setup/php-7.3.0alpha1/fpm-build/ext/mbstring/libmbfl -I/svr-setup/php-7.3.0alpha1/ext/mbstring/libmbfl/mbfl -I/svr-setup/php-7.3.0alpha1/fpm-build/ext/mbstring/libmbfl/mbfl -I/svr-setup/php-7.3.0alpha1/ext/sqlite3/libsqlite -I/usr/include/pspell -I/usr/local/include -I/svr-setup/php-7.3.0alpha1/fpm-build/TSRM -I/svr-setup/php-7.3.0alpha1/fpm-build/Zend -I/svr-setup/php-7.3.0alpha1/main -I/svr-setup/php-7.3.0alpha1/Zend -I/svr-setup/php-7.3.0alpha1/TSRM -I/svr-setup/php-7.3.0alpha1/fpm-build/    -I/usr/include -O3 -m64 -march=core-avx2 -pipe -gsplit-dwarf -fvisibility=hidden -DZEND_SIGNALS    -c /svr-setup/php-7.3.0alpha1/ext/opcache/zend_accelerator_util_funcs.c -o ext/opcache/zend_accelerator_util_funcs.lo 
/svr-setup/php-7.3.0alpha1/ext/opcache/zend_accelerator_util_funcs.c: In function ‘zend_accel_load_script’:
/svr-setup/php-7.3.0alpha1/ext/opcache/zend_accelerator_util_funcs.c:662:2: error: unknown register name ‘%ymm1’ in ‘asm’
  __asm__ volatile (
  ^
/svr-setup/php-7.3.0alpha1/ext/opcache/zend_accelerator_util_funcs.c:662:2: error: unknown register name ‘%ymm0’ in ‘asm’
make: *** [ext/opcache/zend_accelerator_util_funcs.lo] Error 1


lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 94
Model name:            Intel Core Processor (Skylake, IBRS)
Stepping:              3
CPU MHz:               2099.998
BogoMIPS:              4199.99
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              4096K
NUMA node0 CPU(s):     0-3
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw 

gcc -c -Q -march=native --help=target
The following options are target specific:
  -m128bit-long-double                  [disabled]
  -m32                                  [disabled]
  -m3dnow                               [disabled]
  -m3dnowa                              [disabled]
  -m64                                  [enabled]
  -m80387                               [enabled]
  -m8bit-idiv                           [disabled]
  -m96bit-long-double                   [enabled]
  -mabi=                                sysv
  -mabm                                 [enabled]
  -maccumulate-outgoing-args            [disabled]
  -maddress-mode=                       short
  -madx                                 [enabled]
  -maes                                 [enabled]
  -malign-double                        [disabled]
  -malign-functions=                    0
  -malign-jumps=                        0
  -malign-loops=                        0
  -malign-stringops                     [enabled]
  -mandroid                             [disabled]
  -march=                               core-avx2
  -masm=                                att
  -mavx                                 [enabled]
  -mavx2                                [enabled]
  -mavx256-split-unaligned-load         [disabled]
  -mavx256-split-unaligned-store        [disabled]
  -mbionic                              [disabled]
  -mbmi                                 [enabled]
  -mbmi2                                [enabled]
  -mbranch-cost=                        0
  -mcld                                 [disabled]
  -mcmodel=                             32
  -mcpu=                      
  -mcrc32                               [disabled]
  -mcx16                                [enabled]
  -mdispatch-scheduler                  [disabled]
  -mf16c                                [enabled]
  -mfancy-math-387                      [enabled]
  -mfentry                              [enabled]
  -mfma                                 [enabled]
  -mfma4                                [disabled]
  -mforce-drap                          [disabled]
  -mfp-ret-in-387                       [enabled]
  -mfpmath=                             387
  -mfsgsbase                            [enabled]
  -mfunction-return=                    keep
  -mfused-madd                
  -mfxsr                                [enabled]
  -mglibc                               [enabled]
  -mhard-float                          [enabled]
  -mhle                                 [enabled]
  -mieee-fp                             [enabled]
  -mincoming-stack-boundary=            0
  -mindirect-branch-register            [disabled]
  -mindirect-branch=                    keep
  -minline-all-stringops                [disabled]
  -minline-stringops-dynamically        [disabled]
  -mintel-syntax              
  -mlarge-data-threshold=               0x10000
  -mlong-double-64                      [disabled]
  -mlong-double-80                      [enabled]
  -mlwp                                 [disabled]
  -mlzcnt                               [enabled]
  -mmmx                                 [disabled]
  -mmovbe                               [enabled]
  -mms-bitfields                        [disabled]
  -mno-align-stringops                  [disabled]
  -mno-fancy-math-387                   [disabled]
  -mno-push-args                        [disabled]
  -mno-red-zone                         [disabled]
  -mno-sse4                             [disabled]
  -momit-leaf-frame-pointer             [disabled]
  -mpc32                                [disabled]
  -mpc64                                [disabled]
  -mpc80                                [disabled]
  -mpclmul                              [enabled]
  -mpku                                 [disabled]
  -mpopcnt                              [enabled]
  -mprefer-avx128                       [disabled]
  -mpreferred-stack-boundary=           0
  -mprfchw                              [enabled]
  -mpush-args                           [enabled]
  -mrdrnd                               [enabled]
  -mrdseed                              [enabled]
  -mrecip                               [disabled]
  -mrecip=                    
  -mred-zone                            [enabled]
  -mregparm=                            0
  -mrtd                                 [disabled]
  -mrtm                                 [enabled]
  -msahf                                [enabled]
  -msoft-float                          [disabled]
  -msse                                 [enabled]
  -msse2                                [enabled]
  -msse2avx                             [disabled]
  -msse3                                [enabled]
  -msse4                                [enabled]
  -msse4.1                              [enabled]
  -msse4.2                              [enabled]
  -msse4a                               [disabled]
  -msse5                      
  -msseregparm                          [disabled]
  -mssse3                               [enabled]
  -mstack-arg-probe                     [disabled]
  -mstackrealign                        [enabled]
  -mstringop-strategy=                  [default]
  -mtbm                                 [disabled]
  -mtls-dialect=                        gnu
  -mtls-direct-seg-refs                 [enabled]
  -mtune=                               generic
  -muclibc                              [disabled]
  -mveclibabi=                          [default]
  -mvect8-ret-in-mem                    [disabled]
  -mvzeroupper                          [disabled]
  -mx32                                 [disabled]
  -mxop                                 [disabled]
  -mxsave                               [enabled]
  -mxsaveopt                            [enabled]

configure

../configure --enable-fpm --enable-opcache --enable-intl --enable-pcntl --with-mcrypt --with-snmp --enable-embed=shared --with-mhash --with-zlib --with-gettext --enable-exif --enable-zip --with-libzip --with-bz2 --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-shmop --with-pear --enable-mbstring --with-openssl --with-mysql=mysqlnd --with-libdir=lib64 --with-mysqli=mysqlnd --with-mysql-sock=/var/lib/mysql/mysql.sock --with-curl --with-gd --with-xmlrpc --enable-bcmath --enable-calendar  --enable-ftp --enable-gd-native-ttf --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --with-webp-dir=/usr --with-t1lib=/usr --enable-pdo --with-pdo-sqlite --with-pdo-mysql=mysqlnd --enable-inline-optimization --with-imap --with-imap-ssl --with-kerberos --with-readline --with-libedit --with-gmp --with-pspell --with-tidy --with-enchant --with-fpm-user=nginx --with-fpm-group=nginx --disable-fileinfo --with-ldap --with-ldap-sasl --with-password-argon2 --with-sodium --with-config-file-scan-dir=/etc/centminmod/php.d --with-xsl


Expected result:
----------------
expected it to compile successfully like it does with PHP 7.2.6 and 7.3.0alpha1 on non-skylake cpus 

i.e. Xeon E3-1270v1 Sandybridge compiles fine

php -v
PHP 7.3.0alpha1 (cli) (built: Jun  8 2018 00:51:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.0alpha1, Copyright (c) 1999-2018, by Zend Technologies

php --ri "Zend Opcache"

Zend OPcache

Opcode Caching => Disabled
Optimization => Disabled
SHM Cache => Enabled
File Cache => Disabled
Startup Failed => Opcode Caching is disabled for CLI

Directive => Local Value => Master Value
opcache.enable => On => On
opcache.use_cwd => On => On
opcache.validate_timestamps => On => On
opcache.validate_permission => Off => Off
opcache.validate_root => Off => Off
opcache.dups_fix => Off => Off
opcache.revalidate_path => Off => Off
opcache.log_verbosity_level => 1 => 1
opcache.memory_consumption => 784 => 784
opcache.interned_strings_buffer => 8 => 8
opcache.max_accelerated_files => 65407 => 65407
opcache.max_wasted_percentage => 5 => 5
opcache.consistency_checks => 0 => 0
opcache.force_restart_timeout => 180 => 180
opcache.revalidate_freq => 180 => 180
opcache.file_update_protection => 2 => 2
opcache.preferred_memory_model => no value => no value
opcache.blacklist_filename => no value => no value
opcache.max_file_size => 0 => 0
opcache.protect_memory => 0 => 0
opcache.save_comments => 1 => 1
opcache.optimization_level => 0x7FFEBFFF => 0x7FFEBFFF
opcache.opt_debug_level => 0 => 0
opcache.enable_file_override => On => On
opcache.enable_cli => Off => Off
opcache.error_log => no value => no value
opcache.restrict_api => no value => no value
opcache.lockfile_path => /tmp => /tmp
opcache.file_cache => no value => no value
opcache.file_cache_only => 0 => 0
opcache.file_cache_consistency_checks 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-09 13:55 UTC] cmb@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: laruence
 [2018-06-09 13:55 UTC] cmb@php.net
It seems that AVX support has been introduced with commit
5c05870[1].  @laruence, could you please have a look at this
issue?

[1] <http://git.php.net/?p=php-src.git;a=commit;h=5c05870ef65834f5a2c5cb5baddee07cba9399dc>
 [2018-06-11 03:45 UTC] laruence@php.net
you may try to add -mavx to your configuration...

and, you are trying compile with -march=core-avx2 which is not the same as -march=native which you are debugging 

thanks
 [2018-06-11 09:43 UTC] spam2 at rhsoft dot net
laruence@php.net -mavx / -march are completly irrelevant to the AVX support in the code because one is using a AVX optimized branch if the CPU supports it at runtime for generic binaries and the other is auto-optimization by the complier for code which is not hand optimized and non-generic binaries
 [2018-06-11 13:05 UTC] laruence@php.net
@spam2 at rhsoft dot net  I am not sure I understand you correctly.

I am asking you to try to figure out why __AVX__ is defined but ymm0 is not supported by add -mavx or gcc -c -Q -march=core-avx2 --help=target
 [2018-06-11 13:15 UTC] spam2 at rhsoft dot net
@laruence@php.net what i said is that -mavx ist a GCC tuning-option which is unrelated to explicit AVX instructions in the code itself

if AVX in fact is not available on the CPU and defined(__AVX__) is true there is something wrong in the detection or the logic "defined(__AVX__) || defined(__SSE2__)" but -mavx or -march don't change anything here because these are GCC flags for automatically use AVX on not hand-optimized code like transform SSE-code to AVX or auto-vectorization

-mavx / -march are related to https://gcc.gnu.org/projects/tree-ssa/vectorization.html and not to http://git.php.net/?p=php-src.git;a=commit;h=5c05870ef65834f5a2c5cb5baddee07cba9399dc
 [2018-06-12 04:08 UTC] laruence@php.net
okey, thanks. but the problem is not about avx instructions, it about gcc doesn't recognize ymm0 in inline asm.. so I was asking to print gcc --help=target to check if it is explictly supported. 

the problem may relates to old gcc bug (I remembered that gcc before 4.9 has problems while supporting __AVX__ in __target() attribute, but not sure if it relates to this case).
 [2018-06-22 17:58 UTC] eva2000 at centminmod dot com
sorry for late reply getting same error on a upcloud.com KVM VPS with E5-2687w v4 cpu too and here's target output for CentOS 7.5 GCC 4.8.5 and indeed these 2 are disabled !

  -mavx                                 [disabled]
  -mavx2                                [disabled]

gcc -c -Q -march=core-avx2 --help=target
The following options are target specific:
  -m128bit-long-double                  [disabled]
  -m32                                  [disabled]
  -m3dnow                               [disabled]
  -m3dnowa                              [disabled]
  -m64                                  [enabled]
  -m80387                               [enabled]
  -m8bit-idiv                           [disabled]
  -m96bit-long-double                   [enabled]
  -mabi=                                sysv
  -mabm                                 [disabled]
  -maccumulate-outgoing-args            [disabled]
  -maddress-mode=                       short
  -madx                                 [disabled]
  -maes                                 [disabled]
  -malign-double                        [disabled]
  -malign-functions=                    0
  -malign-jumps=                        0
  -malign-loops=                        0
  -malign-stringops                     [enabled]
  -mandroid                             [disabled]
  -march=                               core-avx2
  -masm=                                att
  -mavx                                 [disabled]
  -mavx2                                [disabled]
  -mavx256-split-unaligned-load         [disabled]
  -mavx256-split-unaligned-store        [disabled]
  -mbionic                              [disabled]
  -mbmi                                 [disabled]
  -mbmi2                                [disabled]
  -mbranch-cost=                        0
  -mcld                                 [disabled]
  -mcmodel=                             32
  -mcpu=                      
  -mcrc32                               [disabled]
  -mcx16                                [disabled]
  -mdispatch-scheduler                  [disabled]
  -mf16c                                [disabled]
  -mfancy-math-387                      [enabled]
  -mfentry                              [enabled]
  -mfma                                 [disabled]
  -mfma4                                [disabled]
  -mforce-drap                          [disabled]
  -mfp-ret-in-387                       [enabled]
  -mfpmath=                             387
  -mfsgsbase                            [disabled]
  -mfunction-return=                    keep
  -mfused-madd                
  -mfxsr                                [disabled]
  -mglibc                               [enabled]
  -mhard-float                          [enabled]
  -mhle                                 [disabled]
  -mieee-fp                             [enabled]
  -mincoming-stack-boundary=            0
  -mindirect-branch-register            [disabled]
  -mindirect-branch=                    keep
  -minline-all-stringops                [disabled]
  -minline-stringops-dynamically        [disabled]
  -mintel-syntax              
  -mlarge-data-threshold=               0x10000
  -mlong-double-64                      [disabled]
  -mlong-double-80                      [enabled]
  -mlwp                                 [disabled]
  -mlzcnt                               [disabled]
  -mmmx                                 [disabled]
  -mmovbe                               [disabled]
  -mms-bitfields                        [disabled]
  -mno-align-stringops                  [disabled]
  -mno-fancy-math-387                   [disabled]
  -mno-push-args                        [disabled]
  -mno-red-zone                         [disabled]
  -mno-sse4                             [enabled]
  -momit-leaf-frame-pointer             [disabled]
  -mpc32                                [disabled]
  -mpc64                                [disabled]
  -mpc80                                [disabled]
  -mpclmul                              [disabled]
  -mpku                                 [disabled]
  -mpopcnt                              [disabled]
  -mprefer-avx128                       [disabled]
  -mpreferred-stack-boundary=           0
  -mprfchw                              [disabled]
  -mpush-args                           [enabled]
  -mrdrnd                               [disabled]
  -mrdseed                              [disabled]
  -mrecip                               [disabled]
  -mrecip=                    
  -mred-zone                            [enabled]
  -mregparm=                            0
  -mrtd                                 [disabled]
  -mrtm                                 [disabled]
  -msahf                                [disabled]
  -msoft-float                          [disabled]
  -msse                                 [disabled]
  -msse2                                [disabled]
  -msse2avx                             [disabled]
  -msse3                                [disabled]
  -msse4                                [disabled]
  -msse4.1                              [disabled]
  -msse4.2                              [disabled]
  -msse4a                               [disabled]
  -msse5                      
  -msseregparm                          [disabled]
  -mssse3                               [disabled]
  -mstack-arg-probe                     [disabled]
  -mstackrealign                        [enabled]
  -mstringop-strategy=                  [default]
  -mtbm                                 [disabled]
  -mtls-dialect=                        gnu
  -mtls-direct-seg-refs                 [enabled]
  -mtune=                     
  -muclibc                              [disabled]
  -mveclibabi=                          [default]
  -mvect8-ret-in-mem                    [disabled]
  -mvzeroupper                          [disabled]
  -mx32                                 [disabled]
  -mxop                                 [disabled]
  -mxsave                               [disabled]
  -mxsaveopt                            [disabled]

  Known assembler dialects (for use with the -masm-dialect= option):
    att intel

  Known ABIs (for use with the -mabi= option):
    ms sysv

  Known code models (for use with the -mcmodel= option):
    32 kernel large medium small

  Valid arguments to -mfpmath=:
    387 387+sse 387,sse both sse sse+387 sse,387

  Known indirect branch choices (for use with the -mindirect-branch=/-mfunction-return= options):
    keep thunk thunk-extern thunk-inline

  Known vectorization library ABIs (for use with the -mveclibabi= option):
    acml svml

  Known address mode (for use with the -maddress-mode= option):
    long short

  Valid arguments to -mstringop-strategy=:
    byte_loop libcall loop rep_4byte rep_8byte rep_byte unrolled_loop

  Known TLS dialects (for use with the -mtls-dialect= option):
    gnu gnu2
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sat Dec 15 18:01:26 2018 UTC