public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: stefaandr@hotmail.com
To: gcc-gnats@gcc.gnu.org
Subject: c++/9573: typedef with __attribute__ ((mode(....))) doesnt seem to work inside a struct/class
Date: Tue, 04 Feb 2003 18:26:00 -0000	[thread overview]
Message-ID: <20030204182549.2798.qmail@sources.redhat.com> (raw)


>Number:         9573
>Category:       c++
>Synopsis:       typedef with __attribute__ ((mode(....))) doesnt seem to work inside a struct/class
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 04 18:26:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     stefaandr@hotmail.com
>Release:        gcc version 3.4 20030204 (experimental)
>Organization:
>Environment:
Redhat 8.0

Reading specs from /esat/quendi/stefaan/install/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with: ../../src/gcc/configure --enable-languages=c,c++ --prefix=/esat/quendi/stefaan/install
Thread model: posix
gcc version 3.4 20030204 (experimental)
 /esat/quendi/stefaan/install/lib/gcc-lib/i686-pc-linux-gnu/3.4/cc1plus -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=4 -D__GNUC_PATCHLEVEL__=0 -D_GNU_SOURCE test16.cpp -D__GNUG__=3 -quiet -dumpbase test16.cpp -msse -auxbase-strip test16.s -O3 -version -o test16.s
GNU C++ version 3.4 20030204 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 3.2.1.
ignoring nonexistent directory "/esat/quendi/stefaan/install/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /esat/quendi/stefaan/install/include/c++/3.4
 /esat/quendi/stefaan/install/include/c++/3.4/i686-pc-linux-gnu
 /esat/quendi/stefaan/install/include/c++/3.4/backward
 /usr/local/include
 /esat/quendi/stefaan/install/include
 /esat/quendi/stefaan/install/lib/gcc-lib/i686-pc-linux-gnu/3.4/include
 /usr/include
End of search list.
>Description:
Compiling this code: (g++ -msse)

struct v8qi {
	typedef int T __attribute__ ((mode(V8QI)));
	v8qi() {
		long long int tmp;
		__builtin_ia32_punpckhbw((T) tmp, (T) tmp);
	};
};

does NOT work.  The error is:
test16.cpp:5: error: cannot convert `int' to `vector signed char' for argument
   `1' to `vector signed char __builtin_ia32_punpckhbw(vector signed char,
   vector signed char)'

But when you move the typedef out of the struct, you get this:
typedef int T __attribute__ ((mode(V8QI)));
struct v8qi {
	v8qi() {
		long long int tmp;
		__builtin_ia32_punpckhbw((T) tmp, (T) tmp);
	};
};

which DOES compile!!  It seems that using __attribute__ ((mode(..))) on a typedef inside a struct/class does not work.  Any ideas?
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2003-02-04 18:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-04 18:26 stefaandr [this message]
2003-02-05 16:14 bangerth

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=20030204182549.2798.qmail@sources.redhat.com \
    --to=stefaandr@hotmail.com \
    --cc=gcc-gnats@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).