public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60729] New: Compiler failure for combination of -ftrapv and -O3: compiler error: in prepare_cmp_insn
@ 2014-04-01 13:22 rppawlo at sandia dot gov
  2014-04-01 13:28 ` [Bug c++/60729] " rppawlo at sandia dot gov
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rppawlo at sandia dot gov @ 2014-04-01 13:22 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 4513 bytes --]

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

            Bug ID: 60729
           Summary: Compiler failure for combination of -ftrapv and -O3:
                    compiler error: in prepare_cmp_insn
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rppawlo at sandia dot gov

Created attachment 32514
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32514&action=edit
test file

Hi,

I'm running stock Ubuntu 13.10 and get a g++ compiler error when using a
certain commbination of compiler options.  

The attached file reproduces the bug:

*************************BEGIN FILE***********************

// This test generates an inernal compiler failure in g++ 4.8.1 on
// ubuntu 13.10.  The combination of -O3 and -ftrapv causes the issue.
// You can drop to -O2 or remove -ftrapv to fix.

// The following compile works:
// g++ -O3 -c test.cpp
// g++ -O2 -ftrapv -c test.cpp

// The following compile fails:
// g++ -ftrapv -O3 -c test.cpp

#include <cmath>

void doSomething(int dim, double *Y, double *A) 
{
  for (int k=0; k<dim; k++) 
    Y[k] += std::abs(A[k]);
}

*************************END FILE***********************

Here's the output:

rppawlo@drekar:~$ g++ -O3 -c test.cpp
rppawlo@drekar:~$ g++ -O2 -ftrapv -c test.cpp
rppawlo@drekar:~$ g++ -ftrapv -O3 -c test.cpp
test.cpp: In function ‘void doSomething(int, double*, double*)’:
test.cpp:17:27: internal compiler error: in prepare_cmp_insn, at optabs.c:4190
     Y[k] += std::abs(A[k]);
                           ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
Preprocessed source stored into /tmp/cccvQgai.out file, please attach this to
your bugreport.
rppawlo@drekar:~$


Here's some info about my machine/environment:

rppawlo@drekar:~$ g++ --version
g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

rppawlo@drekar:~$ uname -a
Linux drekar 3.11.0-18-generic #32-Ubuntu SMP Tue Feb 18 21:11:14 UTC 2014
x86_64 x86_64 x86_64 GNU/Linux
>From gcc-bugs-return-448034-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 01 13:23:09 2014
Return-Path: <gcc-bugs-return-448034-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 12671 invoked by alias); 1 Apr 2014 13:23:08 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 12642 invoked by uid 48); 1 Apr 2014 13:23:05 -0000
From: "rppawlo at sandia dot gov" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60729] Compiler failure for combination of -ftrapv and -O3: compiler error: in prepare_cmp_insn
Date: Tue, 01 Apr 2014 13:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rppawlo at sandia dot gov
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-60729-4-8sfcV9e1yB@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60729-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60729-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg00054.txt.bz2
Content-length: 236

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`729

--- Comment #1 from rppawlo at sandia dot gov ---
Created attachment 32515
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id2515&actioníit
output file generated with -save-temps


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-04-23 12:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-01 13:22 [Bug c++/60729] New: Compiler failure for combination of -ftrapv and -O3: compiler error: in prepare_cmp_insn rppawlo at sandia dot gov
2014-04-01 13:28 ` [Bug c++/60729] " rppawlo at sandia dot gov
2014-04-01 14:35 ` rguenth at gcc dot gnu.org
2014-04-02  8:27 ` rguenth at gcc dot gnu.org
2014-04-02  8:28 ` [Bug middle-end/60729] [4.8 Regression] " rguenth at gcc dot gnu.org
2014-04-23 12:49 ` rguenth at gcc dot gnu.org
2014-04-23 12:52 ` rguenth at gcc dot gnu.org

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).