public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/54344] New: Issue with multiple "arch=" function attributes.
@ 2012-08-21 12:21 einar.sjurso+gnu at gmail dot com
  2014-01-13  9:44 ` [Bug target/54344] illegal instructions generated with multiple "arch" " jtaylor.debian at googlemail dot com
  2021-08-28 18:57 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: einar.sjurso+gnu at gmail dot com @ 2012-08-21 12:21 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54344
           Summary: Issue with multiple "arch=" function attributes.
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: einar.sjurso+gnu@gmail.com


#include <stdio.h>
#include <stdarg.h>

int __attribute__ ((__target__ ("arch=corei7-avx", "tune=corei7-avx")))
printf_avx(const char *restrict format, ...)
{
        va_list ap;
        va_start(ap, format);
        const int ret = vfprintf(stdout, format, ap);
        va_end(ap);
        return ret;
}

int __attribute__ ((__target__ ("arch=atom", "tune=atom"))) printf_noavx(const
char *restrict format, ...)
{
        va_list ap;
        va_start(ap, format);
        const int ret = vfprintf(stdout, format, ap);
        va_end(ap);
        return ret;
}

Given this silly example, vmovaps will ge generated in printf_noavx.


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

* [Bug target/54344] illegal instructions generated with multiple "arch" function attributes
  2012-08-21 12:21 [Bug target/54344] New: Issue with multiple "arch=" function attributes einar.sjurso+gnu at gmail dot com
@ 2014-01-13  9:44 ` jtaylor.debian at googlemail dot com
  2021-08-28 18:57 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jtaylor.debian at googlemail dot com @ 2014-01-13  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

Julian Taylor <jtaylor.debian at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jtaylor.debian at googlemail dot c
                   |                            |om

--- Comment #1 from Julian Taylor <jtaylor.debian at googlemail dot com> ---
you can work around the issue by putting the attributes only in the
declarations not the definitions and the declaration must be placed before all
definitions.

int printf_avx(const char *restrict format, ...) __attribute__ ((__target__
("arch=corei7-avx", "tune=corei7-avx"))) ;
int printf_noavx(const char *restrict format, ...) __attribute__ ((__target__
("arch=atom", "tune=atom"))) ;

int printf_avx(const char *restrict format, ...)
{
        va_list ap;
...


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

* [Bug target/54344] illegal instructions generated with multiple "arch" function attributes
  2012-08-21 12:21 [Bug target/54344] New: Issue with multiple "arch=" function attributes einar.sjurso+gnu at gmail dot com
  2014-01-13  9:44 ` [Bug target/54344] illegal instructions generated with multiple "arch" " jtaylor.debian at googlemail dot com
@ 2021-08-28 18:57 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-28 18:57 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
   Target Milestone|---                         |4.9.0
      Known to fail|                            |4.8.2, 4.8.5
      Known to work|                            |4.9.0, 5.1.0, 7.1.0
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed in GCC 4.9.0. There were many improvements to the target attribute for
GCC 4.9.0 and even some for later versions of the compiler.

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

end of thread, other threads:[~2021-08-28 18:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-21 12:21 [Bug target/54344] New: Issue with multiple "arch=" function attributes einar.sjurso+gnu at gmail dot com
2014-01-13  9:44 ` [Bug target/54344] illegal instructions generated with multiple "arch" " jtaylor.debian at googlemail dot com
2021-08-28 18:57 ` 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).