public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pkk at spth dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/31290] gcc.c-torture/execute/920612-1.c and gcc.c-torture/execute/920711-1.c depend on signed overflow being defined
Date: Tue, 30 Aug 2022 07:08:26 +0000	[thread overview]
Message-ID: <bug-31290-4-HXljx0BskN@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-31290-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31290

Philipp <pkk at spth dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pkk at spth dot de

--- Comment #4 from Philipp <pkk at spth dot de> ---
I disagree about this bug for gcc.c-torture/execute/920711-1.c. I think there
was no bug here, and the "fix" actually introduced a problem, and should be
reverted:

I do not see signed integer overflow here:

f (0x80000000L)

Unless explicitly noted otherwise, all section numbers in the following refer
to the C2X standard draft N3047.

The 0x80000000L might be outside the range of long (i.e. on systems where long
has 32 bits). In that case, it will have type long long, as per the table in
section 6.4.4.1. Since the argument to f is of type long, it will get converted
to type long. That is not undefined, but implementation-defined according to
section 6.3.1.3.
By section 4.5 of the GCC manual
https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html#Integers-implementation
the result of the conversion is -1.

  parent reply	other threads:[~2022-08-30  7:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-31290-4@http.gcc.gnu.org/bugzilla/>
2021-07-19 19:28 ` pinskia at gcc dot gnu.org
2022-08-30  7:08 ` pkk at spth dot de [this message]
2022-08-30 15:19 ` pinskia at gcc dot gnu.org
2007-03-21  0:43 [Bug testsuite/31290] New: gcc.c-torture/execute/920612-1.c depends on " pinskia at gcc dot gnu dot org
2007-03-21 14:56 ` [Bug testsuite/31290] gcc.c-torture/execute/920612-1.c and gcc.c-torture/execute/920711-1.c depend on signed " pinskia at gcc dot gnu dot org

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-31290-4-HXljx0BskN@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).