When compiling a function with parameter of a pointer to a vector constant 
type, the compiler calls a recursive function and is not able to get out. 

Concretely, in gcc/cp/mangle.c file, in function write_type:

  if (write_CV_qualifiers_for_type (type) > 0)
    /* If TYPE was CV-qualified, we just wrote the qualifiers; now
       mangle the unqualified type.  The recursive call is needed here
       since both the qualified and unqualified types are substitution
       candidates.  */
    write_type (TYPE_MAIN_VARIANT (type));

But TYPE_MAIN_VARIANT (type) has been set as type itself in gcc/tree.c 
function make_node_stat:
   case tcc_type:
        ...
      TYPE_MAIN_VARIANT (t) = t;

Therefor the write_type function runs into a dead recursion.

The bug was detected on spu, and the same error appears on PowerPC and Intel
too.

The following is a test case on Intel:

void bar(
    int __attribute__((vector_size(16))) * a,
    int __attribute__((vector_size(16))) * const b);

int instance(void)
{
   int __attribute__((vector_size(16))) a[1], b[1];

   bar(a, b);
}


-- 
           Summary: C++ frontend can not handle vector pointer constant
                    parameter
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: saliu at de dot ibm dot com
 GCC build triplet: powerpc64-unknown-linux-gnu
  GCC host triplet: powerpc64-unknown-linux-gnu
GCC target triplet: spu-unknown-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32970

Reply via email to