public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/32970]  New: C++ frontend can not handle vector pointer constant parameter
@ 2007-08-02 18:37 saliu at de dot ibm dot com
  2007-08-06 16:32 ` [Bug c++/32970] [4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: saliu at de dot ibm dot com @ 2007-08-02 18:37 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-08-17  6:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-02 18:37 [Bug c++/32970] New: C++ frontend can not handle vector pointer constant parameter saliu at de dot ibm dot com
2007-08-06 16:32 ` [Bug c++/32970] [4.3 Regression] " pinskia at gcc dot gnu dot org
2007-08-06 23:15 ` janis at gcc dot gnu dot org
2007-08-07 11:31 ` saliu at de dot ibm dot com
2007-08-07 23:17 ` janis at gcc dot gnu dot org
2007-08-08 13:38 ` saliu at de dot ibm dot com
2007-08-10  0:59 ` mmitchel at gcc dot gnu dot org
2007-08-10 10:13 ` saliu at de dot ibm dot com
2007-08-12 23:36 ` [Bug middle-end/32970] " uweigand at gcc dot gnu dot org
2007-08-12 23:43 ` uweigand at gcc dot gnu dot org
2007-08-17  6:49 ` bje at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).