Commit Graph

112249 Commits

Author SHA1 Message Date
Andi Kleen dde8b3609b Change random seeds to 64bit and drop re-crcing
I had some trouble with random build failures in a large LTO project
and it turned out to be random seed collisions in a highly parallel build
(thanks to Honza for suggesting that)

There were multiple problems:
- The way to generate the random seed is not very random (milliseconds time plus pid)
and prone to collisions on highly parallel builds
- It's only 32bit
- Several users take the existing ascii seed and re-CRC32 it again, which
doesn't exactly improve it.

This patch changes that to:
- Always use 64bit seeds as numbers (no re-crcing)
- Change all users to use HOST_WIDE_INT
- When the user specifies a random seed it's still crc32ed, but only in
this case.

Passes bootstrap + testsuite on x86_64-linux.

gcc/cp:

2011-09-26   Andi Kleen <ak@linux.intel.com>

	* repo.c (finish_repo): Use HOST_WIDE_INT_PRINT_HEX_PURE.

gcc/:

2011-09-26   Andi Kleen <ak@linux.intel.com>

	* hwint.h (HOST_WIDE_INT_PRINT_HEX_PURE): Add.
	* lto-streamer.c (lto_get_section_name): Remove crc32_string.
 	Handle numerical random seed.
	* lto-streamer.h (lto_file_decl_data): Change id to unsigned HOST_WIDE_INT.
	* toplev.c (random_seed): Add.
	(init_random_seed): Change for numerical random seed.
	(get_random_seed): Return as HOST_WIDE_INT.
	(set_random_seed): Crc32 existing string.
	* toplev.h (get_random_seed): Change to numercal return.
	* tree.c (get_file_function_name): Remove CRC. Handle numerical random seed.

gcc/lto/:

2011-09-26   Andi Kleen <ak@linux.intel.com>

	* lto.c (lto_resolution_read): Remove id dumping.
	(lto_section_with_id): Turn id HOST_WIDE_ID.
	(create_subid_section_table): Dito.

From-SVN: r179347
2011-09-29 13:14:51 +00:00
Janus Weil 4056cc1ba5 re PR fortran/50547 (dummy procedure argument of PURE shall be PURE)
2011-09-29  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/50547
	* resolve.c (resolve_formal_arglist): Fix pureness check for dummy
	functions.

	PR fortran/50553
	* symbol.c (check_conflict): Forbid TARGET attribute for statement
	functions.


2011-09-29  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/50547
	* gfortran.dg/pure_formal_proc_3.f90: New.

	PR fortran/50553
	* gfortran.dg/stfunc_7.f90: New.

From-SVN: r179345
2011-09-29 13:57:35 +02:00
Georg-Johann Lay 6c7dfafee6 re PR target/50566 ([avr]: Add support for better logging similar to -mdeb)
PR target/50566
	* config.gcc (extra_objs): Add avr-log.o for $target in:
	avr-*-rtems*, avr-*-*.
	* config/avr/t-avr (avr-log.o): New rule to compile...
	* config/avr/avr-log.c: ...this new file.
	* config/avr/avr.opt (mlog=): New option.
	* config/avr/avr-protos.h (avr_edump, avr_fdump): New macros.
	(avr_log_set_caller_e, avr_log_set_caller_f): New prototypes.
	(avr_log_set_avr_log): New prototype.
	(avr_log_t): New typedef.
	(avr_log): New declaration.
	* config/avr/avr.c (avr_option_override): Call avr_log_set_avr_log.

From-SVN: r179344
2011-09-29 11:51:59 +00:00
Jan Beulich aec7773c94 The commands of the $(TOOLS_ZIP) rule include copying of two subtrees from the source tree (asm/ and classes/).
The commands of the $(TOOLS_ZIP) rule include copying of two subtrees from the
source tree (asm/ and classes/). If the source tree is read-only, the use of
cp's -p option here prevents the trees from getting deleted later in the rule
if they (or at least their directories) don't get marked writable.

Committed as obvious.

libjava/classpath/
2011-09-29  Jan Beulich  <jbeulich@suse.com>

	* tools/Makefile.am (TOOLS_ZIP): Make writable the copied subtrees
	asm/ and classes/.
	* tools/Makefile.in: Re-generate.

From-SVN: r179343
2011-09-29 11:37:47 +00:00
Artjoms Sinkarovs d246ab4f57 expr.c (do_store_flag): Expand vector comparison by building an appropriate VEC_COND_EXPR.
2011-09-29  Artjoms Sinkarovs <artyom.shinkaroff@gmail.com>

	* expr.c (do_store_flag): Expand vector comparison by
	building an appropriate VEC_COND_EXPR.
	* c-typeck.c (build_binary_op): Typecheck vector comparisons.
	(c_objc_common_truthvalue_conversion): Adjust.
	* tree-vect-generic.c (do_compare): Helper function.
	(expand_vector_comparison): Check if hardware supports
	vector comparison of the given type or expand vector
	piecewise.
	(expand_vector_operation): Treat comparison as binary
	operation of vector type.
	(expand_vector_operations_1): Adjust.

	* gcc.c-torture/execute/vector-compare-1.c: New testcase.
	* gcc.c-torture/execute/vector-compare-2.c: Likewise.
	* gcc.dg/vector-compare-1.c: Likewise.
	* gcc.dg/vector-compare-2.c: Likewise.

From-SVN: r179342
2011-09-29 11:29:03 +00:00
Richard Guenther 7c99ecef0b tree.c (build_opaque_vector_type): Make opaque vectors variant types of the corresponding non-opaque type.
2011-09-29  Richard Guenther  <rguenther@suse.de>

	* tree.c (build_opaque_vector_type): Make opaque vectors
	variant types of the corresponding non-opaque type.  Make
	sure to share opaque vector types properly.

From-SVN: r179341
2011-09-29 11:26:46 +00:00
Uros Bizjak 9b0c720280 ChangeLog: Fix whitespace.
* ChangeLog: Fix whitespace.
	* testsuite/ChangeLog: Ditto.

From-SVN: r179338
2011-09-29 11:04:03 +02:00
David S. Miller 580bd5005b Remove unnecessary sparc code attr.
* config/sparc/sparc.md (gcond_name): Delete unnecessary code attr.
	(VIS pixel-compare insn): Just use <gcond:name>.

From-SVN: r179335
2011-09-29 00:56:05 -07:00
David S. Miller 1ec01ab2fb Add sparc 3D array addressing VIS intrinsics.
gcc/

	* config/sparc/sparc.md (UNSPEC_ARRAY8, UNSPEC_ARRAY16,
	UNSPEC_ARRAY32): New unspec.
	(define_attr type): New type 'array'.
	(array{8,16,32}<P:mode>_vis): New patterns.
	* config/sparc/ultra1_2.md: Add reservations for 'array'.
	* config/sparc/ultra3.md: Likewise.
	* config/sparc/niagara.md: Likewise.
	* config/sparc/niagara2.md: Likewise.
	* config/sparc/sparc.c (sparc_vis_init_builtins): Build new
	array builtins.
	* config/sparc/visintrin.h (__vis_array8, __vis_array16,
	__vis_array32): New.
	* doc/extend.texi: Document new VIS builtins.

gcc/testsuite/

	* gcc.target/sparc/array.c: New test.

From-SVN: r179334
2011-09-29 00:35:16 -07:00
Iain Sandoe 8f931effca darwin9.h (STACK_CHECK_STATIC_BUILTIN): Enable for Darwin >= 9.
gcc:

	* config/darwin9.h (STACK_CHECK_STATIC_BUILTIN): Enable for
	Darwin >= 9.

From-SVN: r179332
2011-09-29 07:17:42 +00:00
Jiangning Liu 655cd20f9d predcom-1.c: Explicitly turn on loop unroll and set max unroll times to 8.
2011-09-29  Jiangning Liu  <jiangning.liu@arm.com>

	* gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c: Explicitly turn on
	loop unroll and set max unroll times to 8.
	* gcc/testsuite/gcc.dg/tree-ssa/predcom-2.c: Likewise.
	* gcc/testsuite/gcc.dg/tree-ssa/predcom-3.c: Likewise.
	* gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c: Likewise.
	* gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c: Likewise.

From-SVN: r179330
2011-09-29 06:48:26 +00:00
David S. Miller b330423519 Respin sparc pixel-compare patterns using iterators.
* config/sparc/sparc.md (UNSPEC_FCMPLE, UNSPEC_FCMPNE,
	UNSPEC_FCMPGT, UNSPEC_FCMPEQ): Delete and reduce to...
	(UNSPEC_FCMP): New unspec.
	(gcond): New code iterator.
	(gcond_name): New code attr.
	(GCM): New mode iterator.
	(gcm_name): New mode attr.
	(fcmp{le,ne,gt,eq}{16,32}_vis): Reimplement using iterators.

From-SVN: r179329
2011-09-28 20:52:00 -07:00
GCC Administrator bdcf918b31 Daily bump.
From-SVN: r179327
2011-09-29 00:18:27 +00:00
Paolo Carlini 48ec150246 re PR c++/40145 (structure inside a static function is exported, producing warning)
2011-09-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/40145
	* g++.dg/ext/visibility/warn5.C: New.

From-SVN: r179323
2011-09-28 23:14:04 +00:00
Paolo Carlini 6f94398e39 re PR c++/45278 (-Wextra doesn't warn about (pointer < 0 ).)
/cp
2011-09-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/45278
	* typeck.c (cp_build_binary_op): With -Wextra, warn for ordered
	comparison of pointer with zero.

/testsuite
2011-09-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/45278
	* g++.dg/warn/Wextra-3.C: New.

From-SVN: r179321
2011-09-28 22:04:48 +00:00
Oleg Endo 39f2bcb5e1 re PR bootstrap/49486 (Bootstrap failure)
PR target/49486
	* config/sh/sh.md (negdi2): Move expansion into split to
	allow more combination options.  Add T_REG clobber.
	(abssi2): New expander.
	(*negdi2, *abssi2, *negabssi2): New insns.
	(cneg): Change from insn to insn_and_split.  Rename to
	negsi_cond.  Add alternative for non-SH4.
	* gcc.target/sh/pr49468-si.c: New.

From-SVN: r179320
2011-09-28 21:43:01 +00:00
Doug Evans 8c850a5a7f timeval-utils.h: New file.
include/
	* timeval-utils.h: New file.

	libiberty/
	* timeval-utils.c: New file.
	* Makefile.in (CFILES): Add it.
	(REQUIRED_OFILES): Add timeval-utils.$(objext).
	(INSTALLED_HEADERS): Add timeval-utils.h.
	(timeval-utils.$(objext)): Add rule.

From-SVN: r179319
2011-09-28 19:09:50 +00:00
Doug Evans be50fcea4e libiberty.h (countargv): Declare.
include/
	* libiberty.h (countargv): Declare.

	libiberty/
	* argv.c (countargv): New function.

From-SVN: r179318
2011-09-28 19:04:30 +00:00
Richard Sandiford d92aed0647 neon.md (neon_move_lo_quad_<mode>): Delete.
gcc/
	* config/arm/neon.md (neon_move_lo_quad_<mode>): Delete.
	(neon_move_hi_quad_<mode>): Likewise.
	(move_hi_quad_<mode>, move_lo_quad_<mode>): Use subreg moves.

From-SVN: r179316
2011-09-28 15:00:10 +00:00
Nick Clifton 783465f8e3 predicates.md (rx_minmax_operand): New predicate.
* config/rx/predicates.md (rx_minmax_operand): New predicate.
	Accepts immediates and a restricted subset of MEMs.
	* config/rx/rx.md (int_modes): New iterator.
	(smaxsi3, sminsi3): Delete and replace with...
	(smax<int_mode>3, smin<int_mode>3): New patterns.
	(umax<>3_u, umax<>3_ur, umax<>3, umin<>3): New patterns.

From-SVN: r179315
2011-09-28 14:37:30 +00:00
Nick Clifton 2996d8c332 rx-lib.h: Always restrict doubles to the SF type when 64-bit doubles are not enabled.
* config/rx/rx-lib.h: Always restrict doubles to the SF type when
	64-bit doubles are not enabled.
	* config/rx/rx-abi.h: Fix extraneous renaming of the floatsisf
	and floatunsisf functions.

From-SVN: r179314
2011-09-28 13:56:19 +00:00
Richard Guenther 206c3e102a re PR middle-end/50460 (__builtin___strcpy_chk/__builtin_object_size don't work)
2011-09-28  Richard Guenther  <rguenther@suse.de>

	PR middle-end/50460
	* fold-const.c (try_move_mult_to_index): Handle &a.array the
	same as &a.array[0].

From-SVN: r179313
2011-09-28 13:47:12 +00:00
Ian Lance Taylor fbfb84e623 mksysinfo: #include <ttold.h> on Irix.
From Rainer Orth.

From-SVN: r179312
2011-09-28 13:14:11 +00:00
Tom de Vries 9415cfddab re PR testsuite/50485 (gcc.target/i386/sse4_1-blendps.c fails spuriously on i686)
2011-09-28  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/50485
	* gcc.target/i386/sse4_1-blendps.c: Include <stdlib.h>.
	(TEST): Initialize src3 with random floats.
	* gcc.target/i386/sse4_1-blendps-2.c (sse4_1_test): Remove field i from
	union src3.  Initialize src3 with random floats.

From-SVN: r179309
2011-09-28 08:48:00 +00:00
Kai Tietz 08c71c82b8 configure.ac: Add test for new section attribute specifier "e" via define...
* configure.ac: Add test for new section attribute
	specifier "e" via define HAVE_GAS_SECTION_EXCLUDE.
	* config.in: Regenerated.
	* configure: Regenerated.
	* config/i386/winnt.c (i386_pe_asm_named_section): Emit
	new section flag "e" for excluded sections, if supported.
	Otherwise we mark section withc SECTION_EXCLUDE flag
	as never-load.

From-SVN: r179308
2011-09-28 10:07:39 +02:00
Benjamin Kosnik 5e3a0ed1a7 *: Regenerate.
2011-09-27  Benjamin Kosnik  <bkoz@redhat.com>

	* doc/html/*: Regenerate.

	* doc/Makefile.am: Un-nest the ext output directory.
	* doc/Makefile.in: Regenerate.
	* spine.xml: Remove authors, add abstract for short
	contents. Rename to index.html for html output.
	* manual/spine.xml: Authors here, manual starts with index.html.
	* api.xml: Update.
	* faq.xml: Same.

Co-Authored-By: Jonathan Wakely <jwakely.gcc@gmail.com>

From-SVN: r179304
2011-09-28 01:37:10 +00:00
GCC Administrator 78a7cbccbd Daily bump.
From-SVN: r179302
2011-09-28 00:18:32 +00:00
Richard Sandiford f18d1d16c3 m32r.md: Use match_test rather than eq/ne symbol_ref throughout file.
gcc/
	* config/m32r/m32r.md: Use match_test rather than eq/ne symbol_ref
	throughout file.

From-SVN: r179297
2011-09-27 23:04:14 +00:00
Richard Sandiford b4d58803b1 iq2000.md: Use match_test rather than eq/ne symbol_ref throughout file.
gcc/
	* config/iq2000/iq2000.md: Use match_test rather than eq/ne symbol_ref
	throughout file.

From-SVN: r179296
2011-09-27 23:03:57 +00:00
Oleg Endo 88778f1576 mfmovd.c: Extend list of supported targets.
* gcc.target/sh/mfmovd.c: Extend list of supported targets.
	* gcc.target/sh/struct-arg-dw2.c: Fix typo.
	* gcc.target/sh/sh4a-sincos.c: Make test SH4A only.
	* gcc.target/sh/sh4a-sincosf.c: Ditto.
	* gcc.target/sh/sh4a-cos.c: Ditto.
	* gcc.target/sh/sh4a-cosf.c: Ditto.
	* gcc.target/sh/sh4a-sin.c: Ditto.
	* gcc.target/sh/sh4a-sinf.c: Ditto.
	* gcc.target/sh/sh4a-fsrra.c: Ditto.
	* gcc.target/sh/sh4a-memmovua.c: Ditto.
	* gcc.target/sh/sh4a-bitmovua.c: Ditto.

From-SVN: r179295
2011-09-27 22:46:00 +00:00
Paolo Carlini 2427db200d re PR c++/31489 (error says struct when it should say class)
/cp
2011-09-27  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/31489
	* parser.c (cp_parser_elaborated_type_specifier): For RECORD_TYPE,
	set CLASSTYPE_DECLARED_CLASS.

/testsuite
2011-09-27  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/31489
	* g++.dg/parse/error40.C: New.
	* g++.dg/warn/incomplete1.C: Adjust.

From-SVN: r179293
2011-09-27 21:52:19 +00:00
Jakub Jelinek 82aa872231 trans-types.c (gfc_type_for_size): Return wider type if no suitable narrower type has been found.
* trans-types.c (gfc_type_for_size): Return wider type
	if no suitable narrower type has been found.
	(gfc_type_for_mode): Return NULL_TREE if gfc_type_for_size
	returned type doesn't have expected TYPE_MODE.

From-SVN: r179290
2011-09-27 21:17:31 +02:00
Sriraman Tallam 4c345757e0 output.h (SECTION_EXCLUDE): New macro.
2011-09-27  Sriraman Tallam  <tmsriram@google.com>

	* output.h (SECTION_EXCLUDE): New macro.
	* varasm.c (default_elf_asm_named_section): Check for
	SECTION_EXCLUDE.

From-SVN: r179288
2011-09-27 17:52:13 +00:00
Richard Sandiford 8e8af9b74d fwprop.c (forward_propagate_and_simplify): After checking reg/subreg combinations, check whether the modes are the same.
gcc/
	* fwprop.c (forward_propagate_and_simplify): After checking
	reg/subreg combinations, check whether the modes are the same.

From-SVN: r179287
2011-09-27 17:24:03 +00:00
Bernd Schmidt a744996112 mips.c (mips_add_cfa_restore): New function.
gcc/
2011-09-25  Bernd Schmidt  <bernds@codesourcery.com>
	    Richard Sandiford  <rdsandiford@googlemail.com>

	* config/mips/mips.c (mips_add_cfa_restore): New function.
	(mips16e_save_restore_reg): Use it.
	(mips_restore_reg): Likewise.  Split double FPRs for
	REG_CFA_RESTORE notes.

Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com>

From-SVN: r179286
2011-09-27 17:23:27 +00:00
Richard Sandiford 58ac64596a re PR libgomp/50386 (libgomp.h:87:5: error: unnamed struct/union that defines no instances)
gcc/
	PR middle-end/50386
	PR middle-end/50326
	* tree-sra.c (build_ref_for_model): Use the type of the field as
	the type of the COMPONENT_REF.

From-SVN: r179285
2011-09-27 17:18:22 +00:00
Jeff Law 16a275d29d ifcvt.c (cheap_bb_rtx_cost_p): Add SCALE argument.
* ifcvt.c (cheap_bb_rtx_cost_p): Add SCALE argument.  Scale
	non-jumping insns by REG_BR_PROB_BASE and the maximum cost
	by SCALE.
	(find_if_case_1): Use the probability of the THEN clause when
	determining if speculation is profitable.
	(find_if_case_2): Similarly for the ELSE clause.

From-SVN: r179284
2011-09-27 10:49:17 -06:00
Jan Hubicka 9b7ab6d6e0 re PR middle-end/49463 (LTO doesn't work symbol renamed via asm statement)
PR middle-end/49463
	* gcc.c-torture/execute/builtins/strstr-asm-lib.c
	(my_strstr): Mark used.

From-SVN: r179280
2011-09-27 16:28:24 +00:00
Jakub Jelinek d88780319e common.opt: Add -foptimize-strlen option.
* common.opt: Add -foptimize-strlen option.
	* Makefile.in (OBJS): Add tree-ssa-strlen.o.
	(tree-sssa-strlen.o): Add dependencies.
	* opts.c (default_options_table): Enable -foptimize-strlen
	by default at -O2 if not -Os.
	* passes.c (init_optimization_passes): Add pass_strlen
	after pass_object_sizes.
	* timevar.def (TV_TREE_STRLEN): New timevar.
	* params.def (PARAM_MAX_TRACKED_STRLENS): New parameter.
	* tree-pass.h (pass_strlen): Declare.
	* tree-ssa-strlen.c: New file.
	* c-decl.c (merge_decls): If compatible stpcpy prototype
	is seen, set implicit_built_in_decls[BUILT_IN_STPCPY].
cp/
	* decl.c (duplicate_decls): If compatible stpcpy prototype
	is seen, set implicit_built_in_decls[BUILT_IN_STPCPY].
testsuite/
	* gcc.dg/strlenopt-1.c: New test.
	* gcc.dg/strlenopt-1f.c: New test.
	* gcc.dg/strlenopt-2.c: New test.
	* gcc.dg/strlenopt-2f.c: New test.
	* gcc.dg/strlenopt-3.c: New test.
	* gcc.dg/strlenopt-4.c: New test.
	* gcc.dg/strlenopt-4g.c: New test.
	* gcc.dg/strlenopt-4gf.c: New test.
	* gcc.dg/strlenopt-5.c: New test.
	* gcc.dg/strlenopt-6.c: New test.
	* gcc.dg/strlenopt-7.c: New test.
	* gcc.dg/strlenopt-8.c: New test.
	* gcc.dg/strlenopt-9.c: New test.
	* gcc.dg/strlenopt-10.c: New test.
	* gcc.dg/strlenopt-11.c: New test.
	* gcc.dg/strlenopt-12.c: New test.
	* gcc.dg/strlenopt-12g.c: New test.
	* gcc.dg/strlenopt-13.c: New test.
	* gcc.dg/strlenopt-14g.c: New test.
	* gcc.dg/strlenopt-14gf.c: New test.
	* gcc.dg/strlenopt-15.c: New test.
	* gcc.dg/strlenopt-16g.c: New test.
	* gcc.dg/strlenopt-17g.c: New test.
	* gcc.dg/strlenopt-18g.c: New test.
	* gcc.dg/strlenopt.h: New file.

From-SVN: r179279
2011-09-27 18:18:49 +02:00
Jakub Jelinek 19ecbcbcbf common.opt: Add -foptimize-strlen option.
* common.opt: Add -foptimize-strlen option.
	* Makefile.in (OBJS): Add tree-ssa-strlen.o.
	(tree-sssa-strlen.o): Add dependencies.
	* opts.c (default_options_table): Enable -foptimize-strlen
	by default at -O2 if not -Os.
	* passes.c (init_optimization_passes): Add pass_strlen
	after pass_object_sizes.
	* timevar.def (TV_TREE_STRLEN): New timevar.
	* params.def (PARAM_MAX_TRACKED_STRLENS): New parameter.
	* tree-pass.h (pass_strlen): Declare.
	* tree-ssa-strlen.c: New file.
	* c-decl.c (merge_decls): If compatible stpcpy prototype
	is seen, set implicit_built_in_decls[BUILT_IN_STPCPY].
cp/
	* decl.c (duplicate_decls): If compatible stpcpy prototype
	is seen, set implicit_built_in_decls[BUILT_IN_STPCPY].
testsuite/
	* gcc.dg/strlenopt-1.c: New test.
	* gcc.dg/strlenopt-1f.c: New test.
	* gcc.dg/strlenopt-2.c: New test.
	* gcc.dg/strlenopt-2f.c: New test.
	* gcc.dg/strlenopt-3.c: New test.
	* gcc.dg/strlenopt-4.c: New test.
	* gcc.dg/strlenopt-4g.c: New test.
	* gcc.dg/strlenopt-4gf.c: New test.
	* gcc.dg/strlenopt-5.c: New test.
	* gcc.dg/strlenopt-6.c: New test.
	* gcc.dg/strlenopt-7.c: New test.
	* gcc.dg/strlenopt-8.c: New test.
	* gcc.dg/strlenopt-9.c: New test.
	* gcc.dg/strlenopt-10.c: New test.
	* gcc.dg/strlenopt-11.c: New test.
	* gcc.dg/strlenopt-12.c: New test.
	* gcc.dg/strlenopt-12g.c: New test.
	* gcc.dg/strlenopt-13.c: New test.
	* gcc.dg/strlenopt-14g.c: New test.
	* gcc.dg/strlenopt-14gf.c: New test.
	* gcc.dg/strlenopt-15.c: New test.
	* gcc.dg/strlenopt-16g.c: New test.
	* gcc.dg/strlenopt-17g.c: New test.
	* gcc.dg/strlenopt-18g.c: New test.
	* gcc.dg/strlenopt.h: New file.

From-SVN: r179278
2011-09-27 18:16:57 +02:00
Jakub Jelinek 8b57bfebe0 common.opt: Add -foptimize-strlen option.
* common.opt: Add -foptimize-strlen option.
	* Makefile.in (OBJS): Add tree-ssa-strlen.o.
	(tree-sssa-strlen.o): Add dependencies.
	* opts.c (default_options_table): Enable -foptimize-strlen
	by default at -O2 if not -Os.
	* passes.c (init_optimization_passes): Add pass_strlen
	after pass_object_sizes.
	* timevar.def (TV_TREE_STRLEN): New timevar.
	* params.def (PARAM_MAX_TRACKED_STRLENS): New parameter.
	* tree-pass.h (pass_strlen): Declare.
	* tree-ssa-strlen.c: New file.
	* c-decl.c (merge_decls): If compatible stpcpy prototype
	is seen, set implicit_built_in_decls[BUILT_IN_STPCPY].
cp/
	* decl.c (duplicate_decls): If compatible stpcpy prototype
	is seen, set implicit_built_in_decls[BUILT_IN_STPCPY].
testsuite/
	* gcc.dg/strlenopt-1.c: New test.
	* gcc.dg/strlenopt-1f.c: New test.
	* gcc.dg/strlenopt-2.c: New test.
	* gcc.dg/strlenopt-2f.c: New test.
	* gcc.dg/strlenopt-3.c: New test.
	* gcc.dg/strlenopt-4.c: New test.
	* gcc.dg/strlenopt-4g.c: New test.
	* gcc.dg/strlenopt-4gf.c: New test.
	* gcc.dg/strlenopt-5.c: New test.
	* gcc.dg/strlenopt-6.c: New test.
	* gcc.dg/strlenopt-7.c: New test.
	* gcc.dg/strlenopt-8.c: New test.
	* gcc.dg/strlenopt-9.c: New test.
	* gcc.dg/strlenopt-10.c: New test.
	* gcc.dg/strlenopt-11.c: New test.
	* gcc.dg/strlenopt-12.c: New test.
	* gcc.dg/strlenopt-12g.c: New test.
	* gcc.dg/strlenopt-13.c: New test.
	* gcc.dg/strlenopt-14g.c: New test.
	* gcc.dg/strlenopt-14gf.c: New test.
	* gcc.dg/strlenopt-15.c: New test.
	* gcc.dg/strlenopt-16g.c: New test.
	* gcc.dg/strlenopt-17g.c: New test.
	* gcc.dg/strlenopt-18g.c: New test.
	* gcc.dg/strlenopt.h: New file.

From-SVN: r179277
2011-09-27 18:15:46 +02:00
Tom de Vries baaa40aeca re PR middle-end/43864 (Same basic blocks should be merged)
2011-09-27  Tom de Vries  <tom@codesourcery.com>

	PR middle-end/43864
	* gcc.dg/fold-compare-2.c (dg-options): Add -fno-tree-tail-merge.
	* gcc/testsuite/gcc.dg/uninit-pred-2_c.c: Same.
	* gcc.dg/pr43864.c: New test.
	* gcc.dg/pr43864-2.c: Same.
	* gcc.dg/pr43864-3.c: Same.
	* gcc.dg/pr43864-4.c: Same.

From-SVN: r179276
2011-09-27 16:12:35 +00:00
Tom de Vries c9e9316807 re PR middle-end/43864 (Same basic blocks should be merged)
2011-09-27  Tom de Vries  <tom@codesourcery.com>

	PR middle-end/43864
	* tree-ssa-tail-merge.c: New file.
	(struct same_succ_def): Define.
	(same_succ, const_same_succ): New typedef.
	(struct bb_cluster_def): Define.
	(bb_cluster, const_bb_cluster): New typedef.
	(struct aux_bb_info): Define.
	(BB_SIZE, BB_SAME_SUCC, BB_CLUSTER, BB_VOP_AT_EXIT): Define.
	(gvn_uses_equal): New function.
	(same_succ_print, same_succ_print_traverse, update_dep_bb)
	(stmt_update_dep_bb, local_def, same_succ_hash)
	(inverse_flags, same_succ_equal, same_succ_alloc, same_succ_delete)
	(same_succ_reset): New function.
	(same_succ_htab, same_succ_edge_flags)
	(deleted_bbs, deleted_bb_preds): New var.
	(debug_same_succ): New function.
	(worklist): New var.
	(print_worklist, add_to_worklist, find_same_succ_bb, find_same_succ)
	(init_worklist, delete_worklist, delete_basic_block_same_succ)
	(same_succ_flush_bbs, purge_bbs, update_worklist): New function.
	(print_cluster, debug_cluster, update_rep_bb)
	(add_bb_to_cluster, new_cluster, delete_cluster): New function.
	(all_clusters): New var.
	(alloc_cluster_vectors, reset_cluster_vectors, delete_cluster_vectors)
	(merge_clusters, set_cluster): New function.
	(gimple_equal_p, gsi_advance_bw_nondebug_nonlocal, find_duplicate)
	(same_phi_alternatives_1, same_phi_alternatives, bb_has_non_vop_phi)
	(deps_ok_for_redirect_from_bb_to_bb, deps_ok_for_redirect)
	(find_clusters_1, find_clusters): New function.
	(update_vuses, vop_phi, vop_at_entry, replace_block_by): New function.
	(update_bbs): New var.
	(apply_clusters): New function.
	(update_debug_stmt, update_debug_stmts): New function.
	(tail_merge_optimize): New function.
	tree-pass.h (tail_merge_optimize): Declare.
	* tree-ssa-pre.c (execute_pre): Use tail_merge_optimize.
	* Makefile.in (OBJS-common): Add tree-ssa-tail-merge.o.
	(tree-ssa-tail-merge.o): New rule.
	* opts.c (default_options_table): Set OPT_ftree_tail_merge by default at
	OPT_LEVELS_2_PLUS.
	* tree-ssa-sccvn.c (vn_valueize): Move to ...
	* tree-ssa-sccvn.h (vn_valueize): Here.
	* timevar.def (TV_TREE_TAIL_MERGE): New timevar.
	* common.opt (ftree-tail-merge): New switch.
	* params.def (PARAM_MAX_TAIL_MERGE_COMPARISONS)
	(PARAM_MAX_TAIL_MERGE_ITERATIONS): New parameter.
	* doc/invoke.texi (Optimization Options, -O2): Add -ftree-tail-merge.
	(-ftree-tail-merge, max-tail-merge-comparisons)
	(max-tail-merge-iterations): New item.

From-SVN: r179275
2011-09-27 16:10:42 +00:00
Jan Hubicka 99e299a8c7 * ipa-inline-analysis.c (MAX_TIME): Reduce to avoid overflows.
From-SVN: r179274
2011-09-27 15:27:41 +00:00
Jan Hubicka 2ceb2339b1 inline-5.c: New testcase.
* gcc.dg/ipa/inline-5.c: New testcase.
	* ipa-inline-analysis.c (eliminated_by_inlining_prob): Handle parameters
	passed by reference; handle loads from non-SSA scalars and update comments.

From-SVN: r179273
2011-09-27 15:08:31 +00:00
Bernd Schmidt 0b47c1a9a9 re PR rtl-optimization/50249 (ira marks wrong value for inheriting)
PR rtl-optimization/50249
	* reload1.c (reload_reg_reaches_end_p): Accept a reloadnum argument
	instead of opnum and type.  All callers changed.  Remove useless
	declaration.
	Search forward for other reloads of the same type for the same operand
	using the same register; if any are found, return false.
	(reload_regs_reach_end_p): Same argument changes; all callers changed.

From-SVN: r179272
2011-09-27 14:55:11 +00:00
Andi Kleen cc8547a776 invoke.texi (ffat-lto-objects): Document.
* doc/invoke.texi (ffat-lto-objects): Document.
	* toplev.c (compile_file): Do not output assembly when doing slim lto;
	Output __gnu_slim_lto when doing slim lto.
	* cgraphunit.c (ipa_passes): Do only analysis when producing slim lto.
	(cgraph_optimize): Return early when doing slim lto.
	* opts.c (finish_options): Complain about lack of linker plugin
	when doing slim lto.
	* common.opt (ffat-lto-objects): New.

Co-Authored-By: Jan Hubicka <jh@suse.cz>

From-SVN: r179271
2011-09-27 14:36:48 +00:00
Ian Lance Taylor 3019bbaeb3 mksysinfo: Fix for systems that don't define TIOCSCTTY.
From Rainer Orth.

From-SVN: r179269
2011-09-27 13:16:22 +00:00
Richard Sandiford 0578e4172d ipa-inline-analysis.c (predicate_probability): Avoid comparison between signed and unsigned.
gcc/
	* ipa-inline-analysis.c (predicate_probability): Avoid comparison
	between signed and unsigned.

From-SVN: r179268
2011-09-27 13:01:31 +00:00
Ira Rosen 4ef69dfc4a tree-vect-stmts.c (vectorizable_type_demotion): Handle basic block vectorization.
* tree-vect-stmts.c (vectorizable_type_demotion): Handle basic
        block vectorization.
        (vectorizable_type_promotion): Likewise.
        (vect_analyze_stmt): Call vectorizable_type_demotion and
        vectorizable_type_promotion for basic blocks.
        (supportable_widening_operation): Don't assume loop
        vectorization.
        * tree-vect-slp.c (vect_build_slp_tree): Allow multiple types
        for basic blocks.  Update vectorization factor for basic block
        vectorization.
        (vect_analyze_slp_instance): Allow multiple types for basic
        block vectorization.  Recheck unrolling factor after
        construction of SLP instance.

From-SVN: r179267
2011-09-27 12:26:34 +00:00