The code in the void CompilerGCC::SetupEnvironment() does not store the existing path for use on subsequent calls and as such if you change the masterpath for a compiler via the Settings->Compiler menu dialog that pops up you can end up with a path that has multiple materpaths on it.
An example of this is problem of what the path may end up as is (copied from debugger and removed excesses paths ):
C:\\msys64\\mingw64\\bin;C:\\msys64\\mingw64;C:\\msys64\\mingw32\\bin;C:\\msys64\\mingw32;.;
Path usage in the compiler plugin is strange, to say the least, but touching anything there is dangerous.
1000% agree and have not come up with a potential solution as it is not easy due to where it is and how the class is used.
Any change needs to be very carefully tested as it may/will affect the other code that changes the path.
If a solution cannot be found within say 60 days then this ticket should be closed as the chance of it being resolved after 60 days is approx 0.0000001%