On Thu, May 15, 2008 at 2:44 AM, DJ Delorie <[EMAIL PROTECTED]> wrote:
>
>  More digging has identified this patch as the cause of the ongoing
>  C++-related m32c build failures:
>
>  2008-03-24  Richard Guenther  <[EMAIL PROTECTED]>
>
>         PR c/22371
>         * gimplify.c (gimplify_modify_expr): For frontend type-correct
>         pointer assignments change conversions according to middle-end rules.
>         (gimplify_modify_expr_rhs): Deal with NULL TARGET_EXPR_INITIAL.
>         * configure.ac: Include type checking in yes.
>         * configure: Regenerate.
>
>  In file included from ../../../../../gcc/libstdc++-v3/src/strstream.cc:50:
>  
> /greed/dj/m32c/gcc/m32c-elf/m32c-elf/m32cm/libstdc++-v3/include/backward/strstream:
>  In member function 'void std::ostrstream::_ZTv0_n12_NSt10ostrstreamD0Ev()':
>  
> /greed/dj/m32c/gcc/m32c-elf/m32c-elf/m32cm/libstdc++-v3/include/backward/strstream:142:
>  error: invalid types in nop conversion
>  unsigned int
>  int (*__vtbl_ptr_type) (void)
>
> D.25530 = (unsigned int) D.25529
>  
> /greed/dj/m32c/gcc/m32c-elf/m32c-elf/m32cm/libstdc++-v3/include/backward/strstream:142:
>  internal compiler error: verify_gimple failed
>
>  I have a .ii file and command line, but it's 560kb (-mcpu=m32cm build
>  of strstream.cc in libstdc++)
>
>  Note that --enable-checking=none lets the build pass (as of the 25th)
>  but I haven't yet tried testing to see if proper code is generated.
>  Thus, I don't know if the patch caused the bug, or exposed it.

The patch simply enabled type checking by default.  As I don't see how
we can easily address the underlying problem can you try the following
which simply makes this typechecking weaker?

Index: tree-cfg.c
===================================================================
--- tree-cfg.c  (revision 135328)
+++ tree-cfg.c  (working copy)
@@ -3643,7 +3643,8 @@ verify_gimple_expr (tree expr)
           there is no sign or zero extension involved.  */
        if (((POINTER_TYPE_P (type) && INTEGRAL_TYPE_P (TREE_TYPE (op)))
             || (POINTER_TYPE_P (TREE_TYPE (op)) && INTEGRAL_TYPE_P (type)))
-           && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (op)))
+           && (TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (op))
+               || type == sizetype || TREE_TYPE (op) == sizetype))
          return false;

        /* Allow conversion from integer to offset type and vice versa.  */

Thanks,
Richard.

Reply via email to