=== modified file 'src/dired.c' --- src/dired.c 2014-04-16 19:43:46 +0000 +++ src/dired.c 2014-08-01 08:11:30 +0000 @@ -133,7 +133,7 @@ In the latter case, ID_FORMAT is passed to Ffile_attributes. */ Lisp_Object -directory_files_internal (Lisp_Object directory, Lisp_Object full, +directory_files_internal (Lisp_Object dir, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, bool attrs, Lisp_Object id_format) { @@ -149,6 +149,16 @@ #ifdef WINDOWSNT Lisp_Object w32_save = Qnil; #endif +#ifdef __clang__ + /* It is suspected that clang (as of 3.4 running with -O2) can + optimize DIR away so there is no reference from C stack to + this object. Since this can crash GC, we're using volatile + variable to disable such an optimization. For details, see + http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16986#32. */ + volatile Lisp_Object directory = dir; +#else + Lisp_Object directory = dir; +#endif /* Because of file name handlers, these functions might call Ffuncall, and cause a GC. */