Mail Archives: djgpp/2000/02/02/22:09:56
broeker AT acp3bf DOT physik DOT rwth-aachen DOT de (Hans-Bernhard Broeker) wrote in
<879ri7$a04$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>:
>According to the explanation on the GCC web pages, the old method that
>tolerated this was simply too broken to let it live. It could confuse
>the optimizer into producing incorrect code, for some rare, but
>existing cases. They claim they had no choice but to break backwards
>compatibility, once and for all.
Yes, this really seems to be their claim. And I know, this also is
getting off topic here. Anyway, before I am going to write to the
gcc maintainers, I might hear some comments from this forum about
my suggestion.
My naive algorithom to solve the dilemma would be: for any input in an
asm construct, that is not on the output list, but is in the clobbered
list, allocate a new variable, assign the input to that new
variable and treat the input as if it was refering to that new variable.
I.e.:
/* This worked with older gcc versions, and from my understanding
this was also documented as working */
type someval;
asm(
/* Use somereg, and modify somereg */
: /* output is not interesting in this example */
: ("somereg"), someval
: (somereg) /* yes, somereg will be modified */
);
translate this to
/* This works with gcc 2.95 */
type someval, tempval;
tempval = someval;
asm(
/* Use somereg, and modify somereg */
: ("=somereg"), "tempval"
: ("0"), "someval"
/* no clobbered registers needed here */
)
This "translation", should be easy to code. But I must have overlooked
something, otherwise this incompatible change in gcc behaviour would
not make any sense.
[I aske for an URL, that discusses this issue]
>http://gcc.gnu.org/fom_serv/cache/23.html
Thank you.
Regards
Dieter
- Raw text -