Message ID | 87fv3is74z.fsf@schwinge.name |
---|---|
State | New |
Headers | show |
On 08/17/15 03:31, Thomas Schwinge wrote: > Hi! > > I observed that for a (slowly increasing?) number of C++ testcases > (gcc/testsuite/g++.*/), their nvptx compilation fails as follows: This is occurring because in C++land (some?) functions that return structs via a hidden parameter now also return a reference to that struct (see cp_genericize in cp-gimplify.c). Hence it is possible for RETURN_IN_REG (return_type) to be false AND for a return value in a register (!). testing a patch. nathan
diff --git gcc/config/nvptx/nvptx.h gcc/config/nvptx/nvptx.h index afe4fcd..d846ec3 100644 --- gcc/config/nvptx/nvptx.h +++ gcc/config/nvptx/nvptx.h @@ -103,8 +103,8 @@ enum reg_class #define N_REG_CLASSES (int) LIM_REG_CLASSES #define REG_CLASS_NAMES { \ - "RETURN_REG", \ "NO_REGS", \ + "RETURN_REG", \ "ALL_REGS" } #define REG_CLASS_CONTENTS \ @@ -119,7 +119,7 @@ enum reg_class #define GENERAL_REGS ALL_REGS -#define REGNO_REG_CLASS(R) ((R) == 4 ? RETURN_REG : ALL_REGS) +#define REGNO_REG_CLASS(R) ((R) == NVPTX_RETURN_REGNUM ? RETURN_REG : ALL_REGS) #define BASE_REG_CLASS ALL_REGS #define INDEX_REG_CLASS NO_REGS