On 6/27/18 3:26 PM, Peter Bergner wrote: > gcc/ > PR target/86324 > * target.def (translate_mode_attribute): New hook. > * targhooks.h (default_translate_mode_attribute): Declare. > * targhooks.c (default_translate_mode_attribute): New function. > * doc/tm.texi.in (TARGET_TRANSLATE_MODE_ATTRIBUTE): New hook. > * doc/tm.texi: Regenerate. > * config/rs6000/rs6000.c (TARGET_TRANSLATE_MODE_ATTRIBUTE): Define. > (rs6000_translate_mode_attribute): New function. > > gcc/c-family/ > PR target/86324 > * c-attribs.c (handle_mode_attribute): Call new translate_mode_attribute > target hook.
Oops, I forgot the test cases. Here they are. Peter gcc/testsuite/ PR target/86324 gcc.target/powerpc/pr86324-1.c: New test. gcc.target/powerpc/pr86324-2.c: Likewise. Index: gcc/testsuite/gcc.target/powerpc/pr86324-1.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/pr86324-1.c (nonexistent) +++ gcc/testsuite/gcc.target/powerpc/pr86324-1.c (working copy) @@ -0,0 +1,10 @@ +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-options "-mlong-double-128 -mabi=ieeelongdouble -Wno-psabi" } */ + +typedef __complex float cflt_t __attribute__((mode(KC))); + +cflt_t +divide (cflt_t *ptr) +{ + return *ptr; +} Index: gcc/testsuite/gcc.target/powerpc/pr86324-2.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/pr86324-2.c (nonexistent) +++ gcc/testsuite/gcc.target/powerpc/pr86324-2.c (working copy) @@ -0,0 +1,10 @@ +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-options "-mlong-double-128 -mabi=ibmlongdouble -Wno-psabi" } */ + +typedef __complex float cflt_t __attribute__((mode(IC))); + +cflt_t +divide (cflt_t *ptr) +{ + return *ptr; +}