c++/9573: typedef with __attribute__ ((mode(....))) doesnt seem to work inside a struct/class

stefaandr@hotmail.com stefaandr@hotmail.com
Tue Feb 4 18:26:00 GMT 2003


>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:



More information about the Gcc-bugs mailing list