asm volatile

Greg Badros gjb@cs.washington.edu
Sun Sep 6 12:01:00 GMT 1998


Code in __scm.h does this:

#ifdef __GNUC__
#define SCM_FENCE asm volatile ("")
#else
#define SCM_FENCE
#endif

and SCM_FENCE is then used in SCM_DEFER_INTS:

#define SCM_DEFER_INTS \
{ \
  SCM_FENCE; \
  SCM_CHECK_NOT_DISABLED; \
  SCM_THREAD_DEFER; \
  SCM_FENCE; \
  scm_ints_disabled = 1; \
  SCM_FENCE; \
} \


(which btw, is dangerous for not having the do { ... } while(0)
sandwiching it, and the extra trailing backslash)

My concern is over the observation that w/ egcs-1.1b's g++ building
guile code (in particular, cassowary_scm.cc, of my Cassowary constraint
solver library that Scwm uses 
[see http://www.cs.washington.edu/research/constraints/cassowary/ ]),
I get lots of warnings regarding the asm volatile being ignored:

scwm-constraints.hpp:71: warning: volatile qualifier ignored on asm

I did not get such warnings from egcs-1.01 thru 1.03a, so something must
have changed.  I'm not sure if this is a bug in egcs, or if it's a
change in its guarantees.  If egcs is not buggy on this point, then the
SCM_FENCE may need to be expanded away to nothing to avoid the warning
and we need to be sure that something else is preventing code motion as
SCM_FENCE is intended to do.

Greg




More information about the Gcc-bugs mailing list