public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "skunk at iskunk dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/18665] New: -ftrapv borks up simple integer arithmetic
Date: Wed, 24 Nov 2004 22:29:00 -0000	[thread overview]
Message-ID: <20041124222749.18665.skunk@iskunk.org> (raw)

A large program was failing mysteriously on our new Opteron box. Went through it
with a fine-toothed debugger, until I came to the line

    k -= i;  /* <k> and <i> are ints */

Before this line: k == 2, i == 1
 After this line: k == -14, i == 1

Compiling without -ftrapv makes this weirdness go away.

I will attach a tarball containing two .c files and a makefile, basically the
aforementioned big program with all irrelevant code ripped out---just enough to
reproduce the problem.

This bug first came up with 3.4.2, as shipped with Fedora Core 3 (x86-64). I
built 3.4.3 with the below configuration to confirm that the bug is still present.

Output from "gcc -v"
====================
Reading specs from
/mnt/freeport/opt/gcc-3.4.3--linux64/bin/../lib/gcc/x86_64-unknown-linux-gnu/3.4.3/specs
Configured with: /mnt/freeport/src/gcc/current/configure
--prefix=/mnt/freeport/arch/linux64 --disable-dependency-tracking
--disable-shared --disable-nls --with-libiconv-prefix=/mnt/freeport/arch/linux64
--disable-multilib --with-arch=opteron
Thread model: posix
gcc version 3.4.3

-- 
           Summary: -ftrapv borks up simple integer arithmetic
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: skunk at iskunk dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18665


             reply	other threads:[~2004-11-24 22:29 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-24 22:29 skunk at iskunk dot org [this message]
2004-11-24 22:32 ` [Bug target/18665] " skunk at iskunk dot org
2004-11-24 22:42 ` pinskia at gcc dot gnu dot org
2004-11-28  0:07 ` steven at gcc dot gnu dot org
2004-11-28  0:22 ` steven at gcc dot gnu dot org
2004-11-28  0:26 ` steven at gcc dot gnu dot org
2004-11-28  0:31 ` [Bug target/18665] [4.0 Regression] " steven at gcc dot gnu dot org
2004-11-28  0:33 ` [Bug target/18665] [3.4/4.0 " pinskia at gcc dot gnu dot org
2004-11-28  0:34 ` steven at gcc dot gnu dot org
2004-11-28 13:00 ` steven at gcc dot gnu dot org
2004-12-06 18:45 ` ebotcazou at gcc dot gnu dot org
2004-12-06 18:47 ` ebotcazou at gcc dot gnu dot org
2004-12-06 20:51 ` rth at gcc dot gnu dot org
2004-12-07  6:59 ` ebotcazou at gcc dot gnu dot org
2004-12-07 14:36 ` schlie at comcast dot net
2004-12-10  7:35 ` ebotcazou at gcc dot gnu dot org
2004-12-10  9:53 ` ebotcazou at gcc dot gnu dot org
2004-12-10 10:11 ` ebotcazou at gcc dot gnu dot org
2004-12-10 18:59 ` [Bug other/18665] " rth at gcc dot gnu dot org
2004-12-10 19:24 ` ebotcazou at gcc dot gnu dot org
2004-12-10 19:40 ` rth at gcc dot gnu dot org
2004-12-10 20:04 ` ebotcazou at gcc dot gnu dot org
2004-12-10 20:17 ` rth at gcc dot gnu dot org
2004-12-11  9:39 ` ebotcazou at gcc dot gnu dot org
2004-12-11 23:12 ` rth at gcc dot gnu dot org
2004-12-12  7:19 ` ebotcazou at gcc dot gnu dot org
2004-12-13 17:11 ` pinskia at gcc dot gnu dot org
2004-12-14 14:17 ` pinskia at gcc dot gnu dot org
2004-12-14 14:36 ` ebotcazou at gcc dot gnu dot org
2004-12-15 12:31 ` cvs-commit at gcc dot gnu dot org
2004-12-15 12:35 ` cvs-commit at gcc dot gnu dot org
2004-12-15 12:39 ` ebotcazou 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=20041124222749.18665.skunk@iskunk.org \
    --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).