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: unassig...@gcc.gnu.org
        ReportedBy: einar.sjurso+...@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.

Reply via email to