Commit Graph

501 Commits

Author SHA1 Message Date
Segher Boessenkool 3a76f570dc rtlanal: dead_or_set_regno_p should handle CLOBBER (PR83424)
In PR83424 combine's move_deaths puts a REG_DEAD note in the wrong place
because dead_or_set_regno_p does not account for CLOBBER insns.  This
fixes it.


	PR rtl-optimization/83424
	* rtlanal.c (dead_or_set_regno_p): Handle CLOBBER just like SET.

gcc/testsuite/
	PR rtl-optimization/83424
	* gcc.dg/pr83424.c: New testsuite.

From-SVN: r256750
2018-01-16 17:20:10 +01:00
Eric Botcazou 951346c205 re PR rtl-optimization/83565 (RTL combine pass yields wrong rotate result)
PR rtl-optimization/83565
	* rtlanal.c (nonzero_bits1): On WORD_REGISTER_OPERATIONS machines, do
	not extend the result to a larger mode for rotate operations.
	(num_sign_bit_copies1): Likewise.

From-SVN: r256573
2018-01-12 10:20:42 +00:00
Jeff Law d80c6d02fd re PR rtl-optimization/78812 (Wrong code generation due to hoisting memory load across function call)
PR tree-optimizatin/78812
	* rtl.h (contains_mem_rtx_p): Prototype.
	* ifcvt.c (containts_mem_rtx_p): Move from here to...
	* rtlanal.c (contains_mem_rtx_p): Here and remvoe static linkage.
	* gcse.c (prune_expressions): Use contains_mem_rtx_p to discover
	and prune MEMs that are not at the toplevel of a SET_SRC rtx.  Look
	through ZERO_EXTEND and SIGN_EXTEND when trying to avoid pruning
	MEMs.

	PR tree-optimization/78812
	* g++.dg/torture/pr78812.C: New test.

From-SVN: r244093
2017-01-05 00:38:48 -07:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Markus Trippelsdorf ced17de640 Fix PR78588 - rtlanal.c:5210:38: runtime error: shift exponent 4294967295 is too large for 64-bit type
Building gcc with -fsanitize=undefined shows:
 rtlanal.c:5210:38: runtime error: shift exponent 4294967295 is too large for 64-bit type 'long unsigned int'

This happens because if_then_else_cond() in combine.c calls
num_sign_bit_copies() in rtlanal.c with mode==BLKmode.

5205   bitwidth = GET_MODE_PRECISION (mode);
5206   if (bitwidth > HOST_BITS_PER_WIDE_INT)
5207     return 1;
5208
5209   nonzero = nonzero_bits (x, mode);
5210   return nonzero & (HOST_WIDE_INT_1U << (bitwidth - 1))
5211          ? 1 : bitwidth - floor_log2 (nonzero) - 1;

This causes (bitwidth - 1) to wrap around.

	PR rtl-optimization/78588
	* combine.c (if_then_else_cond): Also guard against BLKmode.
	* rtlanal.c (num_sign_bit_copies1): Add assert.

From-SVN: r242997
2016-11-30 07:30:55 +00:00
Jakub Jelinek a5a4add7aa re PR middle-end/78540 (ICE: in df_refs_verify, at df-scan.c:4062 with -O -march=core2)
PR middle-end/78540
	* rtl.h (remove_reg_equal_equiv_notes): Return bool instead of void.
	* rtlanal.c (remove_reg_equal_equiv_notes): Return true if any
	note has been removed.
	* postreload.c (reload_combine_recognize_pattern): If
	remove_reg_equal_equiv_notes returns true, call df_notes_rescan.

	* gcc.dg/pr78540.c: New test.

From-SVN: r242937
2016-11-28 23:51:29 +01:00
Bernd Schmidt 03612f2527 re PR rtl-optimization/78120 (If conversion no longer performed)
PR rtl-optimization/78120
	* rtlanal.c (insn_rtx_cost): Revert previous change.

From-SVN: r242908
2016-11-28 08:59:01 +00:00
Bernd Schmidt 334442f282 re PR rtl-optimization/78120 (If conversion no longer performed)
PR rtl-optimization/78120
	* rtlanal.c (insn_rtx_cost): Use set_rtx_cost.

From-SVN: r242833
2016-11-24 12:17:52 +00:00
Richard Sandiford 07ce146666 Rework subreg_get_info
This isn't intended to change the behaviour, just rewrite the
existing logic in a different (and hopefully clearer) way.
The new form -- particularly the part based on the "block"
concept -- is easier to convert to polynomial sizes.

gcc/
2016-11-15  Richard Sandiford  <richard.sandiford@arm.com>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

	* rtlanal.c (subreg_get_info): Use more local variables.
	Remark that for HARD_REGNO_NREGS_HAS_PADDING, each scalar unit
	occupies at least one register.  Assume that full hard registers
	have consistent endianness.  Share previously-duplicated if block.
	Rework the main handling so that it operates on independently-
	addressable YMODE-sized blocks.  Use subreg_size_lowpart_offset
	to check lowpart offsets, without trying to find an equivalent
	integer mode first.  Handle WORDS_BIG_ENDIAN != REG_WORDS_BIG_ENDIAN
	as a final register-endianness correction.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r242758
2016-11-23 14:35:14 +00:00
Richard Sandiford 33951763a8 Add more subreg offset helpers
Provide versions of subreg_lowpart_offset and subreg_highpart_offset
that work on mode sizes rather than modes.  Also provide a routine
that converts an lsb position to a subreg offset.

The intent (in combination with later patches) is to move the
handling of the BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN case into
just two places, so that for other combinations we don't have
to split offsets into words and subwords.

gcc/
2016-11-15  Richard Sandiford  <richard.sandiford@arm.com>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

	* rtl.h (subreg_size_offset_from_lsb): Declare.
	(subreg_offset_from_lsb): New function.
	(subreg_size_lowpart_offset): Declare.
	(subreg_lowpart_offset): Turn into an inline function.
	(subreg_size_highpart_offset): Declare.
	(subreg_highpart_offset): Turn into an inline function.
	* emit-rtl.c (subreg_size_lowpart_offset): New function.
	(subreg_size_highpart_offset): Likewise
	* rtlanal.c (subreg_size_offset_from_lsb): Likewise.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r242755
2016-11-23 14:31:13 +00:00
Trevor Saunders bacca1274c make dead_or_set_{,regno_}p take rtx_insn *
gcc/ChangeLog:

2016-11-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* rtl.h: Adjust prototype.
	* rtlanal.c (dead_or_set_p): Change argument type to rtx_insn *.
	(dead_or_set_regno_p): Likewise.

From-SVN: r242657
2016-11-21 06:16:18 +00:00
Trevor Saunders 2059d0e97d make add_int_reg_note take rtx_insn *
gcc/ChangeLog:

2016-11-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* rtl.h: Adjust prototype.
	* rtlanal.c (add_int_reg_note): Change argument type to rtx_insn *.

From-SVN: r242656
2016-11-21 06:16:13 +00:00
Trevor Saunders 4bd09ee9d3 make replace_label_in_insn take labels as rtx_insn *
gcc/ChangeLog:

2016-11-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* rtl.h: Adjust prototype.
	* rtlanal.c (replace_label_in_insn): Change argument type to
	rtx_insn *.

From-SVN: r242652
2016-11-21 06:15:26 +00:00
Richard Sandiford 421619baa5 Make load_extend_op an inline function
gcc/
	* rtlanal.c (load_extend_op): Move to...
	* rtl.h: ...here and make inline.

From-SVN: r242601
2016-11-18 18:26:34 +00:00
Richard Sandiford 0e0af68921 Fix handling of unknown sizes in rtx_addr_can_trap_p
If the size passed in to rtx_addr_can_trap_p was zero, the frame
handling would get the size from the mode instead.  However, this
too can be zero if the mode is BLKmode, i.e. if we have a BLKmode
memory reference with no MEM_SIZE (which should be rare these days).
This meant that the conditions for a 4-byte access at offset X were
stricter than those for an access of unknown size at offset X.

This patch checks whether the size is still zero, as the
SYMBOL_REF handling does.

gcc/
2016-11-15  Richard Sandiford  <richard.sandiford@arm.com>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

	* rtlanal.c (rtx_addr_can_trap_p_1): Handle unknown sizes.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r242476
2016-11-16 10:20:23 +00:00
Richard Sandiford 3712c7a301 Add a load_extend_op wrapper
LOAD_EXTEND_OP only applies to scalar integer modes that are narrower
than a word.  However, callers weren't consistent about which of these
checks they made beforehand, and also weren't consistent about whether
"smaller" was based on (bit)size or precision (IMO it's the latter).
This patch adds a wrapper to try to make the macro easier to use.

LOAD_EXTEND_OP is often used to disable transformations that aren't
beneficial when extends from memory are free, so being stricter about
the check accidentally exposed more optimisation opportunities.

"SUBREG_BYTE (...) == 0" and subreg_lowpart_p are implied by
paradoxical_subreg_p, so the patch also removes some redundant tests.

The patch doesn't change reload, since different checks could have
unforeseen consequences.

gcc/
2016-11-15  Richard Sandiford  <richard.sandiford@arm.com>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

	* rtl.h (load_extend_op): Declare.
	* rtlanal.c (load_extend_op): New function.
	(nonzero_bits1): Use it.
	(num_sign_bit_copies1): Likewise.
	* cse.c (cse_insn): Likewise.
	* fold-const.c (fold_single_bit_test): Likewise.
	(fold_unary_loc): Likewise.
	* fwprop.c (free_load_extend): Likewise.
	* postreload.c (reload_cse_simplify_set): Likewise.
	(reload_cse_simplify_operands): Likewise.
	* combine.c (try_combine): Likewise.
	(simplify_set): Likewise.  Remove redundant SUBREG_BYTE and
	subreg_lowpart_p checks.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r242444
2016-11-15 18:13:56 +00:00
Richard Sandiford 89e64bc030 Move misplaced assignment in num_sign_bit_copies1
The old assignment to bitwidth was before we handled VOIDmode with:

      if (mode == VOIDmode)
        mode = GET_MODE (x);

so when VOIDmode was specified we would always use:

      if (bitwidth < GET_MODE_PRECISION (GET_MODE (x)))
        {
          num0 = cached_num_sign_bit_copies (x, GET_MODE (x),
                                             known_x, known_mode, known_ret);
          return MAX (1,
                      num0 - (int) (GET_MODE_PRECISION (GET_MODE (x)) - bitwidth));
        }

For a zero bitwidth this always returns 1 (which is the most
pessimistic result).

gcc/
2016-11-15  Richard Sandiford  <richard.sandiford@arm.com>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

	* rtlanal.c (num_sign_bit_copies1): Calculate bitwidth after
	handling VOIDmode.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r242440
2016-11-15 17:54:20 +00:00
Eric Botcazou 8b287aea35 re PR rtl-optimization/59461 (missed zero-extension elimination in the combiner)
PR rtl-optimization/59461
	* doc/rtl.texi (paradoxical subregs): Add missing word.
	* combine.c (reg_nonzero_bits_for_combine): Do not discard results
	in modes with precision larger than that of last_set_mode.
	* rtlanal.c (nonzero_bits1) <SUBREG>: If WORD_REGISTER_OPERATIONS is
	set and LOAD_EXTEND_OP is appropriate, propagate results from inner
	REGs to paradoxical SUBREGs.
	(num_sign_bit_copies1) <SUBREG>: Likewise.  Check that the mode is not
	larger than a word before invoking LOAD_EXTEND_OP on it.

From-SVN: r242326
2016-11-11 22:38:33 +00:00
Bernd Schmidt 1581a12c35 emit-rtl.c (emit_copy_of_insn_after): Duplicate notes in order.
* emit-rtl.c (emit_copy_of_insn_after): Duplicate notes in order.
	* sel-sched-ir.c (create_copy_of_insn_rtx): Likewise.
	* rtl.h (duplicate_reg_notes): Declare.
	* rtlanal.c (duplicate_reg_note): New function.

From-SVN: r241913
2016-11-07 17:03:55 +00:00
Eric Botcazou 6a4cf4188b defaults.h (LOAD_EXTEND_OP): Define if not already defined.
* defaults.h (LOAD_EXTEND_OP): Define if not already defined.
	* combine.c (LOAD_EXTEND_OP): Delete.
	(simplify_comparison): Fix comment about LOAD_EXTEND_OP.
	* cse.c (LOAD_EXTEND_OP): Delete.
	* fold-const.c (LOAD_EXTEND_OP): Likewise.
	* fwprop.c (free_load_extend): Remove #ifdef LOAD_EXTEND_OP/#endif.
	* postreload.c (LOAD_EXTEND_OP): Delete.
	* reload.c (push_reload): Remove #ifdef LOAD_EXTEND_OP/#endif.
	Convert conditional compilation based on WORD_REGISTER_OPERATIONS.
	(find_reloads): Likewise.
	* reload1.c (eliminate_regs_1): Likewise.
	* rtlanal.c (nonzero_bits1): Remove #ifdef LOAD_EXTEND_OP/#endif.
	(num_sign_bit_copies1): Likewise.

From-SVN: r241855
2016-11-04 17:42:32 +00:00
Kyrylo Tkachov c096a32993 [rtlanal] Fix WORD_REGISTER_OPERATIONS condition in nonzero_bits
* rtlanal.c (nonzero_bits1): Fix WORD_REGISTER_OPERATIONS condition.
	Move comments into more natural position.

From-SVN: r241815
2016-11-03 12:08:26 +00:00
Trevor Saunders 466d19802a remove cast to rtx_insn * in remove_note
gcc/ChangeLog:

2016-11-01  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* config/rl78/rl78.c (gen-and_emit_move): Change argument type
	to rtx_insn *.
	(transcode_memory_rtx): Likewise.
	(move_to_acc): Likewise.
	(move_from_acc): Likewise.
	(move_acc_to_reg): Likewise.
	(move_to_x): Likewise.
	(move_to_hl): Likewise.
	(move_to_de): Likewise.
	* config/rs6000/rs6000.c (emit_frame_save): Likewise.
	(rs6000_emit_savres_rtx): Likewise.
	(rs6000_emit_prologue): Likewise.
	* reorg.c (update_reg_unused_notes): Likewise.
	* rtl.h (remove_note): Adjust prototype.
	* rtlanal.c (remove_note): Make argument type rtx_insn *.

From-SVN: r241771
2016-11-02 03:45:59 +00:00
Trevor Saunders dfe08bc4ef make tablejump_p return the label as a rtx_insn *
gcc/ChangeLog:

2016-10-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* cfgcleanup.c (merge_blocks_move_successor_nojumps): Adjust.
	(outgoing_edges_match): Likewise.
	(try_crossjump_to_edge): Likewise.
	* cfgrtl.c (try_redirect_by_replacing_jump): Likewise.
	(rtl_tidy_fallthru_edge): Likewise.
	* rtl.h (tablejump_p): Adjust prototype.
	* rtlanal.c (tablejump_p): Return the label as a rtx_insn *.

From-SVN: r241402
2016-10-21 12:33:01 +00:00
Trevor Saunders 04a121a757 make LABEL_REF_LABEL a rtx_insn *
While changing LABEL_REF_LABEL it might as well become an inline
function, so that its clearer what types are involved.  Unfortunately
because it is still possible to use XEXP and related macros on a
LABEL_REF rtx you can still set the field to be a non insn rtx.  The
other unfortunate thing is that the generators actually create LABEL_REF
rtx that refer to MATCH_x rtx, so there we actually need to use XEXP to
bypass the checking this patch adds.

gcc/ChangeLog:

2016-10-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* rtl.h (label_ref_label): New function.
	(set_label_ref_label): New function.
	(LABEL_REF_LABEL): Delete.
	* alias.c (rtx_equal_for_memref_p): Adjust.
	* cfgbuild.c (make_edges): Likewise.
	(purge_dead_tablejump_edges): Likewise.
	* cfgexpand.c (convert_debug_memory_address): Likewise.
	* cfgrtl.c (patch_jump_insn): Likewise.
	* combine.c (distribute_notes): Likewise.
	* cse.c (hash_rtx_cb): Likewise.
	(exp_equiv_p): Likewise.
	(fold_rtx): Likewise.
	(check_for_label_ref): Likewise.
	* cselib.c (rtx_equal_for_cselib_1): Likewise.
	(cselib_hash_rtx): Likewise.
	* emit-rtl.c (mark_label_nuses): Likewise.
	* explow.c (convert_memory_address_addr_space_1): Likewise.
	* final.c (output_asm_label): Likewise.
	(output_addr_const): Likewise.
	* gcse.c (add_label_notes): Likewise.
	* genconfig.c (walk_insn_part): Likewise.
	* genrecog.c (validate_pattern): Likewise.
	* ifcvt.c (cond_exec_get_condition): Likewise.
	(noce_emit_store_flag): Likewise.
	(noce_get_alt_condition): Likewise.
	(noce_get_condition): Likewise.
	* jump.c (maybe_propagate_label_ref): Likewise.
	(mark_jump_label_1): Likewise.
	(redirect_exp_1): Likewise.
	(rtx_renumbered_equal_p): Likewise.
	* lra-constraints.c (operands_match_p): Likewise.
	* print-rtl.c (print_value): Likewise.
	* reload.c (find_reloads): Likewise.
	* reload1.c (set_label_offsets): Likewise.
	* reorg.c (get_branch_condition): Likewise.
	* rtl-tests.c (test_uncond_jump): Likewise.
	* rtl.c (rtx_equal_p_cb): Likewise.
	(rtx_equal_p): Likewise.
	* rtlanal.c (reg_mentioned_p): Likewise.
	(rtx_referenced_p): Likewise.
	(get_condition): Likewise.
	* varasm.c (const_hash_1): Likewise.
	(compare_constant): Likewise.
	(const_rtx_hash_1): Likewise.
	(output_constant_pool_1): Likewise.

From-SVN: r241401
2016-10-21 12:32:56 +00:00
Eric Botcazou 4c640e2606 re PR ada/37139 (DEP prevents using Ada tasking)
PR ada/37139
	PR ada/67205
	* common.opt (-ftrampolines): New option.
	* doc/invoke.texi (Code Gen Options): Document it.
	* doc/tm.texi.in (Trampolines): Add TARGET_CUSTOM_FUNCTION_DESCRIPTORS.
	* doc/tm.texi: Regenerate.
	* builtins.def: Add init_descriptor and adjust_descriptor.
	* builtins.c (expand_builtin_init_trampoline): Do not issue a warning
	on platforms with descriptors.
	(expand_builtin_init_descriptor): New function.
	(expand_builtin_adjust_descriptor): Likewise.
	(expand_builtin) <BUILT_IN_INIT_DESCRIPTOR>: New case.
	<BUILT_IN_ADJUST_DESCRIPTOR>: Likewise.
	* calls.c (prepare_call_address): Remove SIBCALLP parameter and add
	FLAGS parameter.  Deal with indirect calls by descriptor and adjust.
	Set STATIC_CHAIN_REG_P on the static chain register, if any.
	(call_expr_flags): Set ECF_BY_DESCRIPTOR for calls by descriptor.
	(expand_call): Likewise.  Move around call to prepare_call_address
	and pass all flags to it.
	* cfgexpand.c (expand_call_stmt): Reinstate CALL_EXPR_BY_DESCRIPTOR.
	* gimple.h (enum gf_mask): New GF_CALL_BY_DESCRIPTOR value.
	(gimple_call_set_by_descriptor): New setter.
	(gimple_call_by_descriptor_p): New getter.
	* gimple.c (gimple_build_call_from_tree): SetCALL_EXPR_BY_DESCRIPTOR.
	(gimple_call_flags): Deal with GF_CALL_BY_DESCRIPTOR.
	* langhooks.h (struct lang_hooks): Add custom_function_descriptors.
	* langhooks-def.h (LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS): Define.
	(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS.
	* rtl.h (STATIC_CHAIN_REG_P): New macro.
	* rtlanal.c (find_first_parameter_load): Skip static chain registers.
	* target.def (custom_function_descriptors): New POD hook.
	* tree.h (FUNC_ADDR_BY_DESCRIPTOR): New flag on ADDR_EXPR.
	(CALL_EXPR_BY_DESCRIPTOR): New flag on CALL_EXPR.
	* tree-core.h (ECF_BY_DESCRIPTOR): New mask.
	Document FUNC_ADDR_BY_DESCRIPTOR and CALL_EXPR_BY_DESCRIPTOR.
	* tree.c (make_node_stat) <tcc_declaration>: Use FUNCTION_ALIGNMENT.
	(build_common_builtin_nodes): Initialize init_descriptor and
	adjust_descriptor.
	* tree-nested.c: Include target.h.
	(struct nesting_info): Add 'any_descr_created' field.
	(get_descriptor_type): New function.
	(lookup_element_for_decl): New function extracted from...
	(create_field_for_decl): Likewise.
	(lookup_tramp_for_decl): ...here.  Adjust.
	(lookup_descr_for_decl): New function.
	(convert_tramp_reference_op): Deal with descriptors.
	(build_init_call_stmt): New function extracted from...
	(finalize_nesting_tree_1): ...here.  Adjust and deal withdescriptors.
	* defaults.h (FUNCTION_ALIGNMENT): Define.
	(TRAMPOLINE_ALIGNMENT): Set to above instead of FUNCTION_BOUNDARY.
	* config/i386/i386.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Define.
	* config/ia64/ia64.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Likewise.
	* config/rs6000/rs6000.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS):Likewise.
	* config/sparc/sparc.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Likewise.
ada/
	* gcc-interface/misc.c (LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS):Define.
	* gcc-interface/trans.c (Attribute_to_gnu) <Attr_Access>: Deal with
	a zero TARGET_CUSTOM_FUNCTION_DESCRIPTORS specially for Code_Address.
	Otherwise, if TARGET_CUSTOM_FUNCTION_DESCRIPTORS is positive, set
	FUNC_ADDR_BY_DESCRIPTOR for 'Access/'Unrestricted_Access of nested
	subprograms if the type can use an internal representation.
	(call_to_gnu): Likewise, but set CALL_EXPR_BY_DESCRIPTOR on indirect
	calls if the type can use an internal representation.

From-SVN: r241222
2016-10-16 20:13:32 +00:00
Thomas Preud'homme 4d0cdd0ce6 Move MEMMODEL_* from coretypes.h to memmodel.h
2016-10-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * coretypes.h: Move MEMMODEL_* macros and enum memmodel definition
    into ...
    * memmodel.h: This file.
    * alias.c, asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c,
      caller-save.c, calls.c, ccmp.c, cfgbuild.c, cfgcleanup.c,
      cfgexpand.c, cfgloopanal.c, cfgrtl.c, cilk-common.c, combine.c,
      combine-stack-adj.c, common/config/aarch64/aarch64-common.c,
      common/config/arm/arm-common.c, common/config/bfin/bfin-common.c,
      common/config/c6x/c6x-common.c, common/config/i386/i386-common.c,
      common/config/ia64/ia64-common.c, common/config/nvptx/nvptx-common.c,
      compare-elim.c, config/aarch64/aarch64-builtins.c,
      config/aarch64/aarch64-c.c, config/aarch64/cortex-a57-fma-steering.c,
      config/arc/arc.c, config/arc/arc-c.c, config/arm/arm-builtins.c,
      config/arm/arm-c.c, config/avr/avr.c, config/avr/avr-c.c,
      config/avr/avr-log.c, config/bfin/bfin.c, config/c6x/c6x.c,
      config/cr16/cr16.c, config/cris/cris.c, config/darwin-c.c,
      config/darwin.c, config/epiphany/epiphany.c,
      config/epiphany/mode-switch-use.c,
      config/epiphany/resolve-sw-modes.c, config/fr30/fr30.c,
      config/frv/frv.c, config/ft32/ft32.c, config/h8300/h8300.c,
      config/i386/i386-c.c, config/i386/winnt.c, config/iq2000/iq2000.c,
      config/lm32/lm32.c, config/m32c/m32c.c, config/m32r/m32r.c,
      config/m68k/m68k.c, config/mcore/mcore.c,
      config/microblaze/microblaze.c, config/mmix/mmix.c,
      config/mn10300/mn10300.c, config/moxie/moxie.c,
      config/msp430/msp430.c, config/nds32/nds32-cost.c,
      config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c,
      config/nds32/nds32-memory-manipulation.c,
      config/nds32/nds32-predicates.c, config/nds32/nds32.c,
      config/nios2/nios2.c, config/nvptx/nvptx.c, config/pa/pa.c,
      config/pdp11/pdp11.c, config/rl78/rl78.c, config/rs6000/rs6000-c.c,
      config/rx/rx.c, config/s390/s390-c.c, config/s390/s390.c,
      config/sh/sh.c, config/sh/sh-c.c, config/sh/sh-mem.cc,
      config/sh/sh_treg_combine.cc, config/sol2.c, config/spu/spu.c,
      config/stormy16/stormy16.c, config/tilegx/tilegx.c,
      config/tilepro/tilepro.c, config/v850/v850.c, config/vax/vax.c,
      config/visium/visium.c, config/vms/vms-c.c, config/xtensa/xtensa.c,
      coverage.c, cppbuiltin.c, cprop.c, cse.c, cselib.c, dbxout.c, dce.c,
      df-core.c, df-problems.c, df-scan.c, dojump.c, dse.c, dwarf2asm.c,
      dwarf2cfi.c, dwarf2out.c, emit-rtl.c, except.c, explow.c, expmed.c,
      expr.c, final.c, fold-const.c, function.c, fwprop.c, gcse.c,
      ggc-page.c, haifa-sched.c, hsa-brig.c, hsa-gen.c, hw-doloop.c,
      ifcvt.c, init-regs.c, internal-fn.c, ira-build.c, ira-color.c,
      ira-conflicts.c, ira-costs.c, ira-emit.c, ira-lives.c, ira.c, jump.c,
      loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c,
      lower-subreg.c, lra.c, lra-assigns.c, lra-coalesce.c,
      lra-constraints.c, lra-eliminations.c, lra-lives.c, lra-remat.c,
      lra-spills.c, mode-switching.c, modulo-sched.c, omp-low.c, passes.c,
      postreload-gcse.c, postreload.c, predict.c, print-rtl-function.c,
      recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c,
      reload.c, reload1.c, reorg.c, resource.c, rtl-chkp.c, rtl-tests.c,
      rtlanal.c, rtlhooks.c, sched-deps.c, sched-rgn.c, sdbout.c,
      sel-sched-ir.c, sel-sched.c, shrink-wrap.c, simplify-rtx.c,
      stack-ptr-mod.c, stmt.c, stor-layout.c, target-globals.c,
      targhooks.c, toplev.c, tree-nested.c, tree-outof-ssa.c,
      tree-profile.c, tree-ssa-coalesce.c, tree-ssa-ifcombine.c,
      tree-ssa-loop-ivopts.c, tree-ssa-loop.c, tree-ssa-reassoc.c,
      tree-ssa-sccvn.c, tree-vect-data-refs.c, ubsan.c, valtrack.c,
      var-tracking.c, varasm.c: Include memmodel.h.
    * genattrtab.c (write_header): Include memmodel.h in generated file.
    * genautomata.c (main): Likewise.
    * gengtype.c (open_base_files): Likewise.
    * genopinit.c (main): Likewise.
    * genconditions.c (write_header): Include memmodel.h earlier in
    generated file.
    * genemit.c (main): Likewise.
    * genoutput.c (output_prologue): Likewise.
    * genpeep.c (main): Likewise.
    * genpreds.c (write_insn_preds_c): Likewise.
    * genrecog.c (write_header): Likewise.
    * Makefile.in (PLUGIN_HEADERS): Include memmodel.h

    gcc/ada/
    * gcc-interface/utils2.c: Include memmodel.h.

    gcc/c-family/
    * c-cppbuiltin.c: Include memmodel.h.
    * c-opts.c: Likewise.
    * c-pragma.c: Likewise.
    * c-warn.c: Likewise.

    gcc/c/
    * c-typeck.c: Include memmodel.h.

    gcc/cp/
    * decl2.c: Include memmodel.h.
    * rtti.c: Likewise.

    gcc/fortran/
    * trans-intrinsic.c: Include memmodel.h.

    gcc/go/
    * go-backend.c: Include memmodel.h.

    libgcc/
    * libgcov-profiler.c: Replace MEMMODEL_* macros by their __ATOMIC_*
    equivalent.
    * config/tilepro/atomic.c: Likewise and stop casting model to
    enum memmodel.

From-SVN: r241121
2016-10-13 14:17:52 +00:00
Jakub Jelinek bbfac6da60 auto-inc-dec.c (try_merge): Remove break after return.
* auto-inc-dec.c (try_merge): Remove break after return.
	* cselib.c (autoinc_split): Likewise.
	* explow.c (promote_mode): Likewise.
	* fixed-value.c (fixed_arithmetic): Likewise.
	* hsa.c (hsa_internal_fn::get_arity): Likewise.
	* rtlanal.c (modified_between_p, modified_in_p): Likewise.
	* trans-mem.c (get_attrs_for): Likewise.
	* tree-if-conv.c (if_convertible_stmt_p): Likewise.
	* tree-vrp.c (simplify_stmt_using_ranges): Likewise.
	* config/aarch64/aarch64-builtins.c (aarch64_fold_builtin): Likewise.
	* config/aarch64/aarch64.c (aarch64_get_condition_code_1): Likewise.
	* config/c6x/c6x.c (c6x_get_unit_specifier): Likewise.
	* config/cr16/cr16.c (legitimate_pic_operand_p): Likewise.
	* config/cris/cris.c (cris_op_str): Likewise.
	* config/mn10300/mn10300.c (cc_flags_for_code): Likewise.
	* config/tilepro/tilepro.c (tilepro_emit_setcc_internal_di): Likewise.
c-family/
	* c-ada-spec.c (print_ada_declaration): Remove break after return.
objc/
	* objc-act.c (continue_class): Remove break after return.
	(objc_maybe_printable_name): Likewise.
fortran/
	* dependency.c (gfc_dep_compare_expr): Remove break after return.
	* frontend-passes.c (optimize_op): Likewise.
	* interface.c (gfc_current_interface_head): Likewise.
	* symbol.c (check_conflict): Likewise.
	* trans-intrinsic.c (build_fix_expr): Likewise.
ada/
	* terminals.c (is_gui_app): Remove break after return.

From-SVN: r240554
2016-09-27 20:14:10 +02:00
Jason Merrill 146ec50fd5 Add inline functions for various bitwise operations.
* hwint.h (least_bit_hwi, pow2_or_zerop, pow2p_hwi, ctz_or_zero):
	New.
	* hwint.c (exact_log2): Use pow2p_hwi.
	(ctz_hwi, ffs_hwi): Use least_bit_hwi.
	* alias.c (memrefs_conflict_p): Use pow2_or_zerop.
	* builtins.c (get_object_alignment_2, get_object_alignment)
	(get_pointer_alignment, fold_builtin_atomic_always_lock_free): Use
	least_bit_hwi.
	* calls.c (compute_argument_addresses, store_one_arg): Use
	least_bit_hwi.
	* cfgexpand.c (expand_one_stack_var_at): Use least_bit_hwi.
	* combine.c (force_to_mode): Use least_bit_hwi.
	* emit-rtl.c (set_mem_attributes_minus_bitpos, adjust_address_1):
	Use least_bit_hwi.
	* expmed.c (synth_mult, expand_divmod): Use ctz_or_zero, ctz_hwi.
	(init_expmed_one_conv): Use pow2p_hwi.
	* fold-const.c (round_up_loc, round_down_loc): Use pow2_or_zerop.
	(fold_binary_loc): Use pow2p_hwi.
	* function.c (assign_parm_find_stack_rtl): Use least_bit_hwi.
	* gimple-fold.c (gimple_fold_builtin_memory_op): Use pow2p_hwi.
	* gimple-ssa-strength-reduction.c (replace_ref): Use least_bit_hwi.
	* hsa-gen.c (gen_hsa_addr_with_align, hsa_bitmemref_alignment):
	Use least_bit_hwi.
	* ipa-cp.c (ipcp_alignment_lattice::meet_with_1): Use least_bit_hwi.
	* ipa-prop.c (ipa_modify_call_arguments): Use least_bit_hwi.
	* omp-low.c (oacc_loop_fixed_partitions)
	(oacc_loop_auto_partitions): Use least_bit_hwi.
	* rtlanal.c (nonzero_bits1): Use ctz_or_zero.
	* stor-layout.c (place_field): Use least_bit_hwi.
	* tree-pretty-print.c (dump_generic_node): Use pow2p_hwi.
	* tree-sra.c (build_ref_for_offset): Use least_bit_hwi.
	* tree-ssa-ccp.c (ccp_finalize): Use least_bit_hwi.
	* tree-ssa-math-opts.c (bswap_replace): Use least_bit_hwi.
	* tree-ssa-strlen.c (handle_builtin_memcmp): Use pow2p_hwi.
	* tree-vect-data-refs.c (vect_analyze_group_access_1)
	(vect_grouped_store_supported, vect_grouped_load_supported)
	(vect_permute_load_chain, vect_shift_permute_load_chain)
	(vect_transform_grouped_load): Use pow2p_hwi.
	* tree-vect-generic.c (expand_vector_divmod): Use ctz_or_zero.
	* tree-vect-patterns.c (vect_recog_divmod_pattern): Use ctz_or_zero.
	* tree-vect-stmts.c (vectorizable_mask_load_store): Use
	least_bit_hwi.
	* tsan.c (instrument_expr): Use least_bit_hwi.
	* var-tracking.c (negative_power_of_two_p): Use pow2_or_zerop.

From-SVN: r240194
2016-09-16 15:20:44 -04:00
Bernd Edlinger 5368023839 tm.texi.in (INITIAL_FRAME_POINTER_OFFSET): Remove.
2016-09-10  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * doc/tm.texi.in (INITIAL_FRAME_POINTER_OFFSET): Remove.
        (ELIMINABLE_REGS, TARGET_CAN_ELIMINATE,
        INITIAL_ELIMINATION_OFFSET) : Update documentation.
        * target.def (frame_pointer_required, can_eliminate): Likewise.
        * doc/tm.texi: Regenerated.
        * builtins.c (expand_builtin_setjmp_receiver): Remove #ifdef
        ELIMINABLE_REGS.
        * df-scan.c (df_hard_reg_init): Likewise.
        * ira.c (ira_setup_eliminable_regset): Likewise.
        * lra-eliminations.c (reg_eliminate_1, (update_reg_eliminate,
        init_elim_table): Likewise.
        * reload1.c (reg_eliminate_1, verify_initial_elim_offsets,
        set_initial_elim_offsets, update_eliminables,
        init_elim_table): Likewise.
        * rtlanal.c (get_initial_register_offset): Likewise.
        * config/ft32/ft32.h (INITIAL_FRAME_POINTER_OFFSET): Remove.
        * config/m32r/m32r.h (INITIAL_FRAME_POINTER_OFFSET): Likewise.
        * config/moxie/moxie.h (INITIAL_FRAME_POINTER_OFFSET): Likewise.
        * config/vax/vax.h (INITIAL_FRAME_POINTER_OFFSET): Likewise.
        * config/fr30/fr30.h: Fix comment.
        * config/frv/frv.c: Likewise.
        * config/frv/frv.h: Likewise.
        * config/ft32/ft32.h: Likewise.
        * config/visium/visium.h: Likewise.
        * config/pa/pa64-linux.h: Likewise.
        * config/v850/v850.h: Likewise.
        * config/cris/cris.c: Likewise.
        * config/ia64/ia64.h: Likewise.
        * config/moxie/moxie.h: Likewise.
        * config/m32r/m32r.h: Likewise.

From-SVN: r240058
2016-09-09 23:08:54 +00:00
Marek Polacek 191816a36b re PR c/7652 (-Wswitch-break : Warn if a switch case falls through)
PR c/7652
gcc/
	* alias.c (find_base_value): Adjust fall through comment.
	* cfgexpand.c (expand_debug_expr): Likewise.
	* combine.c (find_split_point): Likewise.
	(expand_compound_operation): Likewise.  Add FALLTHRU.
	(make_compound_operation): Adjust fall through comment.
	(canon_reg_for_combine): Add FALLTHRU.
	(force_to_mode): Adjust fall through comment.
	(simplify_shift_const_1): Likewise.
	(simplify_comparison): Likewise.
	* config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add
	FALLTHRU.
	* config/aarch64/predicates.md: Likewise.
	* config/i386/i386.c (function_arg_advance_32): Likewise.
	(ix86_gimplify_va_arg): Likewise.
	(print_reg): Likewise.
	(ix86_print_operand): Likewise.
	(ix86_build_const_vector): Likewise.
	(ix86_expand_branch): Likewise.
	(ix86_sched_init_global): Adjust fall through comment.
	(ix86_expand_args_builtin): Add FALLTHRU.
	(ix86_expand_builtin): Likewise.
	(ix86_expand_vector_init_one_var): Likewise.
	* config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise.
	(rs6000_adjust_cost): Likewise.
	(insn_must_be_first_in_group): Likewise.
	* config/rs6000/rs6000.md: Likewise.  Adjust fall through comment.
	* dbxout.c (dbxout_symbol): Adjust fall through comment.
	* df-scan.c (df_uses_record): Likewise.
	* dojump.c (do_jump): Add FALLTHRU.
	* dwarf2out.c (mem_loc_descriptor): Likewise.  Adjust fall through
	comment.
	(resolve_args_picking_1): Adjust fall through comment.
	(loc_list_from_tree_1): Likewise.
	* expmed.c (make_tree): Likewise.
	* expr.c (expand_expr_real_2): Add FALLTHRU.
	(expand_expr_real_1): Likewise.  Adjust fall through comment.
	* fold-const.c (const_binop): Adjust fall through comment.
	(fold_truth_not_expr): Likewise.
	(fold_cond_expr_with_comparison): Add FALLTHRU.
	(fold_binary_loc): Likewise.
	(contains_label_1): Adjust fall through comment.
	(multiple_of_p): Likewise.
	* gcov-tool.c (process_args): Add FALLTHRU.
	* genattrtab.c (check_attr_test): Likewise.
	(write_test_expr): Likewise.
	* genconfig.c (walk_insn_part): Likewise.
	* genpreds.c (validate_exp): Adjust fall through comment.
	(needs_variable): Likewise.
	* gensupport.c (get_alternatives_number): Add FALLTHRU.
	(subst_dup): Likewise.
	* gimple-pretty-print.c (dump_gimple_assign): Likewise.
	* gimplify.c (gimplify_addr_expr): Adjust fall through comment.
	(gimplify_scan_omp_clauses): Add FALLTHRU.
	(goa_stabilize_expr): Likewise.
	* graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust fall
	through comment.
	* hsa-gen.c (get_address_from_value): Likewise.
	* ipa-icf.c (sem_function::hash_stmt): Likewise.
	* ira.c (ira_setup_alts): Add FALLTHRU.
	* lra-eliminations.c (lra_eliminate_regs_1): Adjust fall through
	comment.
	* lto-streamer-out.c (lto_output_tree_ref): Add FALLTHRU.
	* opts.c (common_handle_option): Likewise.
	* read-rtl.c (read_rtx_code): Likewise.
	* real.c (round_for_format): Likewise.
	* recog.c (asm_operand_ok): Likewise.
	* reginfo.c (reg_scan_mark_refs): Adjust fall through comment.
	* reload1.c (set_label_offsets): Likewise.
	(eliminate_regs_1): Likewise.
	(reload_reg_reaches_end_p): Likewise.
	* rtlanal.c (commutative_operand_precedence): Add FALLTHRU.
	(rtx_cost): Likewise.
	* sched-rgn.c (is_exception_free): Likewise.
	* simplify-rtx.c (simplify_rtx): Adjust fall through comment.
	* stor-layout.c (int_mode_for_mode): Likewise.
	* toplev.c (print_to_asm_out_file): Likewise.
	(print_to_stderr): Likewise.
	* tree-cfg.c (gimple_verify_flow_info): Likewise.
	* tree-chrec.c (chrec_fold_plus_1): Add FALLTHRU.
	(chrec_fold_multiply): Likewise.
	(evolution_function_is_invariant_rec_p): Likewise.
	(for_each_scev_op): Likewise.
	* tree-data-ref.c (siv_subscript_p): Likewise.
	(get_references_in_stmt): Likewise.
	* tree.c (find_placeholder_in_expr): Adjust fall through comment.
	(substitute_in_expr): Likewise.
	(type_cache_hasher::equal): Likewise.
	(walk_type_fields): Likewise.
	* var-tracking.c (adjust_mems): Add FALLTHRU.
	(set_dv_changed): Adjust fall through comment.
	* varasm.c (default_function_section): Add FALLTHRU.
gcc/c-family/
	* c-common.c (scalar_to_vector): Adjust fall through comment.
	* c-opts.c (c_common_handle_option): Likewise.
	* c-pragma.c (handle_pragma_pack): Add FALLTHRU.
	* c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust
	fall through comment.
	* cilk.c (extract_free_variables): Add FALLTHRU.
gcc/c/
	* c-parser.c (c_parser_external_declaration): Add FALLTHRU.
	(c_parser_postfix_expression): Likewise.
	* c-typeck.c (build_unary_op): Adjust fall through comment.
	(c_mark_addressable): Likewise.
gcc/cp/
	* call.c (add_builtin_candidate): Add FALLTHRU.
	(build_integral_nontype_arg_conv): Adjust fall through comment.
	(build_new_op_1): Add FALLTHRU.
	(convert_like_real): Adjust fall through comment.
	* class.c (fixed_type_or_null): Likewise.
	* constexpr.c (cxx_eval_constant_expression): Likewise.
	(potential_constant_expression_1): Likewise.  Add FALLTHRU.
	* cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment.
	(cp_fold): Add FALLTHRU.
	* cvt.c (build_expr_type_conversion): Adjust fall through comment.
	* cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU.
	(pp_cxx_qualified_id): Likewise.
	(cxx_pretty_printer::constant): Adjust fall through comment.
	(cxx_pretty_printer::primary_expression): Add FALLTHRU.
	(pp_cxx_pm_expression): Adjust fall through comment.
	(cxx_pretty_printer::expression): Add FALLTHRU.
	(cxx_pretty_printer::declaration_specifiers): Reformat code.
	(pp_cxx_type_specifier_seq): Adjust fall through comment.
	(pp_cxx_ptr_operator): Likewise.  Add FALLTHRU.
	* error.c (dump_type): Adjust fall through comment.
	(dump_decl): Likewise.
	* mangle.c (write_type): Likewise.
	* method.c (synthesized_method_walk): Add FALLTHRU.
	* name-lookup.c (arg_assoc_type): Likewise.
	* parser.c (cp_lexer_print_token): Adjust fall through comment.
	(cp_parser_primary_expression): Add FALLTHRU.
	(cp_parser_operator): Likewise.
	* pt.c (find_parameter_packs_r): Likewise.
	(tsubst_aggr_type): Adjust fall through comment.
	* semantics.c (finish_omp_clauses): Add FALLTHRU.
	* tree.c (lvalue_kind): Likewise.
gcc/fortran/
	* decl.c (match_attr_spec): Add FALLTHRU.
	* primary.c (match_arg_list_function): Likewise.
	* resolve.c (resolve_operator): Adjust fall through comment.
	(fixup_charlen): Add FALLTHRU.
	(resolve_allocate_expr): Adjust fall through comment.
	* trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU.
	* trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through
	comment.
gcc/java/
	* expr.c (java_truthvalue_conversion): Adjust fall through comment.
	* jcf-io.c (verify_constant_pool): Likewise.
	* typeck.c (promote_type): Likewise.
gcc/objc/
	* objc-encoding.c (encode_type): Add FALLTHRU.
libcpp/
	* lex.c (search_line_fast): Add FALLTHRU.
	(_cpp_lex_direct): Likewise.
	(cpp_token_val_index): Adjust fall through comment.
	* macro.c (parse_params): Add FALLTHRU.
	* pch.c (count_defs): Adjust fall through comment.
	(write_defs): Likewise.
libiberty/
	* cp-demangle.c (d_print_mod): Add FALLTHRU.

From-SVN: r239410
2016-08-12 10:30:47 +00:00
Uros Bizjak fecfbfa4a2 builtins.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1...
* builtins.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1,
	HOST_WIDE_INT_1U instead of (unsigned HOST_WIDE_INT) 1,
	HOST_WIDE_INT_M1 instead of (HOST_WIDE_INT) -1 and
	HOST_WIDE_INT_M1U instead of (unsigned HOST_WIDE_INT) -1.
	* combine.c: Ditto.
	* cse.c: Ditto.
	* dojump.c: Ditto.
	* double-int.c: Ditto.
	* dse.c: Ditto.
	* dwarf2out.c: Ditto.
	* expmed.c: Ditto.
	* expr.c: Ditto.
	* fold-const.c: Ditto.
	* function.c: Ditto.
	* fwprop.c: Ditto.
	* genmodes.c: Ditto.
	* hwint.c: Ditto.
	* hwint.h: Ditto.
	* ifcvt.c: Ditto.
	* loop-doloop.c: Ditto.
	* loop-invariant.c: Ditto.
	* loop-iv.c: Ditto.
	* match.pd: Ditto.
	* optabs.c: Ditto.
	* real.c: Ditto.
	* reload.c: Ditto.
	* rtlanal.c: Ditto.
	* simplify-rtx.c: Ditto.
	* stor-layout.c: Ditto.
	* toplev.c: Ditto.
	* tree-ssa-loop-ivopts.c: Ditto.
	* tree-vect-generic.c: Ditto.
	* tree-vect-patterns.c: Ditto.
	* tree.c: Ditto.
	* tree.h: Ditto.
	* ubsan.c: Ditto.
	* varasm.c: Ditto.
	* wide-int-print.cc: Ditto.
	* wide-int.cc: Ditto.
	* wide-int.h: Ditto.

From-SVN: r238481
2016-07-19 18:40:55 +02:00
Kyrylo Tkachov b5bd197890 [rtlanal] Fix rtl-optimization/71295
PR rtl-optimization/71295
	* rtlanal.c (subreg_get_info): If taking a subreg at the requested
	offset would go over the size of the inner mode reject it.

	* gcc.c-torture/compile/pr71295.c: New test.

From-SVN: r237034
2016-06-02 12:26:42 +00:00
Kyrylo Tkachov 317d98872b [rtlanal.c] Convert conditional compilation on WORD_REGISTER_OPERATIONS
* rtlanal.c (nonzero_bits1): Convert preprocessor check
	for WORD_REGISTER_OPERATIONS to runtime check.

From-SVN: r235512
2016-04-27 14:38:10 +00:00
Jakub Jelinek 9bc057c8da re PR middle-end/70245 (Miscompilation of ICU on i386 with atom tuning starting with r227382)
PR target/70245
	* rtl.h (replace_rtx): Add ALL_REGS argument.
	* rtlanal.c (replace_rtx): Likewise.  If true, use REGNO
	equality and assert mode is the same, instead of just rtx pointer
	equality.
	* config/i386/i386.md (mov + arithmetics with load peephole): Pass
	true as ALL_REGS argument to replace_rtx.

From-SVN: r234285
2016-03-17 12:53:53 +01:00
Jakub Jelinek 5adb7c859d re PR rtl-optimization/70261 (r234265 causes fails on rs6000)
PR target/70261
	* rtlanal.c (replace_rtx): Revert 2016-03-16 change.

From-SVN: r234279
2016-03-17 09:01:26 +01:00
Jakub Jelinek c73d295c48 re PR middle-end/70245 (Miscompilation of ICU on i386 with atom tuning starting with r227382)
PR target/70245
	* rtlanal.c (replace_rtx): For REG, if from is a REG,
	return to even if only REGNO is equal, and assert
	mode is the same.

	* g++.dg/opt/pr70245.C: New test.
	* g++.dg/opt/pr70245.h: New file.
	* g++.dg/opt/pr70245-aux.cc: New file.

Co-Authored-By: Richard Biener <rguenther@suse.de>

From-SVN: r234265
2016-03-16 18:52:20 +01:00
Bin Cheng b7b528a43b re PR rtl-optimization/69052 (Performance regression after r229402.)
PR rtl-optimization/69052
	* rtlanal.c (commutative_operand_precedence): Set higher precedence
	to CONST_WIDE_INT.

From-SVN: r234034
2016-03-07 16:39:27 +00:00
Jakub Jelinek d0268b37f8 re PR rtl-optimization/69592 (Compile-time and memory-use hog in combine)
PR rtl-optimization/69592
	* rtlanal.c (nonzero_bits_binary_arith_p): New inline function.
	(cached_nonzero_bits): Use it instead of ARITHMETIC_P.
	(num_sign_bit_copies_binary_arith_p): New inline function.
	(cached_num_sign_bit_copies): Use it instead of ARITHMETIC_P.

	* gcc.dg/pr69592.c: New test.

From-SVN: r233059
2016-02-01 23:39:31 +01:00
Bernd Schmidt 9776e6920d Fix PR66178, ICE due to misexpansion of constant expressions involving labels.
PR middle-end/66178
	* expr.c (expand_expr_real_2) [PLUS_EXPR, MINUS_EXPR]: Don't
	drop EXPAND_INITIALIZER.
	* rtl.h (contains_symbolic_reference_p): Declare.
	* rtlanal.c (contains_symbolic_reference_p): New function.
	* simplify-rtx.c (simplify_binary_operation_1): Don't turn
	a subtraction into a NOT if symbolic constants are involved.

testsuite/
	PR middle-end/66178
	gcc.dg/torture/pr66178.c: New test.

From-SVN: r232689
2016-01-21 18:10:03 +00:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Segher Boessenkool 0c91a1fb3c rtlanal: Fix bits/bytes confusion in set_noop_p (PR68814)
The meaning of ZERO_EXTRACT depends on BITS_BIG_ENDIAN, not on
BYTES_BIG_ENDIAN.  This caused PR68814.


2015-12-11  Segher Boessenkool  <segher@kernel.crashing.org>

	PR rtl-optimization/68814
	* rtlanal.c (set_noop_p): Use BITS_BIG_ENDIAN instead of
	BYTES_BIG_ENDIAN.

From-SVN: r231547
2015-12-11 00:47:31 +01:00
Anatoly Sokolov d614335f77 Add contains_symbol_ref_p
From-SVN: r229607
2015-10-30 23:56:32 +03:00
Kyrylo Tkachov a69a0436ee [comment] Improve comment for reg_set_p
* rtlanal.c (reg_set_p): Expand function comment.

From-SVN: r229586
2015-10-30 15:54:11 +00:00
Andrew MacLeod 68a750e938 alias.c: Remove unused headers.
2015-10-30  Andrew MacLeod  <amacleod@redhat.com>
	
	* alias.c: Remove unused headers.
	* asan.c: Likewise.
	* attribs.c: Likewise.
	* auto-inc-dec.c: Likewise.
	* auto-profile.c: Likewise.
	* bb-reorder.c: Likewise.
	* bitmap.c: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* caller-save.c: Likewise.
	* calls.c: Likewise.
	* ccmp.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* cilk-common.c: Likewise.
	* combine-stack-adj.c: Likewise.
	* combine.c: Likewise.
	* compare-elim.c: Likewise.
	* convert.c: Likewise.
	* coverage.c: Likewise.
	* cppbuiltin.c: Likewise.
	* cprop.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* data-streamer-in.c: Likewise.
	* data-streamer-out.c: Likewise.
	* data-streamer.c: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* ddg.c: Likewise.
	* debug.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* dfp.c: Likewise.
	* dojump.c: Likewise.
	* dominance.c: Likewise.
	* domwalk.c: Likewise.
	* double-int.c: Likewise.
	* dse.c: Likewise.
	* dumpfile.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarf2cfi.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* final.c: Likewise.
	* fixed-value.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* fwprop.c: Likewise.
	* gcse.c: Likewise.
	* generic-match-head.c: Likewise.
	* ggc-common.c: Likewise.
	* gimple-builder.c: Likewise.
	* gimple-expr.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-match-head.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple-ssa-isolate-paths.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple-streamer-out.c: Likewise.
	* gimple-walk.c: Likewise.
	* gimple.c: Likewise.
	* gimplify-me.c: Likewise.
	* gimplify.c: Likewise.
	* godump.c: Likewise.
	* graph.c: Likewise.
	* graphds.c: Likewise.
	* haifa-sched.c: Likewise.
	* hw-doloop.c: Likewise.
	* ifcvt.c: Likewise.
	* init-regs.c: Likewise.
	* internal-fn.c: Likewise.
	* ipa-chkp.c: Likewise.
	* ipa-comdats.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-icf-gimple.c: Likewise.
	* ipa-icf.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-polymorphic-call.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-ref.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-visibility.c: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* jump.c: Likewise.
	* langhooks.c: Likewise.
	* lcm.c: Likewise.
	* lists.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-init.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-iv.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-assigns.c: Likewise.
	* lra-coalesce.c: Likewise.
	* lra-constraints.c: Likewise.
	* lra-eliminations.c: Likewise.
	* lra-lives.c: Likewise.
	* lra-remat.c: Likewise.
	* lra-spills.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-compress.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* mcf.c: Likewise.
	* mode-switching.c: Likewise.
	* modulo-sched.c: Likewise.
	* optabs.c: Likewise.
	* opts-global.c: Likewise.
	* passes.c: Likewise.
	* plugin.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* real.c: Likewise.
	* realmpfr.c: Likewise.
	* recog.c: Likewise.
	* ree.c: Likewise.
	* reg-stack.c: Likewise.
	* regcprop.c: Likewise.
	* reginfo.c: Likewise.
	* regrename.c: Likewise.
	* regstat.c: Likewise.
	* reload.c: Likewise.
	* reload1.c: Likewise.
	* reorg.c: Likewise.
	* resource.c: Likewise.
	* rtl-chkp.c: Likewise.
	* rtl-error.c: Likewise.
	* rtlanal.c: Likewise.
	* rtlhooks.c: Likewise.
	* sanopt.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched.c: Likewise.
	* sese.c: Likewise.
	* shrink-wrap.c: Likewise.
	* simplify-rtx.c: Likewise.
	* stack-ptr-mod.c: Likewise.
	* statistics.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* stringpool.c: Likewise.
	* symtab.c: Likewise.
	* target-globals.c: Likewise.
	* targhooks.c: Likewise.
	* toplev.c: Likewise.
	* tracer.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chkp-opt.c: Likewise.
	* tree-chkp.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-iterator.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-ch.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-loop-unswitch.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-scopedtables.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree-streamer.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tsan.c: Likewise.
	* ubsan.c: Likewise.
	* value-prof.c: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vmsdbgout.c: Likewise.
	* vtable-verify.c: Likewise.
	* web.c: Likewise.
	* wide-int-print.cc: Likewise.
	* wide-int.cc: Likewise.
	* xcoffout.c: Likewise.

From-SVN: r229585
2015-10-30 15:48:59 +00:00
Andrew MacLeod 957060b5c5 alias.c: Reorder #include statements and remove duplicates.
2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* alias.c: Reorder #include statements and remove duplicates.
	* asan.c: Likewise.
	* attribs.c: Likewise.
	* auto-inc-dec.c: Likewise.
	* auto-profile.c: Likewise.
	* bb-reorder.c: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* caller-save.c: Likewise.
	* calls.c: Likewise.
	* ccmp.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* cilk-common.c: Likewise.
	* combine-stack-adj.c: Likewise.
	* combine.c: Likewise.
	* compare-elim.c: Likewise.
	* convert.c: Likewise.
	* coverage.c: Likewise.
	* cppbuiltin.c: Likewise.
	* cprop.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* data-streamer-in.c: Likewise.
	* data-streamer-out.c: Likewise.
	* data-streamer.c: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* ddg.c: Likewise.
	* debug.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* dfp.c: Likewise.
	* dojump.c: Likewise.
	* dominance.c: Likewise.
	* double-int.c: Likewise.
	* dse.c: Likewise.
	* dumpfile.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarf2cfi.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* final.c: Likewise.
	* fixed-value.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* fwprop.c: Likewise.
	* gcse.c: Likewise.
	* generic-match-head.c: Likewise.
	* ggc-common.c: Likewise.
	* gimple-builder.c: Likewise.
	* gimple-expr.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-match-head.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple-ssa-isolate-paths.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple-streamer-out.c: Likewise.
	* gimple-walk.c: Likewise.
	* gimple.c: Likewise.
	* gimplify-me.c: Likewise.
	* gimplify.c: Likewise.
	* godump.c: Likewise.
	* graph.c: Likewise.
	* graphite-poly.c: Likewise.
	* haifa-sched.c: Likewise.
	* hw-doloop.c: Likewise.
	* ifcvt.c: Likewise.
	* incpath.c: Likewise.
	* init-regs.c: Likewise.
	* internal-fn.c: Likewise.
	* ipa-chkp.c: Likewise.
	* ipa-comdats.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-icf-gimple.c: Likewise.
	* ipa-icf.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-polymorphic-call.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-ref.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-visibility.c: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* jump.c: Likewise.
	* langhooks.c: Likewise.
	* lcm.c: Likewise.
	* lists.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-init.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-iv.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-assigns.c: Likewise.
	* lra-coalesce.c: Likewise.
	* lra-constraints.c: Likewise.
	* lra-eliminations.c: Likewise.
	* lra-lives.c: Likewise.
	* lra-remat.c: Likewise.
	* lra-spills.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-compress.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* mode-switching.c: Likewise.
	* modulo-sched.c: Likewise.
	* omp-low.c: Likewise.
	* optabs.c: Likewise.
	* opts-global.c: Likewise.
	* passes.c: Likewise.
	* plugin.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* real.c: Likewise.
	* realmpfr.c: Likewise.
	* recog.c: Likewise.
	* ree.c: Likewise.
	* reg-stack.c: Likewise.
	* regcprop.c: Likewise.
	* reginfo.c: Likewise.
	* regrename.c: Likewise.
	* regstat.c: Likewise.
	* reload.c: Likewise.
	* reload1.c: Likewise.
	* reorg.c: Likewise.
	* resource.c: Likewise.
	* rtl-chkp.c: Likewise.
	* rtl-error.c: Likewise.
	* rtlanal.c: Likewise.
	* rtlhooks.c: Likewise.
	* sanopt.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* sese.c: Likewise.
	* shrink-wrap.c: Likewise.
	* simplify-rtx.c: Likewise.
	* stack-ptr-mod.c: Likewise.
	* statistics.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* stringpool.c: Likewise.
	* symtab.c: Likewise.
	* target-globals.c: Likewise.
	* targhooks.c: Likewise.
	* toplev.c: Likewise.
	* tracer.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chkp-opt.c: Likewise.
	* tree-chkp.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-iterator.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-ch.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-loop-unswitch.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-scopedtables.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree-streamer.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tsan.c: Likewise.
	* ubsan.c: Likewise.
	* value-prof.c: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vtable-verify.c: Likewise.
	* web.c: Likewise.
	* wide-int-print.cc: Likewise.
	* wide-int.cc: Likewise.
	* xcoffout.c: Likewise.

From-SVN: r229526
2015-10-29 13:57:32 +00:00
Richard Sandiford 34a72c3348 Remove REAL_VALUE_FROM_CONST_DOUBLE
To maintain symmetry after the previous removal of
CONST_DOUBLE_FROM_REAL_VALUE, this patch also gets rid of
REAL_VALUE_FROM_CONST_DOUBLE.  All the macro did was copy the
contents of CONST_DOUBLE_REAL_VALUE into a temporary real_value
structure.  In many cases there was no need for this temporary
and we could simply use the CONST_DOUBLE_REAL_VALUE directly.
For that reason this patch is less automatic than the others.

Bootstrapped & regression-tested on x86_64-linux-gnu.  Also tested by
building one target per CPU directory and checking that there were
no new warnings and no changes in testsuite output at -O2.

gcc/
	* real.h (REAL_VALUE_FROM_CONST_DOUBLE): Delete.
	* config/aarch64/aarch64.c (aarch64_float_const_zero_rtx_p)
	(aarch64_print_operand, aarch64_float_const_representable_p)
	(aarch64_output_simd_mov_immediate): Use CONST_DOUBLE_REAL_VALUE
	instead of REAL_VALUE_FROM_CONST_DOUBLE.
	* config/arc/arc.c (arc_print_operand): Likewise.
	* config/arm/arm.c (arm_const_double_rtx, vfp3_const_double_index)
	(neon_valid_immediate, arm_print_operand, arm_emit_fp16_const)
	(vfp3_const_double_for_fract_bits, vfp3_const_double_for_bits):
	Likewise.
	* config/arm/arm.md (*arm32_movhf, consttable_4, consttable_8)
	(consttable_16): Likewise.
	* config/arm/vfp.md (*movhf_vfp_neon, *movhf_vfp): Likewise.
	* config/avr/avr.c (avr_print_operand): Likewise.
	* config/bfin/bfin.md: Likewise (in a define_split).
	* config/c6x/c6x.md: Likewise (in a define_split).
	* config/cr16/cr16.c (cr16_const_double_ok): Likewise.
	(cr16_print_operand): Likewise.
	* config/cris/cris.c (cris_print_operand): Likewise.
	* config/epiphany/epiphany.c (epiphany_print_operand): Likewise.
	* config/fr30/fr30.c (fr30_print_operand): Likewise.
	(fr30_const_double_is_zero): Likewise.
	* config/frv/frv.c (frv_print_operand, output_move_single): Likewise.
	* config/frv/frv.md: Likewise (in a define_split).
	* config/frv/predicates.md (int_2word_operand): Likewise.
	* config/h8300/h8300.c (h8300_print_operand): Likewise.
	* config/i386/i386.c (standard_80387_constant_p): Likewise.
	(ix86_print_operand, ix86_split_to_parts): Likewise.
	* config/i386/i386.md: Likewise (in a define_split).
	* config/ia64/ia64.c (ia64_split_tmode, ia64_print_operand): Likewise.
	* config/iq2000/iq2000.md (movsf_lo_sum, movsf_high): Likewise.
	* config/m32r/m32r.c (easy_df_const, m32r_print_operand): Likewise.
	* config/m68k/m68k.c (handle_move_double, standard_68881_constant_p)
	(print_operand): Likewise.
	* config/m68k/m68k.md (movsf_cf_hard, movdf_cf_hard): Likewise.
	* config/mep/mep.md: Likewise (in define_split).
	* config/microblaze/microblaze.c (microblaze_const_double_ok)
	(print_operand): Likewise.
	* config/mips/mips.md (consttable_float): Likewise.
	* config/mmix/mmix.c (mmix_intval): Likewise.
	* config/mn10300/mn10300.c (mn10300_print_operand): Likewise.
	* config/nvptx/nvptx.c (nvptx_print_operand): Likewise.
	* config/pa/pa.c (pa_singlemove_string): Likewise.
	* config/pdp11/pdp11.c (pdp11_expand_operands): Likewise.
	(pdp11_asm_print_operand, legitimate_const_double_p): Likewise.
	* config/rs6000/rs6000.c (num_insns_constant, rs6000_emit_cmove)
	(output_toc): Likewise.
	* config/rs6000/rs6000.md: Likewise (in define_splits).
	* config/rx/rx.c (rx_print_operand): Likewise.
	* config/s390/s390.c (s390_output_pool_entry): Likewise.
	* config/sh/sh.c (fp_zero_operand, fp_one_operand): Likewise.
	* config/sh/sh.md (consttable_sf, consttable_df): Likewise
	(and also in define_splits).
	* config/sparc/sparc.c (fp_sethi_p, fp_mov_p): Likewise.
	(fp_high_losum_p): Likewise.
	* config/sparc/sparc.md (*movsf_insn, *movsf_lo_sum): Likewise.
	(*movsf_high): Likewise.
	* config/spu/spu.c (const_double_to_hwint): Likewise.
	* config/v850/v850.c (const_double_split): Likewise.
	* config/vax/vax.c (vax_float_literal): Likewise.
	* config/visium/visium.c (visium_expand_copysign): Likewise.
	* config/visium/visium.md: Likewise (in define_split).
	* config/xtensa/predicates.md (const_float_1_operand): Likewise.
	* config/xtensa/xtensa.c (print_operand): Likewise.
	(xtensa_output_literal): Likewise.
	* cprop.c (implicit_set_cond_p): Likewise.
	* dwarf2out.c (insert_float): Likewise.
	* expmed.c (expand_mult, make_tree): Likewise.
	* expr.c (compress_float_constant): Likewise.
	* rtlanal.c (split_double): Likewise.
	* simplify-rtx.c (avoid_constant_pool_reference): Likewise.
	(simplify_const_unary_operation, simplify_binary_operation_1)
	(simplify_const_binary_operation): Likewise.
	(simplify_const_relational_operation): Likewise.
	* varasm.c (output_constant_pool_2): Likewise.

From-SVN: r228478
2015-10-05 11:37:49 +00:00
Richard Biener 06da803c9f re PR middle-end/67651 (Optimizer assumes nothing can reside at address 0 despite -fno-delete-null-pointer-checks)
2015-09-21  Richard Biener  <rguenther@suse.de>

	PR middle-end/67651
	* rtlanal.c (nonzero_address_p): SYMBOL_REFs may have zero
	address with -fno-delete-null-pointer-checks.

From-SVN: r227968
2015-09-21 12:33:23 +00:00
Marek Polacek aa256c4aed c-common.c (warn_for_sign_compare): Cast to unsigned when shifting a negative value.
* c-common.c (warn_for_sign_compare): Cast to unsigned when shifting
	a negative value.

	* c-typeck.c (set_nonincremental_init_from_string): Use
	HOST_WIDE_INT_M1U when shifting a negative value.

	* rtlanal.c (split_double): Cast to unsigned when shifting a negative
	value.
	* sched-int.h (UNKNOWN_DEP_COST): Likewise.

From-SVN: r227743
2015-09-14 10:36:50 +00:00
David Sherwood 1c0e448f4b arm.c (neon_element_bits, [...]): Call GET_MODE_INNER unconditionally.
gcc/
2015-07-28  David Sherwood  <david.sherwood@arm.com>

	* config/arm/arm.c (neon_element_bits, neon_valid_immediate): Call
	GET_MODE_INNER unconditionally.
	* config/spu/spu.c (arith_immediate_p): Likewise.
	* config/i386/i386.c (ix86_build_signbit_mask): Likewise.
	* expmed.c (synth_mult): Remove check for VOIDmode result from
	GET_MODE_INNER.
	(expand_mult_const): Likewise.
	* fold-const.c (fold_binary_loc): Replace call to element_precision
	with call to GET_MODE_PRECISION.
	* genmodes.c (emit_mode_inner_inline): Replace void_mode->name with
	m->name.
	(emit_mode_inner): Likewise.
	* lto-streamer-out.c (lto_write_mode_table): Update GET_MODE_INNER
	result check.
	* machmode.h (GET_MODE_UNIT_SIZE): Simplify.
	(GET_MODE_UNIT_PRECISION): Likewise.
	* rtlanal.c (subreg_get_info): Call GET_MODE_INNER unconditionally.
	* simplify-rtx.c (simplify_immed_subreg): Likewise.
	* stor-layout.c (bitwise_type_for_mode): Update assert.
	(element_precision): Remove.

From-SVN: r226328
2015-07-28 20:31:17 +00:00
Richard Sandiford 2a870875df target-insns.def (can_extend, ptr_extend): New targetm instruction patterns.
gcc/
	* target-insns.def (can_extend, ptr_extend): New targetm instruction
	patterns.
	* optabs.c (can_extend_p): Use them instead of HAVE_*/gen_* interface.
	* simplify-rtx.c (simplify_unary_operation_1): Likewise.
	* emit-rtl.c (set_reg_attrs_from_value): Likewise.
	* rtlanal.c (nonzero_bits1): Likewise.
	(num_sign_bit_copies1): Likewise.

From-SVN: r226324
2015-07-28 19:59:40 +00:00