From: Sascha Wildner Date: Mon, 4 Apr 2011 00:55:42 +0000 (+0200) Subject: Merge branch 'vendor/GCC44' X-Git-Tag: v2.11.0~107 X-Git-Url: https://gitweb.dragonflybsd.org/~nant/dragonfly.git/commitdiff_plain/8a782770327d0bd4f3c6ebf8d3adb3d8cea18b29?hp=-c Merge branch 'vendor/GCC44' --- 8a782770327d0bd4f3c6ebf8d3adb3d8cea18b29 diff --combined contrib/gcc-4.4/gcc/config.gcc index f3bf9f871f,6f72224c72..deab88bce3 --- a/contrib/gcc-4.4/gcc/config.gcc +++ b/contrib/gcc-4.4/gcc/config.gcc @@@ -1,6 -1,6 +1,6 @@@ # GCC target-specific configuration file. # Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - # 2008, 2009 Free Software Foundation, Inc. + # 2008, 2009, 2010 Free Software Foundation, Inc. #This file is part of GCC. @@@ -481,17 -481,13 +481,23 @@@ case ${target} i ;; esac fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h" + case ${target} in + *-*-freebsd[345].*) + :;; + *) + default_use_cxa_atexit=yes;; + esac ;; +*-*-dragonfly*) + gas=yes + gnu_ld=yes + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" + tmake_file="t-libc-ok t-libgcc-pic" + case ${enable_threads} in + "" | yes | posix) thread_file='posix' ;; + esac + default_use_cxa_atexit=yes + ;; *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" gas=yes @@@ -724,7 -720,7 +730,7 @@@ arm*-*-linux*) # ARM GNU/Linux with E case ${target} in arm*-*-linux-*eabi) tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h" - tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi" + tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" # The BPABI long long divmod functions return a 128-bit value in # registers r0-r3. Correctly modeling that requires the use of # TImode. @@@ -1057,13 -1053,6 +1063,13 @@@ x86_64-*-freebsd* tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" tmake_file="${tmake_file} i386/t-crtstuff" ;; +i[34567]86-*-dragonfly*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h i386/dragonfly.h" + ;; +x86_64-*-dragonfly*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h i386/x86-64.h i386/dragonfly64.h" + tmake_file="${tmake_file} i386/t-crtstuff" + ;; i[34567]86-*-netbsdelf*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" ;; @@@ -1105,7 -1094,7 +1111,7 @@@ i[34567]86-*-linux* | i[34567]86-*-kfre tmake_file="${tmake_file} i386/t-linux64" need_64bit_hwint=yes case X"${with_cpu}" in - Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx) + Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3) ;; X) if test x$with_cpu_64 = x; then @@@ -1114,7 -1103,7 +1120,7 @@@ ;; *) echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2 - echo "generic core2 nocona x86-64 amdfam10 barcelona k8 opteron athlon64 athlon-fx" 1>&2 + echo "generic core2 nocona x86-64 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2 exit 1 ;; esac @@@ -1194,6 -1183,12 +1200,12 @@@ i[34567]86-*-solaris2* ;; esac tm_file="${tm_file} i386/sol2.h" + if test x$gnu_ld = xyes; then + tm_file="${tm_file} sol2-gld.h" + fi + if test x$gas = xyes; then + tm_file="${tm_file} i386/sol2-gas.h" + fi tmake_file="${tmake_file} t-sol2 t-svr4" c_target_objs="${c_target_objs} sol2-c.o" cxx_target_objs="${cxx_target_objs} sol2-c.o" @@@ -1219,7 -1214,7 +1231,7 @@@ # libgcc/configure.ac instead. need_64bit_hwint=yes case X"${with_cpu}" in - Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx) + Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3) ;; X) if test x$with_cpu_64 = x; then @@@ -1228,7 -1223,7 +1240,7 @@@ ;; *) echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2 - echo "generic core2 nocona x86-64 amdfam10 barcelona k8 opteron athlon64 athlon-fx" 1>&2 + echo "generic core2 nocona x86-64 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2 exit 1 ;; esac @@@ -2208,7 -2203,7 +2220,7 @@@ sparc-*-elf* extra_parts="crti.o crtn.o crtbegin.o crtend.o" ;; sparc-*-linux*) # SPARC's running GNU/Linux, libc6 - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h linux.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/gas.h linux.h" extra_options="${extra_options} sparc/long-double-switch.opt" tmake_file="${tmake_file} sparc/t-linux" if test x$enable_targets = xall; then @@@ -2233,7 -2228,7 +2245,7 @@@ sparc64-*-solaris2* | sparcv9-*-solaris esac tm_file="${tm_file} sparc/sol2.h sparc/sol2-64.h sparc/sol2-bi.h" if test x$gnu_ld = xyes; then - tm_file="${tm_file} sparc/sol2-gld.h sparc/sol2-gld-bi.h" + tm_file="${tm_file} sol2-gld.h sparc/sol2-gld-bi.h" fi if test x$gas = xyes; then tm_file="${tm_file} sparc/sol2-gas.h sparc/sol2-gas-bi.h" @@@ -2245,6 -2240,9 +2257,9 @@@ else tmake_file="$tmake_file t-slibgcc-sld" fi + if test x$gas = xyes; then + tm_file="usegas.h ${tm_file}" + fi c_target_objs="sol2-c.o" cxx_target_objs="sol2-c.o" extra_objs="sol2.o" @@@ -2264,7 -2262,7 +2279,7 @@@ sparc-*-solaris2* esac tm_file="${tm_file} sparc/sol2.h" if test x$gnu_ld = xyes; then - tm_file="${tm_file} sparc/sol2-gld.h" + tm_file="${tm_file} sol2-gld.h" fi if test x$gas = xyes; then tm_file="${tm_file} sparc/sol2-gas.h" @@@ -2282,6 -2280,9 +2297,9 @@@ if test x$gas = xyes; then tm_file="${tm_file} sparc/sol2-gas-bi.h" fi + if test x$gas = xyes; then + tm_file="usegas.h ${tm_file}" + fi tm_file="${tm_file} tm-dwarf2.h" tmake_file="$tmake_file sparc/t-sol2-64" test x$with_cpu != x || with_cpu=v9 @@@ -2320,7 -2321,7 +2338,7 @@@ sparc64-*-freebsd*|ultrasparc-*-freebsd esac ;; sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux - tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h linux.h sparc/linux64.h" + tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/gas.h linux.h sparc/linux64.h" extra_options="${extra_options} sparc/long-double-switch.opt" tmake_file="${tmake_file} sparc/t-linux sparc/t-linux64 sparc/t-crtfm" ;; @@@ -2489,7 -2490,10 +2507,10 @@@ if test x$with_cpu = x ; the amdfam10-*|barcelona-*) with_cpu=amdfam10 ;; - k8-*|opteron-*|athlon_64-*) + k8_sse3-*|opteron_sse3-*|athlon64_sse3-*) + with_cpu=k8-sse3 + ;; + k8-*|opteron-*|athlon64-*|athlon_fx-*) with_cpu=k8 ;; athlon_xp-*|athlon_mp-*|athlon_4-*) @@@ -2535,7 -2539,10 +2556,10 @@@ amdfam10-*|barcelona-*) with_cpu=amdfam10 ;; - k8-*|opteron-*|athlon_64-*) + k8_sse3-*|opteron_sse3-*|athlon64_sse3-*) + with_cpu=k8-sse3 + ;; + k8-*|opteron-*|athlon64-*|athlon_fx-*) with_cpu=k8 ;; nocona-*) @@@ -2692,7 -2699,7 +2716,7 @@@ case "${target}" i case "$with_fpu" in "" \ - | fpa | fpe2 | fpe3 | maverick | vfp | vfp3 | neon ) + | fpa | fpe2 | fpe3 | maverick | vfp | vfp3 | vfpv3 | vfpv3-d16 | neon ) # OK ;; *) @@@ -2829,7 -2836,7 +2853,7 @@@ esac # OK ;; - "" | amdfam10 | barcelona | k8 | opteron | athlon64 | athlon-fx | nocona | core2 | generic) + "" | amdfam10 | barcelona | k8-sse3 | opteron-sse3 | athlon64-sse3 | k8 | opteron | athlon64 | athlon-fx | nocona | core2 | generic) # OK ;; *) diff --combined contrib/gcc-4.4/gcc/config/i386/i386.c index f4baaba0e0,2fc0358622..a08ad9dce2 --- a/contrib/gcc-4.4/gcc/config/i386/i386.c +++ b/contrib/gcc-4.4/gcc/config/i386/i386.c @@@ -1,6 -1,6 +1,6 @@@ /* Subroutines used for code generation on IA-32. Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@@ -2358,7 -2358,7 +2358,7 @@@ ix86_target_string (int isa, int flags if (flags && add_nl_p) { opts[num++][0] = target_other; - sprintf (target_other, "(other flags: 0x%x)", isa); + sprintf (target_other, "(other flags: 0x%x)", flags); } /* Add -fpmath= option. */ @@@ -2705,7 -2705,7 +2705,7 @@@ override_options (bool main_args_p prefix, suffix, prefix, suffix, prefix, suffix); if (!ix86_arch_string) - ix86_arch_string = TARGET_64BIT ? "x86-64" : "i386"; + ix86_arch_string = TARGET_64BIT ? "x86-64" : "i486"; else ix86_arch_specified = 1; @@@ -5657,9 -5657,8 +5657,8 @@@ function_arg_advance_64 (CUMULATIVE_ARG if (!named && VALID_AVX256_REG_MODE (mode)) return; - if (!examine_argument (mode, type, 0, &int_nregs, &sse_nregs)) - cum->words += words; - else if (sse_nregs <= cum->sse_nregs && int_nregs <= cum->nregs) + if (examine_argument (mode, type, 0, &int_nregs, &sse_nregs) + && sse_nregs <= cum->sse_nregs && int_nregs <= cum->nregs) { cum->nregs -= int_nregs; cum->sse_nregs -= sse_nregs; @@@ -5667,7 -5666,11 +5666,11 @@@ cum->sse_regno += sse_nregs; } else - cum->words += words; + { + int align = ix86_function_arg_boundary (mode, type) / BITS_PER_WORD; + cum->words = (cum->words + align - 1) & ~(align - 1); + cum->words += words; + } } static void @@@ -5996,7 -5999,7 +5999,7 @@@ ix86_pass_by_reference (CUMULATIVE_ARG /* Return true when TYPE should be 128bit aligned for 32bit argument passing ABI. */ static bool - contains_aligned_value_p (tree type) + contains_aligned_value_p (const_tree type) { enum machine_mode mode = TYPE_MODE (type); if (((TARGET_SSE && SSE_REG_MODE_P (mode)) @@@ -6046,7 -6049,7 +6049,7 @@@ specified mode and type. */ int - ix86_function_arg_boundary (enum machine_mode mode, tree type) + ix86_function_arg_boundary (enum machine_mode mode, const_tree type) { int align; if (type) @@@ -6362,12 -6365,12 +6365,12 @@@ ix86_return_in_memory (const_tree type } /* Return false iff TYPE is returned in memory. This version is used - on Solaris 10. It is similar to the generic ix86_return_in_memory, + on Solaris 2. It is similar to the generic ix86_return_in_memory, but differs notably in that when MMX is available, 8-byte vectors are returned in memory, rather than in MMX registers. */ bool - ix86_sol10_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) + ix86_solaris_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) { int size; enum machine_mode mode = type_natural_mode (type, NULL); @@@ -6588,6 -6591,10 +6591,10 @@@ setup_incoming_varargs_64 (CUMULATIVE_A if (ix86_varargs_fpr_size) { + /* Stack must be aligned to 16byte for FP register save area. */ + if (crtl->stack_alignment_needed < 128) + crtl->stack_alignment_needed = 128; + /* Now emit code to save SSE registers. The AX parameter contains number of SSE parameter registers used to call this function. We use sse_prologue_save insn template that produces computed jump across @@@ -8280,13 -8287,10 +8287,10 @@@ ix86_expand_prologue (void GEN_INT (-allocate), -1); else { - /* Only valid for Win32. */ rtx eax = gen_rtx_REG (Pmode, AX_REG); bool eax_live; rtx t; - gcc_assert (!TARGET_64BIT || cfun->machine->call_abi == MS_ABI); - if (cfun->machine->call_abi == MS_ABI) eax_live = false; else @@@ -8675,10 -8679,12 +8679,12 @@@ ix86_expand_epilogue (int style int param_ptr_offset = (call_used_regs[REGNO (crtl->drap_reg)] ? 0 : UNITS_PER_WORD); gcc_assert (stack_realign_drap); - emit_insn ((*ix86_gen_add3) (stack_pointer_rtx, - crtl->drap_reg, - GEN_INT (-(UNITS_PER_WORD - + param_ptr_offset)))); + emit_insn (gen_rtx_SET + (VOIDmode, stack_pointer_rtx, + gen_rtx_PLUS (Pmode, + crtl->drap_reg, + GEN_INT (-(UNITS_PER_WORD + + param_ptr_offset))))); if (!call_used_regs[REGNO (crtl->drap_reg)]) emit_insn ((*ix86_gen_pop1) (crtl->drap_reg)); @@@ -8878,8 -8884,7 +8884,7 @@@ ix86_decompose_address (rtx addr, struc to test cfun for being non-NULL. */ if (TARGET_K6 && cfun && optimize_function_for_speed_p (cfun) && base_reg && !index_reg && !disp - && REG_P (base_reg) - && REGNO_REG_CLASS (REGNO (base_reg)) == SIREG) + && REG_P (base_reg) && REGNO (base_reg) == SI_REG) disp = const0_rtx; /* Special case: encode reg+reg instead of reg*2. */ @@@ -10379,7 -10384,7 +10384,7 @@@ i386_output_dwarf_dtprel (FILE *file, i static bool ix86_pic_register_p (rtx x) { - if (GET_CODE (x) == VALUE) + if (GET_CODE (x) == VALUE && CSELIB_VAL_PTR (x)) return (pic_offset_table_rtx && rtx_equal_for_cselib_p (x, pic_offset_table_rtx)); else @@@ -10823,7 -10828,6 +10828,6 @@@ get_some_local_dynamic_name (void L,W,B,Q,S,T -- print the opcode suffix for specified size of operand. C -- print opcode suffix for set/cmov insn. c -- like C, but print reversed condition - E,e -- likewise, but for compare-and-branch fused insn. F,f -- likewise, but for floating-point. O -- if HAVE_AS_IX86_CMOV_SUN_SYNTAX, expand to "w.", "l." or "q.", otherwise nothing @@@ -11180,14 -11184,6 +11184,6 @@@ print_operand (FILE *file, rtx x, int c put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 1, 1, file); return; - case 'E': - put_condition_code (GET_CODE (x), CCmode, 0, 0, file); - return; - - case 'e': - put_condition_code (GET_CODE (x), CCmode, 1, 0, file); - return; - case 'H': /* It doesn't actually matter what mode we use here, as we're only going to use this for printing. */ @@@ -11285,10 -11281,8 +11281,8 @@@ return; case ';': - #if TARGET_MACHO - fputs (" ; ", file); - #else - fputc (' ', file); + #if TARGET_MACHO || !HAVE_AS_IX86_REP_LOCK_PREFIX + fputs (";", file); #endif return; @@@ -11313,13 -11307,14 +11307,14 @@@ case 2: size = "WORD"; break; case 4: size = "DWORD"; break; case 8: size = "QWORD"; break; - case 12: size = "XWORD"; break; + case 12: size = "TBYTE"; break; case 16: if (GET_MODE (x) == XFmode) - size = "XWORD"; + size = "TBYTE"; else size = "XMMWORD"; break; + case 32: size = "YMMWORD"; break; default: gcc_unreachable (); } @@@ -15674,8 -15669,9 +15669,9 @@@ ix86_expand_int_vcond (rtx operands[] } } - /* Unsigned parallel compare is not supported by the hardware. Play some - tricks to turn this into a signed comparison against 0. */ + /* Unsigned parallel compare is not supported by the hardware. + Play some tricks to turn this into a signed comparison + against 0. */ if (code == GTU) { cop0 = force_reg (mode, cop0); @@@ -15684,32 -15680,26 +15680,26 @@@ { case V4SImode: case V2DImode: - { - rtx t1, t2, mask; - - /* Perform a parallel modulo subtraction. */ - t1 = gen_reg_rtx (mode); - emit_insn ((mode == V4SImode - ? gen_subv4si3 - : gen_subv2di3) (t1, cop0, cop1)); - - /* Extract the original sign bit of op0. */ - mask = ix86_build_signbit_mask (GET_MODE_INNER (mode), - true, false); - t2 = gen_reg_rtx (mode); - emit_insn ((mode == V4SImode - ? gen_andv4si3 - : gen_andv2di3) (t2, cop0, mask)); - - /* XOR it back into the result of the subtraction. This results - in the sign bit set iff we saw unsigned underflow. */ - x = gen_reg_rtx (mode); - emit_insn ((mode == V4SImode - ? gen_xorv4si3 - : gen_xorv2di3) (x, t1, t2)); - - code = GT; - } + { + rtx t1, t2, mask; + rtx (*gen_sub3) (rtx, rtx, rtx); + + /* Subtract (-(INT MAX) - 1) from both operands to make + them signed. */ + mask = ix86_build_signbit_mask (GET_MODE_INNER (mode), + true, false); + gen_sub3 = (mode == V4SImode + ? gen_subv4si3 : gen_subv2di3); + t1 = gen_reg_rtx (mode); + emit_insn (gen_sub3 (t1, cop0, mask)); + + t2 = gen_reg_rtx (mode); + emit_insn (gen_sub3 (t2, cop1, mask)); + + cop0 = t1; + cop1 = t2; + code = GT; + } break; case V16QImode: @@@ -15719,6 -15709,8 +15709,8 @@@ emit_insn (gen_rtx_SET (VOIDmode, x, gen_rtx_US_MINUS (mode, cop0, cop1))); + cop0 = x; + cop1 = CONST0_RTX (mode); code = EQ; negate = !negate; break; @@@ -15726,9 -15718,6 +15718,6 @@@ default: gcc_unreachable (); } - - cop0 = x; - cop1 = CONST0_RTX (mode); } } @@@ -20631,6 -20620,7 +20620,7 @@@ def_builtin (int mask, const char *name { ix86_builtins_isa[(int) code].isa = mask; + mask &= ~OPTION_MASK_ISA_64BIT; if ((mask & ix86_isa_flags) != 0 || (lang_hooks.builtin_function == lang_hooks.builtin_function_ext_scope)) @@@ -26850,7 -26840,7 +26840,7 @@@ x86_function_profiler (FILE *file, int if (TARGET_64BIT) { #ifndef NO_PROFILE_COUNTERS - fprintf (file, "\tleaq\t%sP%d@(%%rip),%%r11\n", LPREFIX, labelno); + fprintf (file, "\tleaq\t%sP%d(%%rip),%%r11\n", LPREFIX, labelno); #endif if (DEFAULT_ABI == SYSV_ABI && flag_pic) @@@ -28742,13 -28732,9 +28732,13 @@@ ix86_mangle_type (const_tree type static tree ix86_stack_protect_fail (void) { +#if 0 /* XXX swildner */ return TARGET_64BIT ? default_external_stack_protect_fail () : default_hidden_stack_protect_fail (); +#else + return default_external_stack_protect_fail (); +#endif } /* Select a format to encode pointers in exception handling data. CODE @@@ -29484,8 -29470,7 +29474,8 @@@ ix86_sse5_valid_op_p (rtx operands[], r For the integer multiply/add instructions be more restrictive and require operands[2] and operands[3] to be the memory operands. */ if (commutative) - return (mem_mask == ((1 << 1) | (1 << 3)) || ((1 << 2) | (1 << 3))); + return (mem_mask == ((1 << 1) | (1 << 3)) || + mem_mask == ((1 << 2) | (1 << 3))); else return (mem_mask == ((1 << 2) | (1 << 3))); } diff --combined contrib/gcc-4.4/gcc/tree-inline.c index 6f1533edfd,29fef96f77..e85e148f95 --- a/contrib/gcc-4.4/gcc/tree-inline.c +++ b/contrib/gcc-4.4/gcc/tree-inline.c @@@ -1737,12 -1737,13 +1737,13 @@@ copy_phis_for_bb (basic_block bb, copy_ edge_iterator ei; gimple phi; gimple_stmt_iterator si; + edge new_edge; + bool inserted = false; for (si = gsi_start (phi_nodes (bb)); !gsi_end_p (si); gsi_next (&si)) { tree res, new_res; gimple new_phi; - edge new_edge; phi = gsi_stmt (si); res = PHI_RESULT (phi); @@@ -1771,12 -1772,18 +1772,18 @@@ { gimple_seq stmts = NULL; new_arg = force_gimple_operand (new_arg, &stmts, true, NULL); - gsi_insert_seq_on_edge_immediate (new_edge, stmts); + gsi_insert_seq_on_edge (new_edge, stmts); + inserted = true; } add_phi_arg (new_phi, new_arg, new_edge); } } } + + /* Commit the delayed edge insertions. */ + if (inserted) + FOR_EACH_EDGE (new_edge, ei, new_bb->preds) + gsi_commit_one_edge_insert (new_edge, NULL); } @@@ -2729,6 -2736,8 +2736,8 @@@ estimate_move_cost (tree type { HOST_WIDE_INT size; + gcc_assert (!VOID_TYPE_P (type)); + size = int_size_in_bytes (type); if (size < 0 || size > MOVE_MAX_PIECES * MOVE_RATIO (!optimize_size)) @@@ -2980,7 -2989,8 +2989,8 @@@ estimate_num_insns (gimple stmt, eni_we { tree t; for (t = TYPE_ARG_TYPES (funtype); t; t = TREE_CHAIN (t)) - cost += estimate_move_cost (TREE_VALUE (t)); + if (!VOID_TYPE_P (TREE_VALUE (t))) + cost += estimate_move_cost (TREE_VALUE (t)); } else { @@@ -3249,8 -3259,7 +3259,8 @@@ expand_call_inline (basic_block bb, gim && strlen (reason) && !lookup_attribute ("noinline", DECL_ATTRIBUTES (fn)) /* Avoid warnings during early inline pass. */ - && cgraph_global_info_ready) + && cgraph_global_info_ready + && strcmp(reason, "call is unlikely and code size would grow")) { warning (OPT_Winline, "inlining failed in call to %q+F: %s", fn, reason); @@@ -4269,6 -4278,46 +4279,46 @@@ tree_versionable_function_p (tree fndec return true; } + /* Delete all unreachable basic blocks and update callgraph. + Doing so is somewhat nontrivial because we need to update all clones and + remove inline function that become unreachable. */ + + static bool + delete_unreachable_blocks_update_callgraph (copy_body_data *id) + { + bool changed = false; + basic_block b, next_bb; + + find_unreachable_blocks (); + + /* Delete all unreachable basic blocks. */ + + for (b = ENTRY_BLOCK_PTR->next_bb; b != EXIT_BLOCK_PTR; b = next_bb) + { + next_bb = b->next_bb; + + if (!(b->flags & BB_REACHABLE)) + { + gimple_stmt_iterator bsi; + + for (bsi = gsi_start_bb (b); !gsi_end_p (bsi); gsi_next (&bsi)) + if (gimple_code (gsi_stmt (bsi)) == GIMPLE_CALL) + { + struct cgraph_edge *e; + + if ((e = cgraph_edge (id->dst_node, gsi_stmt (bsi))) != NULL) + cgraph_remove_edge (e); + } + delete_basic_block (b); + changed = true; + } + } + + if (changed) + tidy_fallthru_edges (); + return changed; + } + /* Create a copy of a function's tree. OLD_DECL and NEW_DECL are FUNCTION_DECL tree nodes of the original function and the new copied function @@@ -4443,7 -4492,7 +4493,7 @@@ tree_function_versioning (tree old_decl free_dominance_info (CDI_DOMINATORS); free_dominance_info (CDI_POST_DOMINATORS); if (!update_clones) - delete_unreachable_blocks (); + delete_unreachable_blocks_update_callgraph (&id); update_ssa (TODO_update_ssa); if (!update_clones) {