gcc/
* target.def (output_ident): New hook.
* targhooks.h (default_asm_output_ident_directive): Add prototype.
* varasm.c (assemble_asm): Only prefix a tab if the string does not
already start with one.
(default_asm_output_ident_directive): New function to emit
.ident as a top-level asm node while parsing, or directly to
asm_out_file after parsing.
* toplev.c (compile_file): Print a GCC .ident with
targetm.asm_out.output_ident.
* doc/tm.texi.in (ASM_OUTPUT_IDENT): Remove documentation for macro.
(TARGET_ASM_OUTPUT_IDENT): Add @hook for this.
* doc/tm.texi: Update.
* config/elfos.h (ASM_OUTPUT_IDENT, IDENT_ASM_OP): Remove.
(TARGET_ASM_OUTPUT_IDENT): Define.
* config/i386/djgpp.h (IDENT_ASM_OP): Remove.
* config/i386/gas.h (ASM_OUTPUT_IDENT): Remove.
* config/arm/aout.h (ASM_OUTPUT_IDENT): Remove.
* config/sparc/sparc.h (IDENT_ASM_OP): Remove.
(TARGET_ASM_OUTPUT_IDENT): Define.
* config/picochip/picochip.h (IDENT_ASM_OP): Remove.
(TARGET_ASM_OUTPUT_IDENT): Define.
* config/cris/cris-protos.h (cris_asm_output_ident): Add prototype.
* config/cris/cris.c (cris_asm_output_ident): New function.
* config/cris/cris.h (ASM_OUTPUT_IDENT, IDENT_ASM_OP): Remove.
* config/microblaze/microblaze-protos.h (microblaze_asm_output_ident):
Add prototype.
* config/microblaze/microblaze.c: Include cgraph.h for add_asm_node.
(microblaze_asm_output_ident): Rewrite to work similar to
default_asm_output_ident_directive for front-end .idents.
* config/microblaze/microblaze.h (ASM_OUTPUT_IDENT): Remove.
(TARGET_ASM_OUTPUT_IDENT): Define.
* config/mips/mips.h (ASM_OUTPUT_IDENT): Remove.
* config/mips/sde.h (IDENT_ASM_OP, ASM_OUTPUT_IDENT): Remove.
* config/rx/rx.c: Include cgraph.h for add_asm_node.
(rx_asm_output_ident): New function, similar to
default_asm_output_ident_directive, but handle AS100 syntax also, so
that #ident also works for rx in AS100 syntax.
(TARGET_ASM_OUTPUT_IDENT): Define.
* config/rx/rx.h (IDENT_ASM_OP): Remove.
* Makefile.in: Fix dependencies for c-family/c-lex.o.
c-family/
* c-lex.c: Do not include output.h.
(cb_ident): Try to put out .ident with targetm.asm_out.output_ident.
Remove uses of ASM_OUTPUT_IDENT.
ada/
* gcc-interface/trans.c: Include target.h.
(gigi): Try to put out .ident with targetm.asm_out.output_ident.
Remove uses of ASM_OUTPUT_IDENT.
* gcc-interface/Make-lang.in: Fix dependencies.
From-SVN: r188791
* config/i386/i386.md (FIST_ROUNDING): New int iterator.
(rounding): Handle UNSPEC_FIST_{FLOOR,CEIL}.
(ROUNDING): Ditto.
(*fist<mode>2_<rounding>_1): Macroize insn from
*fist<mode>2_{floor,ceil}_1 using FIST_ROUNDING int iterator.
(fistdi2_<rounding>): Macroize insn from
fistdi2_{floor,ceil} using FIST_ROUNDING int iterator.
(fistdi2_<rounding>_with_temp and splitters): Macroize insn and
corresponding splitters from fistdi2_{floor,ceil} and corresponding
splitters using FIST_ROUNDING int iterator.
(fist<mode>2_<rounding>): Macroize insn from
fist<mode>2_{floor,ceil} using FIST_ROUNDING int iterator.
(fist<mode>2_<rounding>_with_temp and splitters): Macroize insn and
corresponding splitters from fist<mode>2_{floor,ceil} and corresponding
splitters using FIST_ROUNDING int iterator.
(l<rounding>xf<mode>2): Macroize expander from l{floor,ceil}xf<mode>2
using FIST_ROUNDING int iterator.
From-SVN: r188789
* config/i386/i386.md (FRNDINT_ROUNDING): New int iterator.
(rounding): New int attribute.
(ROUNDING): Ditto.
(frndintxf2_<rounding>): Macroize insn from
frndintxf2_{floor,ceil,trunc} using FRNDINT_ROUNDING int iterator.
(frndintxf2_<rounding>_i387): Macroize insn from
frndintxf2_{floor,ceil,trunc}_i387 using FRNDINT_ROUNDING int iterator.
From-SVN: r188783
2012-06-19 Richard Guenther <rguenther@suse.de>
* tree-vrp.c (union_ranges): New function.
(vrp_meet_1): Use union_ranges.
(vrp_meet): Dump what we union and call vrp_meet_1.
From-SVN: r188780
2012-06-19 Richard Guenther <rguenther@suse.de>
* tree-vrp.c (intersect_ranges): Handle more cases.
(vrp_intersect_ranges): Dump what we intersect and call ...
(vrp_intersect_ranges_1): ... this.
From-SVN: r188776
2012-06-19 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53708
* tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Preserve
user-supplied alignment and alignment of decls with the used
attribute.
From-SVN: r188771
The intent of the phases was to have a high-level but mutually exclusive
accounting of compile time. We want to track compile time in a way that
tells us which conceptual phases are taking the most time. That intent
is not currently satisfied. This patch restores that intent.
Add code to verify that the sum of the phase times is less than the total
time, to detect when phases are overlapped. A slight amount of leeway is
required due to time jitters. This verification is done as the last step
in printing timevars so that any timevar information is not lost.
Rename the phases to be clearer about what they measure, so that they
are less likely to be modified to be overlapping. The primary example
is to change TV_PHASE_GENERATE to TV_PHASE_LATE_ASM, meaning late work
on the assembly. This name change avoids confusion n moving the timevar
start call after the call to lang_hooks.decls.final_write_globals, which
prevents overlapping phases.
Each implementation of lang_hooks.decls.final_write_globals, is responsible
for starting and stopping its own phases. Each implementation currently has
a first phase of TV_PHASE_DEFERRED for front-end work deferred until after
parsing is complete. The second phase has been renamed from TV_PHASE_CGRAPH
to TV_PHASE_OPT_GEN, to better reflect its use as the main optimization
and generation phase. This phase accounts for 70%-80% of compilation time
during bootstrap. The third phase is TV_PHASE_DBGINFO, except in cp/decl2.c,
where it is TV_PHASE_CHECK_DBGINFO because cc1plus mixes checking in with
debug info generation. In langhooks.c, write_global_declarations was
using TV_PHASE_CHECK_DBGINFO, but it was doing no checking. So, it now
uses TV_PHASE_DBGINFO.
The changes to LTO are significant. First, initialization now uses
TV_PHASE_SETUP. Reading files now uses TV_PHASE_STREAM_IN. Writing files
now uses TV_PHASE_STREAM_OUT. The remaining phase is TV_PHASE_OPT_GEN
(formerly TV_PHASE_CGRAPH). Finally, because LTO is treated as a front
end, TV_PHASE_PARSING and TV_PARSE_GLOBAL active around it. It is not
parsing, and so those timers should not be active. Rather than make all
front ends manage them, we turn them off as the first thing in LTO and turn
them back on as the last thing.
Tested on x86_64.
Index: gcc/ChangeLog
2012-06-18 Lawrence Crowl <crowl@google.com>
* timevar.def (TV_PHASE_GENERATE): Rename to TV_PHASE_LATE_ASM.
(TV_PHASE_CGRAPH): Rename to TV_PHASE_OPT_GEN.
(TV_PHASE_STREAM_IN): New.
(TV_PHASE_STREAM_OUT): New.
* timevar.c (validate_phases): New.
(timevar_print): Call validate_phases.
* c-decl.c (c_write_global_declarations): Rename use of TV_PHASE_CGRAPH
to TV_PHASE_OPT_GEN.
* langhooks.c (write_global_declarations): Rename use of
TV_PHASE_CGRAPH to TV_PHASE_OPT_GEN. Use TV_PHASE_DBGINFO instead of
TV_PHASE_CHECK_DBGINFO.
* toplev.c (compile_file): Rename use of TV_PHASE_GENERATE to
TV_PHASE_LATE_ASM. Move start of TV_PHASE_LATE_ASM to after call to
lang_hooks.decls.final_write_globals.
Index: gcc/cp/ChangeLog
2012-06-18 Lawrence Crowl <crowl@google.com>
* decl2.c (cp_write_global_declarations): Rename use of TV_PHASE_CGRAPH
to TV_PHASE_OPT_GEN.
Index: gcc/lto/ChangeLog
2012-06-18 Lawrence Crowl <crowl@google.com>
* lto.c (do_whole_program_analysis): Rename use of TV_PHASE_CGRAPH to
TV_PHASE_OPT_GEN. Use new timevar TV_PHASE_STREAM_OUT around the call
to lto_wpa_write_files.
(lto_main): Rename use of TV_PHASE_CGRAPH to TV_PHASE_OPT_GEN. Move
start of TV_PHASE_OPT_GEN to include call to materialize_cgraph. Use
TV_PHASE_SETUP for the call to lto_init. Use new timevar
TV_PHASE_STREAM_IN around the call to read_cgraph_and_symbols.
Turn TV_PHASE_PARSING off then back on again, because LTO is pretending
to be a front end, but is not one.
From-SVN: r188765
gcc/testsuite
2012-06-18 Joey Ye <Joey.Ye@arm.com>
Greta Yorsh <Greta.Yorsh@arm.com>
* gcc.target/arm/epilog-1.c: New test.
Co-Authored-By: Greta Yorsh <greta.yorsh@arm.com>
From-SVN: r188746
As a result of the previous changes, epilogue_insns pattern can only be
generated in Thumb1. After removing other cases in define_insn for
epilogue_insns, the function arm_output_epilogue becomes dead code and can
be eliminated, along with all its helper functions.
gcc/
2012-06-18 Ian Bolton <ian.bolton@arm.com>
Sameera Deshpande <sameera.deshpande@arm.com>
Greta Yorsh <greta.yorsh@arm.com>
* config/arm/arm-protos.h (arm_output_epilogue): Remove.
* config/arm/arm.c (print_multi_reg): Remove.
(vfp_output_fldmd): Likewise.
(arm_output_epilogue): Likewise.
* config/arm/arm.md (epilogue_insns): Update condition and code.
Co-Authored-By: Greta Yorsh <greta.yorsh@arm.com>
Co-Authored-By: Sameera Deshpande <sameera.deshpande@arm.com>
From-SVN: r188745
Add a new parameter to the function output_return_instruction to handle
simple cases of return when no epilogue needs to be printed out.
gcc/
2012-06-18 Ian Bolton <ian.bolton@arm.com>
Sameera Deshpande <sameera.deshpande@arm.com>
Greta Yorsh <greta.yorsh@arm.com>
* config/arm/arm-protos.h (output_return_instruction): New parameter and
int to bool change of parameter types.
* config/arm/arm.c (output_return_instruction): Likewise.
* config/arm/arm.md (arm_simple_return): New pattern.
(arm_return, cond_return, cond_return_inverted): Add new arguments.
* config/arm/thumb2.md (thumb2_return): Update condition and code.
Co-Authored-By: Greta Yorsh <greta.yorsh@arm.com>
Co-Authored-By: Sameera Deshpande <sameera.deshpande@arm.com>
From-SVN: r188743
Helper function for epilogue expansion. Emit RTL for APCS frame epilogue
(when -mapcs-frame command line option is specified).
This function is used by a later patch.
gcc/
2012-06-18 Ian Bolton <ian.bolton@arm.com>
Sameera Deshpande <sameera.deshpande@arm.com>
Greta Yorsh <greta.yorsh@arm.com>
* config/arm/arm.c (arm_expand_epilogue_apcs_frame): New function.
* config/arm/arm.md (arm_addsi3) Add an alternative.
Co-Authored-By: Greta Yorsh <greta.yorsh@arm.com>
Co-Authored-By: Sameera Deshpande <sameera.deshpande@arm.com>
From-SVN: r188741
New define insn pattern for epilogue with floating point registers (DFmode)
and a new function that emits RTL for this pattern. This function is a
helper for epilogue extension. It is used by a later patch.
gcc/
2012-06-18 Ian Bolton <ian.bolton@arm.com>
Sameera Deshpande <sameera.deshpande@arm.com>
Greta Yorsh <greta.yorsh@arm.com>
* config/arm/arm.md (vfp_pop_multiple_with_writeback) New
define_insn.
* config/arm/predicates.md (pop_multiple_fp) New special predicate.
* config/arm/arm.c (arm_emit_vfp_multi_reg_pop): New function.
Co-Authored-By: Greta Yorsh <greta.yorsh@arm.com>
Co-Authored-By: Sameera Deshpande <sameera.deshpande@arm.com>
From-SVN: r188740
registers.
The patterns can handle pop multiple with writeback and return (loading into
PC directly).
To handle return, the patterns use a new special predicate
pop_multiple_return, that uses ldm_stm_operation_p function from a previous
patch. To output assembly, the patterns use a new function
arm_output_multireg_pop.
This patch also adds a new function arm_emit_multi_reg_pop
that emits RTL that matches the new pop patterns for integer registers.
This is a helper function for epilogue expansion. It is used by a later
patch.
2012-06-18 Ian Bolton <ian.bolton@arm.com>
Sameera Deshpande <sameera.deshpande@arm.com>
Greta Yorsh <greta.yorsh@arm.com>
* config/arm/arm.md (load_multiple_with_writeback) New define_insn.
(load_multiple, pop_multiple_with_writeback_and_return) Likewise.
(pop_multiple_with_return, ldr_with_return) Likewise.
* config/arm/predicates.md (pop_multiple_return) New special predicate.
* config/arm/arm-protos.h (arm_output_multireg_pop) New declaration.
* config/arm/arm.c (arm_output_multireg_pop) New function.
(arm_emit_multi_reg_pop): New function.
Co-Authored-By: Greta Yorsh <greta.yorsh@arm.com>
Co-Authored-By: Sameera Deshpande <sameera.deshpande@arm.com>
From-SVN: r188739
This patch updates ldm_stm_operation_p to check for loads that if SP is in
the register list, then the base register is SP. It guarantees that SP is
reset correctly when an LDM instruction is interrupted. Otherwise, we might
end up with a corrupt stack.
gcc/
2012-06-18 Greta Yorsh <greta.yorsh@arm.com>
* config/arm/arm.c (ldm_stm_operation_p): Require SP
as base register for loads if SP is in the register list.
From-SVN: r188738
2012-06-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53693
* tree-vect-patterns.c (vect_operation_fits_smaller_type):
Reject operands with more than one use.
* g++.dg/torture/pr53693.C: New testcase.
From-SVN: r188733
2012-06-18 Richard Guenther <rguenther@suse.de>
* tree-vrp.c (extract_range_from_assert): Split out range
intersecting code.
(intersect_ranges): New function.
(vrp_intersect_ranges): Likewise.
From-SVN: r188728