Skip to content
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

GCC stopped permitting referencing a packed field. #23

Open
puellanivis opened this issue Jul 24, 2019 · 3 comments · May be fixed by #28
Open

GCC stopped permitting referencing a packed field. #23

puellanivis opened this issue Jul 24, 2019 · 3 comments · May be fixed by #28

Comments

@puellanivis
Copy link

ppc_fpu.cc: In function ‘void ppc_opc_frsqrtex(PPC_CPU_State&)’:
ppc_fpu.cc:1870:63: error: cannot bind packed field ‘aCPU.PPC_CPU_State::fpr[frD]’ to ‘uint64&’ {aka ‘long unsigned int&’}
 1870 |  aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, aCPU.fpr[frD]);
      |                                                   ~~~~~~~~~~~~^

Apparently, the C++ standards changed at some point, and referencing into a packed struct, means that you cannot guarantee alignment, which could cause issues on some architectures that do not permit unaligned accesses, so GCC decided that this dictates that the code should be prevented from compiling.

GCC version info:

pearpc$ g++ --version
g++ (SUSE Linux) 9.1.1 20190611 [gcc-9-branch revision 272147]
@Shoegzer
Copy link

Confirmed here too, on linux mint 20, kernel 5.4 and gcc 9.3.0

@Hodapp87
Copy link

Confirmed on NixOS as well. Locking to GCC 8 works.

@nesper8
Copy link

nesper8 commented Aug 2, 2020

Confirmed and reproducable on EndeavourOS as well (Arch based) with GCC version 10.1.0

Ill try to compile out on a ubuntu18 docker image which still have both 7.1.0 and 8.0.0 GCC

Update:
docker build seems successful but yet to test it as i dont have a valid MacOSX disk file rn
I'll make a release in my fork if that doesn't breach GPLv2

Sry for bad english

@jonathanschilling jonathanschilling linked a pull request Sep 29, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants