From: Joe Buck <Joe.Buck@synopsys.COM>
To: Paul Koning <Paul_Koning@Dell.com>
Cc: schwab@suse.de, mark.kettenis@xs4all.nl, drow@false.org,
gcc@sources.redhat.com, sposelenov@emcraft.com,
gdb@sources.redhat.com
Subject: Re: Problem reading corefiles on ARM
Date: Thu, 07 Aug 2008 16:56:00 -0000 [thread overview]
Message-ID: <20080807165539.GP18206@synopsys.com> (raw)
In-Reply-To: <18586.63614.111756.993754@gargle.gargle.HOWL>
Joe> After all, if we have
int func1(int);
void func2(int);
void ordinary_function(void);
void func(int arg) {
int v1 = func1(arg);
func2(v1);
ordinary_function();
}
> Joe> and there's a segfault in ordinary_function, in general v1 isn't
> Joe> going to be kept around for inspection in the core dump. So why
> Joe> should we impose a stricter requirement if ordinary_function is
> Joe> replaced by abort() ? It seems Paul thinks we should be
> Joe> required to save v1 if there's an abort call, unless I'm
> Joe> misunderstanding.
On Thu, Aug 07, 2008 at 09:28:30AM -0400, Paul Koning wrote:
> My view is that abort() should be like other (returning) functions --
> no special treatment for variable liveness. Yes, that means in the
> optimized case you may lose, some of the time. People chose -O
> settings with that issue in mind. I'm not asking for more to be saved
> for abort() than for regular functions -- but also no less.
I'm not sure if anyone besides Paul and me care any more, but I'll just
do one more.
OK, consider this case:
int func1(int);
void func2(int);
bool test(void);
void func3(int);
void func(int arg) {
int v1 = func1(arg);
func2(v1);
if (test()) {
func3(v1);
}
}
Here if we put v1 in a register, we obviously have to save it across
the call to test(), unless we know that test() will never return true,
in which case we don't need to save v1.
But what about replacing the "if" by
if (!test())
abort();
func3(v1);
Now, if I read you right, we'd have so save v1 even if we know that
test() returns false.
next prev parent reply other threads:[~2008-08-07 16:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-06 15:20 Sergei Poselenov
2008-08-06 15:28 ` Daniel Jacobowitz
2008-08-06 15:45 ` Mark Kettenis
2008-08-06 15:51 ` Daniel Jacobowitz
2008-08-06 16:02 ` Paul Koning
2008-08-06 17:10 ` Joe Buck
2008-08-06 17:39 ` Paul Koning
2008-08-06 17:52 ` Joe Buck
2008-08-06 18:11 ` Paul Koning
2008-08-06 21:39 ` Andreas Schwab
2008-08-06 21:58 ` Joe Buck
2008-08-07 13:30 ` Paul Koning
2008-08-07 16:56 ` Joe Buck [this message]
2008-08-07 17:29 ` Paul Koning
2008-08-07 9:30 ` Sergei Poselenov
2008-08-07 13:44 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080807165539.GP18206@synopsys.com \
--to=joe.buck@synopsys.com \
--cc=Paul_Koning@Dell.com \
--cc=drow@false.org \
--cc=gcc@sources.redhat.com \
--cc=gdb@sources.redhat.com \
--cc=mark.kettenis@xs4all.nl \
--cc=schwab@suse.de \
--cc=sposelenov@emcraft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox