public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/59390] New: presence of  __attribute__((target("fma"))) declaration breaks __builtin_fma
@ 2013-12-04 20:46 jtaylor.debian at googlemail dot com
  2013-12-05  7:10 ` [Bug target/59390] " ubizjak at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jtaylor.debian at googlemail dot com @ 2013-12-04 20:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59390
           Summary: presence of  __attribute__((target("fma")))
                    declaration breaks __builtin_fma
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jtaylor.debian at googlemail dot com

compiling this code leads to a compilation error on -O3:


#include "math.h"
void fun() __attribute__((target("fma")));

void 
other_fun(double *restrict out, double * restrict a, double * restrict b,
double * restrict c, int n)
{
    int i;
    for (i = 0; i < n; i++) {
        out[i] = fma(a[i], b[i], c[i]);
    }   
}

$ cc-4.9 fma.c -c -std=c99 -O3
fma.c: In function ‘other_fun’:
fma.c:9:21: error: ‘__builtin_ia32_vfmaddpd’ needs isa option -m32 -mfma4 -mfma
         out[i] = fma(a[i], b[i], c[i]);
                     ^

removing the attribute from the unused declaration fixes it, as does using
-fno-builtin or a lower optimization level.

$ gcc-4.9 -v
Using built-in specs.
COLLECT_GCC=/home/jtaylor/tmp/gcc-local/bin/../bin/gcc
COLLECT_LTO_WRAPPER=/home/jtaylor/tmp/gcc-local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/jtaylor/tmp/gcc/configure
--enable-languages=c,c++,fortran --enable-tls
--prefix=/home/jtaylor/tmp/gcc-local --with-gmp=/usr --with-mpfr=/usr
--with-mpc=/usr --with-cloog=/usr --with-ppl=/usr --with-isl=/usr
Thread model: posix
gcc version 4.9.0 20131204 (experimental) (GCC)

also affects gcc 4.8.1
>From gcc-bugs-return-436671-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Dec 04 20:59:14 2013
Return-Path: <gcc-bugs-return-436671-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23008 invoked by alias); 4 Dec 2013 20:59:14 -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 19393 invoked by uid 48); 4 Dec 2013 20:57:56 -0000
From: "octoploid at yandex dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/58251] -flto causes ICE lto1: internal compiler error: in splice_child_die, at dwarf2out.c:4706
Date: Wed, 04 Dec 2013 20:59:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: lto
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: octoploid at yandex dot com
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: cc
Message-ID: <bug-58251-4-04HyiDNy65@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58251-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58251-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: 2013-12/txt/msg00326.txt.bz2
Content-length: 604

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX251

Markus Trippelsdorf <octoploid at yandex dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |octoploid at yandex dot com

--- Comment #2 from Markus Trippelsdorf <octoploid at yandex dot com> ---
(In reply to David Kredba from comment #1)
> I can reproduce this with Gentoo gcc-4.8.2 and new KDE's kig package 4.11.4.
>
> How to debug this please?

http://gcc.gnu.org/wiki/A_guide_to_testcase_reduction


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

end of thread, other threads:[~2023-12-04  3:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-04 20:46 [Bug target/59390] New: presence of __attribute__((target("fma"))) declaration breaks __builtin_fma jtaylor.debian at googlemail dot com
2013-12-05  7:10 ` [Bug target/59390] " ubizjak at gmail dot com
2013-12-05 10:52 ` rguenth at gcc dot gnu.org
2013-12-05 19:24 ` tmsriram at google dot com
2013-12-06  0:34 ` tmsriram at google dot com
2013-12-11 20:06 ` tmsriram at gcc dot gnu.org
2021-08-09  7:30 ` pinskia at gcc dot gnu.org
2023-12-04  3:10 ` pinskia 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).