GCC Wikia
Advertisement

このページを編集する際は,編集に関する方針に従ってください.[]

概要[]

引数[]

実装[]

10487 /* Fold a binary tree expression with code CODE of type TYPE with
10488    operands OP0 and OP1.  Return a folded expression if successful.
10489    Otherwise, return a tree expression with code CODE of type TYPE
10490    with operands OP0 and OP1.  */
10491 
10492 tree
10493 fold_build2_stat (enum tree_code code, tree type, tree op0, tree op1
10494                   MEM_STAT_DECL)
10495 {
10496   tree tem;
10497 #ifdef ENABLE_FOLD_CHECKING
10498   unsigned char checksum_before_op0[16],
10499                 checksum_before_op1[16],
10500                 checksum_after_op0[16],
10501                 checksum_after_op1[16];
10502   struct md5_ctx ctx;
10503   htab_t ht;
10504 
10505   ht = htab_create (32, htab_hash_pointer, htab_eq_pointer, NULL);
10506   md5_init_ctx (&ctx);
10507   fold_checksum_tree (op0, &ctx, ht);
10508   md5_finish_ctx (&ctx, checksum_before_op0);
10509   htab_empty (ht);
10510 
10511   md5_init_ctx (&ctx);
10512   fold_checksum_tree (op1, &ctx, ht);
10513   md5_finish_ctx (&ctx, checksum_before_op1);
10514   htab_empty (ht);
10515 #endif
10516 
10517   tem = fold_binary (code, type, op0, op1);
10518   if (!tem)
10519     tem = build2_stat (code, type, op0, op1 PASS_MEM_STAT);
10520   
10521 #ifdef ENABLE_FOLD_CHECKING
10522   md5_init_ctx (&ctx);
10523   fold_checksum_tree (op0, &ctx, ht);
10524   md5_finish_ctx (&ctx, checksum_after_op0);
10525   htab_empty (ht);
10526 
10527   if (memcmp (checksum_before_op0, checksum_after_op0, 16))
10528     fold_check_failed (op0, tem);
10529   
10530   md5_init_ctx (&ctx);
10531   fold_checksum_tree (op1, &ctx, ht);
10532   md5_finish_ctx (&ctx, checksum_after_op1);
10533   htab_delete (ht);
10534 
10535   if (memcmp (checksum_before_op1, checksum_after_op1, 16))
10536     fold_check_failed (op1, tem);
10537 #endif
10538   return tem;
10539 }



リンク元

Advertisement