cc1 error for large Casadi Dynamics

Hi :wave:

I am currently working on generating dynamically stable motions for a humanoid robot (Unitree H1-2).
During this process I encountered the following error:

cc: internal compiler error: Segmentation fault signal terminated program cc1                             
Please submit a full bug report, with preprocessed source (by using -freport-bug).                        
See <file:///usr/share/doc/gcc-13/README.Bugs> for instructions.                                          
make: *** [<builtin>: h1_2_model/h1_2_expl_vde_forw.o] Error 4

What I managed to debug is that this error only occurs when the CasADi formulation gets particularly large. (e.g., complex contacts)
As far as I understand, this is not directly a bug in Acados, but a limitation of how complex the dynamics of a system can get before gcc in the code generation process pulls the plug.

If it is of any help, I could provide the code or the problems .json in a public GitHub. However, as the problem only surfaces for a complex problem, this would require Pinocchio to be set up.`

Did someone run into this issue before, and is there a workaround?

Thank you for building and mainting Acados🥇


Further information about my Setup:

For rigid-body dynamics, I am using Pinocchio (4.0.0) to generate the corresponding CasADi functions, which I then forward into Acados (0.5.1). Both are compiled from source to use the exact same CasADi version (3.7.2). Everything is generated through Python.