This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PR3256: Exceptions vs. delay slots
- To: Jakub Jelinek <jakub at redhat dot com>
- Subject: Re: PR3256: Exceptions vs. delay slots
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Thu, 19 Jul 2001 16:00:39 -0700
- cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
>> I am thinking that we need to change our delay-slot scheduler to not
>> pull instructions from beyond calls that might throw exceptions (i.e,
>> calls that are not marked `nothrow' when -fexceptions is turned on).
>> Obviously, you could pull instructions if they only affect things that
>> will go out of scope before the `catch', etc., etc., but first things
>> first.
>
> Cannot this be limited to sets to REG_USERVAR_P() registers?
I don't know. But, we should adopt the mentality that unless you
can prove it's safe based on GCC's documented interfaces, then you
can't do it. How do we know, for example, that it isn't contain
a register that contains a partial result of some computation? For
example:
int i = 1;
try {
g ();
i = 3;
} catch (...) {
}
return 2 * i;
Perhaps we cleverly change this into:
int <temp> = 2;
try {
g ();
<temp> = 6;
} catch (...) {
}
return <temp>;
Now, temp is not a user variable, but the problem persists. If
we don't do this today, we might do it tomorrow, and then the problem
would show up.
Essentially, you are depending on some property of REG_USERVAR_P that
you think exists, but that isn't documented anywhere. I will code
defensively and let someone else convince themselves that a) any
pessimization is actually worth fixing, and b) there is a safe way to
do better.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com