This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

AltiVec too pedantic about type qualifiers


Hija,

I just discovered that AltiVec is quite pedantic and anal about type
qualifiers.

#include <altivec.h>

void test (const char *test)
{
  vector signed char vec;

  vec = vec_ld (0, test);
}

delivers:

test.c: In function `test':
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: warning: passing arg 2 of `__builtin_altivec_lvx' discards
qualifiers 
from pointer target type
test.c:7: incompatible types in assignment

IMHO this should at a maximum deliver on of the warning and no
error at all, given the fact that I just tried to hint the compiler
that the pointer is not used to write to memory.

In real world code this also leads to 

none.c:283: incompatible types in assignment
none.c:296: Internal compiler error in gen_reg_rtx, at emit-rtl.c:654
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

but unfortunately I cannot release this code and I haven't been able to
synthesize a testcase which bails out with an compiler error yet.

-- 
Servus,
       Daniel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]