------- Additional Comments From amacleod at redhat dot com 2005-08-15 17:15 ------- TER isnt doing anything with this because there are no virtual operands. It sees:
# BLOCK 0 # PRED: ENTRY [100.0%] (fallthru,exec) D.1279 = &var + 1B; __asm__ __volatile__(""::"i" D.1279); return 0; so the stmt: D.1279 = &var + 1B; isnt considered for replacvement since there are no dependancies whatsoever on it. TER operates on the assumptions that if a stmt has no USES and no VUSES, then one of the other optimizations would have done the substitution if it were possible. There use to be a good reason for this, and there was a comment to that effect, but it seems to have been removed. Perhaps the original reason is gone, but the code hasnt been properly updated to fix the issue. A quick hack to TER to add a "NO_DEPEND_PARTITION" for such statements appears to do what you are looking for here: # BLOCK 0 # PRED: ENTRY [100.0%] (fallthru,exec) __asm__ __volatile__(""::"i" &var + 1B); return 0; I will run it through the test suites to see if it reintroduces whatever the original problem with these types of replacements was. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23200