Fix ICE on view conversion between struct and integer
This happens from prepare_gimple_addressable for the variable to be marked with DECL_NOT_GIMPLE_REG_P when its initialization is gimplified, so it's apparently just a matter of setting the flag earlier. gcc/ * gimplify.cc (lookup_tmp_var): Add NOT_GIMPLE_REG boolean parameter and set DECL_NOT_GIMPLE_REG_P on the variable according to it. (internal_get_tmp_var): Add NOT_GIMPLE_REG boolean parameter and pass it in the call to lookup_tmp_var. (get_formal_tmp_var): Pass false in the call to lookup_tmp_var. (get_initialized_tmp_var): Likewise. (prepare_gimple_addressable): Call internal_get_tmp_var instead of get_initialized_tmp_var with NOT_GIMPLE_REG set to true. gcc/testsuite/ * gnat.dg/opt98.ads, gnat.dg/opt98.adb: New test.
gcc/testsuite/gnat.dg/opt98.adb
0 → 100644
gcc/testsuite/gnat.dg/opt98.ads
0 → 100644
Please register or sign in to comment