https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70366
--- Comment #3 from prathamesh3492 at gcc dot gnu.org --- (In reply to Richard Biener from comment #2) > The ICE points at > > cl_optimization_restore (&opts, > TREE_OPTIMIZATION (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (to->decl))); > > so it is likely DECL_FUNCTION_SPECIFIC_OPTIMIZATION being NULL. That's > quite possible. Does replacing this with > > cl_optimization_restore (&opts, opts_for_fn (to->decl)); > > fix this? If so please prepare and test a patch doing that. DECL_FUNCTION_SPECIFIC_OPTIMIZATION was indeed NULL. Using opts_for_fn worked and libGLESv2.so gets built successfully (rest of the chromium build is still in progress). I will post the patch after bootstrap+test. Thanks, Prathamesh