https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119573
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I think .const can be safely used for tree_output_constant_def / output_constant_def created constants or any time something is clearly read-only and locally defined and not visible outside of the TU. For the C++ extern const vs. runtime initialization in other TU, what does clang use? Wonder if we couldn't emit conditional code in the extern cases if (magic) access_as_const; else access_as_global; and resolve the magic when "linking" PTX to either true or false depending on in whether the definition is .const or not. Though, wonder if it isn't valid to const int a = foo (); in one TU and extern int a; in another one.