Document that the compiler may optimize away atoms
Document that the compiler may optimize away atoms

The following code could fail in the call to list_existing_atom/1:

  String = atom_to_list(some_atom),
  Atom = list_to_existing_atom(String)

because the compiler will rewrite the code to:

  String = "some_atom",
  Atom = list_to_existing_atom(String)

If some_atom is not used in another place, it will not exist.

The compiler could be updated to preserve the atom in this simple case,
but it would be hard to make sure that the compiler never loses atoms
that exist in the source text. It also difficult to imagine a
real world use case where this would be a problem. If an atom is
mentioned only in a way that the compiler can optimize away, is there
really any need to create the atom at all in list_to_existing_atom/1?

Therefore, it is better to place the responsibility that the atom exists
on the user of list_to_existing_atom/1. Update the documentation to
mention that the compiler may optimize away atoms.

https://bugs.erlang.org/browse/ERL-453

vinoski/otp,emacsmirror/erlang,rlipscombe/otp,RaimoNiskanen/otp,g-andrade/otp,electricimp/otp,vinoski/otp,rlipscombe/otp,cobusc/otp,getong/otp,tuncer/otp,RoadRunnr/otp,saleyn/otp,uabboli/otp,fenollp/otp,dgud/otp,dumbbell/otp,electricimp/otp,matwey/otp,kvakvs/otp,ferd/otp,getong/otp,jj1bdx/otp,jj1bdx/otp,getong/otp,rlipscombe/otp,saleyn/otp,g-andrade/otp,electricimp/otp,kvakvs/otp,lrascao/otp,potatosalad/otp,getong/otp,bernardd/otp,lrascao/otp,vladdu/otp,saleyn/otp,getong/otp,saleyn/otp,vladdu/otp,falkevik/otp,kvakvs/otp,falkevik/otp,erlang/otp,lrascao/otp,bsmr-erlang/otp,ferd/otp,cobusc/otp,ferd/otp,erlang/otp,saleyn/otp,aboroska/otp,mikpe/otp,dumbbell/otp,isvilen/otp,dgud/otp,vladdu/otp,legoscia/otp,aboroska/otp,erlang/otp,getong/otp,potatosalad/otp,matwey/otp,g-andrade/otp,tuncer/otp,ferd/otp,bjorng/otp,vladdu/otp,bsmr-erlang/otp,mikpe/otp,kvakvs/otp,vinoski/otp,g-andrade/otp,RoadRunnr/otp,legoscia/otp,vinoski/otp,emacsmirror/erlang,isvilen/otp,RoadRunnr/otp,fenollp/otp,electricimp/otp,bjorng/otp,potatosalad/otp,erlang/otp,falkevik/otp,cobusc/otp,uabboli/otp,cobusc/otp,vinoski/otp,potatosalad/otp,mikpe/otp,dumbbell/otp,legoscia/otp,matwey/otp,lrascao/otp,tuncer/otp,jj1bdx/otp,potatosalad/otp,bsmr-erlang/otp,uabboli/otp,aboroska/otp,falkevik/otp,matwey/otp,potatosalad/otp,potatosalad/otp,emacsmirror/erlang,kvakvs/otp,RaimoNiskanen/otp,fenollp/otp,saleyn/otp,bernardd/otp,emacsmirror/erlang,bjorng/otp,vladdu/otp,isvilen/otp,isvilen/otp,fenollp/otp,matwey/otp,cobusc/otp,legoscia/otp,isvilen/otp,RaimoNiskanen/otp,bjorng/otp,falkevik/otp,uabboli/otp,jj1bdx/otp,legoscia/otp,g-andrade/otp,fenollp/otp,rlipscombe/otp,electricimp/otp,emacsmirror/erlang,RaimoNiskanen/otp,cobusc/otp,bernardd/otp,fenollp/otp,bernardd/otp,matwey/otp,aboroska/otp,dgud/otp,RoadRunnr/otp,kvakvs/otp,erlang/otp,bsmr-erlang/otp,falkevik/otp,lrascao/otp,uabboli/otp,bsmr-erlang/otp,matwey/otp,ferd/otp,dumbbell/otp,matwey/otp,fenollp/otp,dumbbell/otp,isvilen/otp,potatosalad/otp,dumbbell/otp,jj1bdx/otp,RaimoNiskanen/otp,electricimp/otp,cobusc/otp,g-andrade/otp,rlipscombe/otp,uabboli/otp,jj1bdx/otp,RaimoNiskanen/otp,uabboli/otp,dgud/otp,matwey/otp,mikpe/otp,potatosalad/otp,legoscia/otp,mikpe/otp,dgud/otp,tuncer/otp,dumbbell/otp,falkevik/otp,bjorng/otp,emacsmirror/erlang,vladdu/otp,mikpe/otp,jj1bdx/otp,mikpe/otp,vladdu/otp,saleyn/otp,aboroska/otp,RaimoNiskanen/otp,jj1bdx/otp,vinoski/otp,emacsmirror/erlang,g-andrade/otp,legoscia/otp,g-andrade/otp,bjorng/otp,vinoski/otp,rlipscombe/otp,vinoski/otp,erlang/otp,RoadRunnr/otp,isvilen/otp,falkevik/otp,tuncer/otp,dumbbell/otp,vinoski/otp,bsmr-erlang/otp,bjorng/otp,legoscia/otp,ferd/otp,lrascao/otp,RaimoNiskanen/otp,g-andrade/otp,falkevik/otp,erlang/otp,electricimp/otp,isvilen/otp,bernardd/otp,dgud/otp,tuncer/otp,ferd/otp,bernardd/otp,fenollp/otp,RaimoNiskanen/otp,bjorng/otp,uabboli/otp,bsmr-erlang/otp,bjorng/otp,aboroska/otp,dgud/otp,aboroska/otp,tuncer/otp,cobusc/otp,lrascao/otp,g-andrade/otp,bernardd/otp,bjorng/otp,mikpe/otp,jj1bdx/otp,vladdu/otp,electricimp/otp,saleyn/otp,saleyn/otp,rlipscombe/otp,uabboli/otp,legoscia/otp,fenollp/otp,dumbbell/otp,erlang/otp,dumbbell/otp,lrascao/otp,mikpe/otp,rlipscombe/otp,lrascao/otp,getong/otp,rlipscombe/otp,dgud/otp,vladdu/otp,getong/otp,RoadRunnr/otp,RoadRunnr/otp,getong/otp,dgud/otp,kvakvs/otp,isvilen/otp,isvilen/otp,electricimp/otp,aboroska/otp,potatosalad/otp,kvakvs/otp,aboroska/otp,bsmr-erlang/otp,tuncer/otp,rlipscombe/otp,dgud/otp,bernardd/otp,tuncer/otp,bsmr-erlang/otp,RoadRunnr/otp,mikpe/otp,jj1bdx/otp,vinoski/otp,erlang/otp,ferd/otp,emacsmirror/erlang,emacsmirror/erlang,kvakvs/otp,ferd/otp,bernardd/otp,getong/otp,erlang/otp,emacsmirror/erlang,RoadRunnr/otp