[Bug tree-optimization/35842] ICE without -fno-tree-ch

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Apr 6 16:07:00 GMT 2008



------- Comment #3 from rguenth at gcc dot gnu dot org  2008-04-06 16:06 -------
-fno-tree-ch probably just hides the bug.  -linux targets work for me.

(gdb) call debug_generic_expr (tmp)
&SSL_ImplementedCiphers
(gdb) call is_gimple_min_invariant (tmp)
$1 = 0 '\0'

which is the problem.

static bool
fixed_address_object_p (tree obj)
{
  return (TREE_CODE (obj) == VAR_DECL
          && (TREE_STATIC (obj)
              || DECL_EXTERNAL (obj)));
}

doesn't match what is_gimple_invariant_address checks for, in this
case probably the DECL_DLLIMPORT_P part of

    case VAR_DECL:
      if (((TREE_STATIC (op) || DECL_EXTERNAL (op))
           && ! DECL_DLLIMPORT_P (op))
          || DECL_THREAD_LOCAL_P (op)
          || DECL_CONTEXT (op) == current_function_decl
          || decl_function_context (op) == current_function_decl)
        return true;

is at fault.  Fixing that mismatch with the obvious

Index: tree-ssa-address.c
===================================================================
--- tree-ssa-address.c  (revision 133961)
+++ tree-ssa-address.c  (working copy)
@@ -345,7 +345,8 @@ fixed_address_object_p (tree obj)
 {
   return (TREE_CODE (obj) == VAR_DECL
          && (TREE_STATIC (obj)
-             || DECL_EXTERNAL (obj)));
+             || DECL_EXTERNAL (obj))
+         && ! DECL_DLLIMPORT_P (obj));
 }

 /* If ADDR contains an address of object that is a link time constant,

leaves us with

./cc1plus -quiet t.ii -O
/mnt/dump/src/mozilla/mozilla/security/manager/ssl/src/nsCipherInfo.cpp: In
constructor ‘nsCipherInfo::nsCipherInfo(PRUint16)’:
/mnt/dump/src/mozilla/mozilla/security/manager/ssl/src/nsCipherInfo.cpp:73:
internal compiler error: in legitimize_pic_address, at config/i386/i386.c:7666
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

      /* Given that we've already handled dllimport variables separately
         in legitimize_address, and all other variables should satisfy
         legitimate_pic_address_disp_p, we should never arrive here.  */
      gcc_assert (!TARGET_64BIT_MS_ABI);


Can you bootstrap & test the tree-ssa-address.c change?  It is correct
nevetheless.


-- 


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



More information about the Gcc-bugs mailing list