4.1 cc1plus compiler on sh4-linux fails with the ICE

foo.cc:11: internal compiler error: in gimplify_addr_expr, at gimplify.c:3572

for

struct S
{
  double a;
};

void
foo (int z, ...)
{
  struct S arg;
  __builtin_va_list ap;
  arg = __builtin_va_arg (ap, struct S);
}

and 4.2 cc1plus fails with the similar message.  sh-elf cc1plus
also fails with -m4.
Binary search shows that it starts to fail just after the patch

r110565 | jason | 2006-02-04 06:57:08 +0900 (Sat, 04 Feb 2006) | 7 lines

        PR c++/25979
        * gimplify.c (gimplify_modify_expr_rhs): Disable *& optimization for
now.

        PR middle-end/25977
        * gimplify.c (gimplify_modify_expr_rhs): It's not always safe to do RVO
        on the return slot if it's an NRV.

and the ICE goes away if the first hunk of the patch is reverted.
It seems that the tree made by sh_gimplify_va_arg_expr depends on
that *& optimization which is now disabled.


-- 
           Summary: va_arg causes cc1plus ICE in gimplify_addr_expr
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kkojima at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: sh4-*-linux-gnu


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

Reply via email to