https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107739
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So there are two issues but I don't know how to solve the second part of the issue. The first issue is there is a missing g for the flags of the s command of the sed command here: missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"` But after doing that it still fails because if you had: ,c++,c++,lto, It matches ,c++, and replaces it with , but then sed does not reconsiders the , again and does not match c++. Someone with some better shell scripting knowledge should look into this.