Skip to content

Automated test failure: union with alignment attrs #1393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vext01 opened this issue Sep 20, 2018 · 1 comment
Closed

Automated test failure: union with alignment attrs #1393

vext01 opened this issue Sep 20, 2018 · 1 comment
Assignees
Labels

Comments

@vext01
Copy link

vext01 commented Sep 20, 2018

In my project, I have this automatically generated test failure:

---- p_ffi::bindgen_test_layout_La_x86_64_vector stdout ----
thread 'p_ffi::bindgen_test_layout_La_x86_64_vector' panicked at 'assertion failed: `(left == right)`
  left: `8`,
 right: `16`: Alignment of La_x86_64_vector', /home/vext01/research/phdrs_pv/target/debug/build/phdrs-766b5f3742f78b0d/out/bindings.rs:7077:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Caused by:

/* Registers for entry into PLT on x86-64.  */                                        
# if __GNUC_PREREQ (4,0)                                                              
typedef float La_x86_64_xmm __attribute__ ((__vector_size__ (16)));                   
typedef float La_x86_64_ymm                                                           
    __attribute__ ((__vector_size__ (32), __aligned__ (16)));                         
typedef double La_x86_64_zmm                                                          
    __attribute__ ((__vector_size__ (64), __aligned__ (16)));                         
# else                                                                                
typedef float La_x86_64_xmm __attribute__ ((__mode__ (__V4SF__)));                    
# endif

typedef union                                                                         
{                                                                                     
# if __GNUC_PREREQ (4,0)                                                              
  La_x86_64_ymm ymm[2];                                                               
  La_x86_64_zmm zmm[1];                                                               
# endif                                                                               
  La_x86_64_xmm xmm[4];                                                               
} La_x86_64_vector __attribute__ ((__aligned__ (16)));

As discussed in #1370

Cheers

emilio added a commit to emilio/rust-bindgen that referenced this issue Sep 20, 2018
Also adds a test header I missed from the previous PR.

Fixes rust-lang#1393
@emilio emilio self-assigned this Sep 20, 2018
@emilio
Copy link
Contributor

emilio commented Sep 20, 2018

Fix at #1394.

bors-servo pushed a commit that referenced this issue Sep 21, 2018
codegen: Explicitly align unions if needed.

Also adds a test header I missed from the previous PR.

Fixes #1393
emilio added a commit that referenced this issue Sep 21, 2018
Also adds a test header I missed from the previous PR.

Fixes #1393
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants