Thanks for reporting the problem.
This looks like a bug in GiNaC, the library we use for the symbolic
expressions.
ginsh - GiNaC Interactive Shell (ginac V1.5.7)
__, _______ Copyright (C) 1999-2010 Johannes Gutenberg University
Mainz, (__) * | Germany. This is free software with ABSOLUTELY
NO WARRANTY. ._) i N a C | You are welcome to redistribute it under
certain conditions. <-------------' For details type `warranty;'.
Type ?? for a list of help topics.
> subs(5-exp(x),x==log(x));
5-log(x)
I opened a ticket for this:
http://trac.sagemath.org/sage_trac/ticket/9891
Cheers,
Burcin