[Bug inline-asm/23200] [4.0/4.1 regression] rejects "i"(&var + 1)

amacleod at redhat dot com gcc-bugzilla@gcc.gnu.org
Mon Aug 15 17:18:00 GMT 2005


------- 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



More information about the Gcc-bugs mailing list