public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "joseph at codesourcery dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/49914] call to abs(long long) in gcc/fold-const.c
Date: Tue, 02 Aug 2011 12:33:00 -0000 [thread overview]
Message-ID: <bug-49914-4-e3j4BoZlqW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49914-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49914
--- Comment #9 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2011-08-02 12:32:24 UTC ---
On Tue, 2 Aug 2011, rguenther at suse dot de wrote:
> well, I don't think we want the assert in abs_hwi as it stands now.
> Either we can handle this case in the callers or we should just do
> what we can - exploit the undefined behavior and return INT_MIN for
> INT_MIN.
If a caller is prepared to get a negative value back from abs_hwi, then an
abs_hwi_wrap version would seem appropriate for such a caller (or a
version that returns unsigned HOST_WIDE_INT, if the callers are written to
work with unsigned values). If a caller expects the result to be positive
and always the absolute value (but of a signed type), it's a bug in the
caller to pass the least HOST_WIDE_INT value, and the assert serves to
detect such a bug in the caller.
next prev parent reply other threads:[~2011-08-02 12:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-30 18:13 [Bug other/49914] New: " marc.glisse at normalesup dot org
2011-07-30 18:29 ` [Bug other/49914] " marc.glisse at normalesup dot org
2011-07-31 9:46 ` [Bug bootstrap/49914] " rguenth at gcc dot gnu.org
2011-08-01 16:37 ` paolo.carlini at oracle dot com
2011-08-01 16:45 ` joseph at codesourcery dot com
2011-08-01 16:57 ` paolo.carlini at oracle dot com
2011-08-01 17:21 ` paolo.carlini at oracle dot com
2011-08-01 19:48 ` paolo.carlini at oracle dot com
2011-08-02 8:41 ` rguenther at suse dot de
2011-08-02 8:43 ` rguenther at suse dot de
2011-08-02 12:33 ` joseph at codesourcery dot com [this message]
2011-08-02 20:28 ` paolo at gcc dot gnu.org
2011-08-02 20:32 ` paolo.carlini at oracle dot com
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=bug-49914-4-e3j4BoZlqW@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).