gcc.git
7 years agoFix PR77489 -- mangling of discriminator >= 1
Markus Trippelsdorf [Wed, 18 Jan 2017 08:40:05 +0000 (08:40 +0000)]
Fix PR77489 -- mangling of discriminator >= 1

libiberty:

PR c++/77489
* cp-demangle.c (d_discriminator): Handle discriminator >= 10.
* testsuite/demangle-expected: Add tests for discriminator.

gcc:
PR c++/77489
* doc/invoke.texi (fabi-version): Document discriminator mangling.

gcc/cp:

PR c++/77489
* mangle.c (write_discriminator): Handle discriminator >= 10.

From-SVN: r244566

7 years agot-msp430 (LIB2ADD): Remove mpy.c
Joe Seymour [Wed, 18 Jan 2017 03:56:10 +0000 (03:56 +0000)]
t-msp430 (LIB2ADD): Remove mpy.c

libgcc/
* config/msp430/t-msp430 (LIB2ADD): Remove mpy.c
(mpy.o): New rule.
(libmul_none.a): Add mpy.o

gcc/testsuite/
* gcc.target/msp430/mul_f5_muldef.c: New test.

From-SVN: r244564

7 years agosyscall, golang_org/x/net/lif: fixes for gccgo on Solaris
Ian Lance Taylor [Wed, 18 Jan 2017 03:37:52 +0000 (03:37 +0000)]
syscall, golang_org/x/net/lif: fixes for gccgo on Solaris

    Reviewed-on: https://go-review.googlesource.com/35390

From-SVN: r244563

7 years agoCheck in gcc/testsuite/gcc.target/powerpc/ssp-[12].c (I forgot "svn add"
Segher Boessenkool [Wed, 18 Jan 2017 01:05:50 +0000 (02:05 +0100)]
Check in  gcc/testsuite/gcc.target/powerpc/ssp-[12].c  (I forgot "svn add"
once again).

From-SVN: r244562

7 years agore PR target/79004 (ICE in gcc.dg/torture/fp-int-convert-float128-ieee.c with -mcpu...
Michael Meissner [Wed, 18 Jan 2017 00:35:29 +0000 (00:35 +0000)]
re PR target/79004 (ICE in gcc.dg/torture/fp-int-convert-float128-ieee.c with -mcpu=power9)

2017-01-17  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/79004
* gcc.target/powerpc/pr79004.c: Add -mfloat128 to the test
options.  Fix up the syntax for using \m and \M.

From-SVN: r244561

7 years agoDaily bump.
GCC Administrator [Wed, 18 Jan 2017 00:16:21 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r244560

7 years agocrossconfig.m4: Add fuchsia OS.
Joshua Conner [Tue, 17 Jan 2017 23:36:12 +0000 (23:36 +0000)]
crossconfig.m4: Add fuchsia OS.

2017-01-17  Joshua Conner  <joshconner@google.com>

* crossconfig.m4: Add fuchsia OS.
* configure: Regenerate.

From-SVN: r244557

7 years ago-mstack-protector-guard and friends (PR78875)
Segher Boessenkool [Tue, 17 Jan 2017 22:02:42 +0000 (23:02 +0100)]
-mstack-protector-guard and friends (PR78875)

Currently, on PowerPC, code compiled with -fstack-protector will load
the canary from -0x7010(13) (for -m64) or from -0x7008(2) (for -m32)
if GCC was compiled against GNU libc 2.4 or newer or some other libc
that supports -fstack-protector, and from the global variable
__stack_chk_guard otherwise.

This does not work well for Linux and other OS kernels and similar.
For such non-standard applications, this patch creates a few new
command-line options.  The relevant new use cases are:

-mstack-protector-guard=global
Use the __stack_chk_guard variable, no matter how this GCC was
configured.

-mstack-protector-guard=tls
Use the canary from TLS.  This will error out if this GCC was built
with a C library that does not support it.

-mstack-protector-guard=tls -mstack-protector-register=<reg>
-mstack-protector-offset=<offset>
Load the canary from offset <off> from base register <reg>.

PR target/78875
* config/rs6000/rs6000-opts.h (stack_protector_guard): New enum.
* config/rs6000/rs6000.c (rs6000_option_override_internal): Handle
the new options.
* config/rs6000/rs6000.md (stack_protect_set): Handle the new more
flexible settings.
(stack_protect_test): Ditto.
* config/rs6000/rs6000.opt (mstack-protector-guard=,
mstack-protector-guard-reg=, mstack-protector-guard-offset=): New
options.
* doc/invoke.texi (Option Summary) [RS/6000 and PowerPC Options]:
Add -mstack-protector-guard=, -mstack-protector-guard-reg=, and
-mstack-protector-guard-offset=.
(RS/6000 and PowerPC Options): Ditto.

gcc/testsuite/
* gcc.target/powerpc/ssp-1.c: New testcase.
* gcc.target/powerpc/ssp-2.c: New testcase.

From-SVN: r244556

7 years agoi386.h (MASK_CLASS_P): New define.
Uros Bizjak [Tue, 17 Jan 2017 19:44:53 +0000 (20:44 +0100)]
i386.h (MASK_CLASS_P): New define.

* config/i386/i386.h (MASK_CLASS_P): New define.
* config/i386/i386.c (inline_secondary_memory_needed): Ensure that
there are no registers from different register sets also when
mask registers are used.  Update function comment.
* config/i386/i386.md (*movsi_internal): Split (*k/*krm) alternative
to (*k/*r) and (*k/*km) alternatives.

From-SVN: r244548

7 years agoThis patch simplifies the handling of EH return.
Wilco Dijkstra [Tue, 17 Jan 2017 19:34:26 +0000 (19:34 +0000)]
This patch simplifies the handling of EH return.

This patch simplifies the handling of EH return.  We force the use of the
frame pointer so the return location is always at FP + 8.  This means we
can emit a simple volatile access in EH_RETURN_HANDLER_RTX without needing md
patterns, splitters and frame offset calculations.  The new implementation also
fixes various bugs in aarch64_final_eh_return_addr, which does not work with
-fomit-frame-pointer, alloca or outgoing arguments.

    gcc/
* config/aarch64/aarch64.md (eh_return): Remove pattern and splitter.
* config/aarch64/aarch64.h (AARCH64_EH_STACKADJ_REGNUM): Remove.
(EH_RETURN_HANDLER_RTX): New define.
* config/aarch64/aarch64.c (aarch64_frame_pointer_required):
Force frame pointer in EH return functions.
(aarch64_expand_epilogue): Add barrier for eh_return.
(aarch64_final_eh_return_addr): Remove.
(aarch64_eh_return_handler_rtx): New function.
* config/aarch64/aarch64-protos.h (aarch64_final_eh_return_addr):
Remove.
(aarch64_eh_return_handler_rtx): New prototype.

    testsuite/
* gcc.target/aarch64/eh_return.c: New test.

From-SVN: r244547

7 years agoaltivec.h (vec_rlmi): New #define.
Bill Schmidt [Tue, 17 Jan 2017 19:14:09 +0000 (19:14 +0000)]
altivec.h (vec_rlmi): New #define.

[gcc]

2017-01-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

* config/rs6000/altivec.h (vec_rlmi): New #define.
(vec_vrlnm): Likewise.
(vec_rlnm): Likewise.
* config/rs6000/altivec.md (UNSPEC_VRLMI): New UNSPEC enum value.
(UNSPEC_VRLNM): Likewise.
(VIlong): New mode iterator.
(altivec_vrl<VI_char>mi): New define_insn.
(altivec_vrl<VI_char>nm): Likewise.
* config/rs6000/rs6000-builtin.def (VRLWNM): New monomorphic
function entry.
(VRLDNM): Likewise.
(RLNM): New polymorphic function entry.
(VRLWMI): New monomorphic function entry.
(VRLDMI): Likewise.
(RLMI): New polymorphic function entry.
* config/rs6000/r6000-c.c (altivec_overloaded_builtin_table): Add
new entries for P9V_BUILTIN_VEC_RLMI and P9V_BUILTIN_VEC_RLNM.
* doc/extend.texi: Add description of vec_rlmi, vec_rlnm, and
vec_vrlnm.

[gcc/testsuite]

2017-01-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

* vec-rlmi-rlnm.c: New file.

From-SVN: r244546

7 years agore PR debug/78839 (DWARF output different between GCC 5 and 6)
Jakub Jelinek [Tue, 17 Jan 2017 18:32:13 +0000 (19:32 +0100)]
re PR debug/78839 (DWARF output different between GCC 5 and 6)

PR debug/78839
* dwarf2out.c (field_byte_offset): Restore the
PCC_BITFIELD_TYPE_MATTERS behavior for INTEGER_CST DECL_FIELD_OFFSET
and DECL_FIELD_BIT_OFFSET.  Use fold_build2 instead of build2 + fold.
(analyze_variants_discr, gen_variant_part): Use fold_build2 instead
of build2 + fold.

From-SVN: r244545

7 years agore PR c++/61636 (generic lambda: segfault / "cannot call member function without...
Nathan Sidwell [Tue, 17 Jan 2017 18:22:34 +0000 (18:22 +0000)]
re PR c++/61636 (generic lambda: segfault / "cannot call member function without object")

PR c++/61636
* cp-tree.h (maybe_generic_this_capture): Declare.
* lambda.c (resolvable_dummy_lambda): New, broken out of ...
(maybe_resolve_dummy): ... here.  Call it.
(maybe_generic_this_capture): New.
* parser.c (cp_parser_postfix_expression): Speculatively capture
this in generic lambda in unresolved member function call.
* pt.c (tsubst_copy_and_build): Force hard error from failed
member function lookup in generic lambda.

PR c++/61636
* g++.dg/cpp1y/pr61636-1.C: New.
* g++.dg/cpp1y/pr61636-2.C: New.
* g++.dg/cpp1y/pr61636-3.C: New.

From-SVN: r244544

7 years agore PR ada/67205 (eliminate No_Implicit_Dynamic_Code restriction violations)
Eric Botcazou [Tue, 17 Jan 2017 18:02:55 +0000 (18:02 +0000)]
re PR ada/67205 (eliminate No_Implicit_Dynamic_Code restriction violations)

PR ada/67205
* config/aarch64/aarch64.c (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Define

From-SVN: r244543

7 years agore PR debug/71669 (DW_AT_data_bit_offset is not emitted for dwarf4 and above)
Jakub Jelinek [Tue, 17 Jan 2017 17:42:06 +0000 (18:42 +0100)]
re PR debug/71669 (DW_AT_data_bit_offset is not emitted for dwarf4 and above)

PR debug/71669
* dwarf2out.c (add_data_member_location_attribute): For constant
offset bitfield emit for -gdwarf-5 DW_AT_data_bit_offset attribute
instead of DW_AT_data_member_location, DW_AT_bit_offset and
DW_AT_byte_size attributes.

From-SVN: r244542

7 years agors6000.c (rs6000_emit_move): Also use a TOC reference after forcing to constant memor...
Eric Botcazou [Tue, 17 Jan 2017 17:33:43 +0000 (17:33 +0000)]
rs6000.c (rs6000_emit_move): Also use a TOC reference after forcing to constant memory when...

* config/rs6000/rs6000.c (rs6000_emit_move): Also use a TOC reference
after forcing to constant memory when the code model is medium.

From-SVN: r244541

7 years agore PR target/76731 ([AVX512] _mm512_i32gather_epi32 and other scatter/gather routines...
Julia Koval [Tue, 17 Jan 2017 17:03:00 +0000 (18:03 +0100)]
re PR target/76731 ([AVX512] _mm512_i32gather_epi32 and other scatter/gather routines have incorrect signature)

PR target/76731
* config/i386/avx512fintrin.h
(_mm512_i32gather_ps): Change __addr type to void const*.
(_mm512_mask_i32gather_ps): Ditto.
(_mm512_i32gather_pd): Ditto.
(_mm512_mask_i32gather_pd): Ditto.
(_mm512_i64gather_ps): Ditto.
(_mm512_mask_i64gather_ps): Ditto.
(_mm512_i64gather_pd): Ditto.
(_mm512_mask_i64gather_pd): Ditto.
(_mm512_i32gather_epi32): Ditto.
(_mm512_mask_i32gather_epi32): Ditto.
(_mm512_i32gather_epi64): Ditto.
(_mm512_mask_i32gather_epi64): Ditto.
(_mm512_i64gather_epi32): Ditto.
(_mm512_mask_i64gather_epi32): Ditto.
(_mm512_i64gather_epi64): Ditto.
(_mm512_mask_i64gather_epi64): Ditto.
(_mm512_i32scatter_ps): Change __addr type to void*.
(_mm512_mask_i32scatter_ps): Ditto.
(_mm512_i32scatter_pd): Ditto.
(_mm512_mask_i32scatter_pd): Ditto.
(_mm512_i64scatter_ps): Ditto.
(_mm512_mask_i64scatter_ps): Ditto.
(_mm512_i64scatter_pd): Ditto.
(_mm512_mask_i64scatter_pd): Ditto.
(_mm512_i32scatter_epi32): Ditto.
(_mm512_mask_i32scatter_epi32): Ditto.
(_mm512_i32scatter_epi64): Ditto.
(_mm512_mask_i32scatter_epi64): Ditto.
(_mm512_i64scatter_epi32): Ditto.
(_mm512_mask_i64scatter_epi32): Ditto.
(_mm512_i64scatter_epi64): Ditto.
(_mm512_mask_i64scatter_epi64): Ditto.
* config/i386/avx512pfintrin.h
(_mm512_mask_prefetch_i32gather_pd): Change __addr type to void const*.
(_mm512_mask_prefetch_i32gather_ps): Ditto.
(_mm512_mask_prefetch_i64gather_pd): Ditto.
(_mm512_mask_prefetch_i64gather_ps): Ditto.
(_mm512_prefetch_i32scatter_pd): Change __addr type to void*.
(_mm512_prefetch_i32scatter_ps): Ditto.
(_mm512_mask_prefetch_i32scatter_pd): Ditto.
(_mm512_mask_prefetch_i32scatter_ps): Ditto.
(_mm512_prefetch_i64scatter_pd): Ditto.
(_mm512_prefetch_i64scatter_ps): Ditto.
(_mm512_mask_prefetch_i64scatter_pd): Ditto.
(_mm512_mask_prefetch_i64scatter_ps): Ditto.
* config/i386/avx512vlintrin.h
(_mm256_mmask_i32gather_ps): Change __addr type to void const*.
(_mm_mmask_i32gather_ps): Ditto.
(_mm256_mmask_i32gather_pd): Ditto.
(_mm_mmask_i32gather_pd): Ditto.
(_mm256_mmask_i64gather_ps): Ditto.
(_mm_mmask_i64gather_ps): Ditto.
(_mm256_mmask_i64gather_pd): Ditto.
(_mm_mmask_i64gather_pd): Ditto.
(_mm256_mmask_i32gather_epi32): Ditto.
(_mm_mmask_i32gather_epi32): Ditto.
(_mm256_mmask_i32gather_epi64): Ditto.
(_mm_mmask_i32gather_epi64): Ditto.
(_mm256_mmask_i64gather_epi32): Ditto.
(_mm_mmask_i64gather_epi32): Ditto.
(_mm256_mmask_i64gather_epi64): Ditto.
(_mm_mmask_i64gather_epi64): Ditto.
(_mm256_i32scatter_ps): Change __addr type to void*.
(_mm256_mask_i32scatter_ps): Ditto.
(_mm_i32scatter_ps): Ditto.
(_mm_mask_i32scatter_ps): Ditto.
(_mm256_i32scatter_pd): Ditto.
(_mm256_mask_i32scatter_pd): Ditto.
(_mm_i32scatter_pd): Ditto.
(_mm_mask_i32scatter_pd): Ditto.
(_mm256_i64scatter_ps): Ditto.
(_mm256_mask_i64scatter_ps): Ditto.
(_mm_i64scatter_ps): Ditto.
(_mm_mask_i64scatter_ps): Ditto.
(_mm256_i64scatter_pd): Ditto.
(_mm256_mask_i64scatter_pd): Ditto.
(_mm_i64scatter_pd): Ditto.
(_mm_mask_i64scatter_pd): Ditto.
(_mm256_i32scatter_epi32): Ditto.
(_mm256_mask_i32scatter_epi32): Ditto.
(_mm_i32scatter_epi32): Ditto.
(_mm_mask_i32scatter_epi32): Ditto.
(_mm256_i32scatter_epi64): Ditto.
(_mm256_mask_i32scatter_epi64): Ditto.
(_mm_i32scatter_epi64): Ditto.
(_mm_mask_i32scatter_epi64): Ditto.
(_mm256_i64scatter_epi32): Ditto.
(_mm256_mask_i64scatter_epi32): Ditto.
(_mm_i64scatter_epi32): Ditto.
(_mm_mask_i64scatter_epi32): Ditto.
(_mm256_i64scatter_epi64): Ditto.
(_mm256_mask_i64scatter_epi64): Ditto.
(_mm_i64scatter_epi64): Ditto.
(_mm_mask_i64scatter_epi64): Ditto.
* config/i386/i386-builtin-types.def (V16SF_V16SF_PCFLOAT_V16SI_HI_INT)
(V8DF_V8DF_PCDOUBLE_V8SI_QI_INT, V8SF_V8SF_PCFLOAT_V8DI_QI_INT)
(V8DF_V8DF_PCDOUBLE_V8DI_QI_INT, V16SI_V16SI_PCINT_V16SI_HI_INT)
(V8DI_V8DI_PCINT64_V8SI_QI_INT, V8SI_V8SI_PCINT_V8DI_QI_INT)
(V8DI_V8DI_PCINT64_V8DI_QI_INT, V2DF_V2DF_PCDOUBLE_V4SI_QI_INT)
(V4DF_V4DF_PCDOUBLE_V4SI_QI_INT, V2DF_V2DF_PCDOUBLE_V2DI_QI_INT)
(V4DF_V4DF_PCDOUBLE_V4DI_QI_INT, V4SF_V4SF_PCFLOAT_V4SI_QI_INT)
(V8SF_V8SF_PCFLOAT_V8SI_QI_INT, V4SF_V4SF_PCFLOAT_V2DI_QI_INT)
(V4SF_V4SF_PCFLOAT_V4DI_QI_INT, V2DI_V2DI_PCINT64_V4SI_QI_INT)
(V4DI_V4DI_PCINT64_V4SI_QI_INT, V2DI_V2DI_PCINT64_V2DI_QI_INT)
(V4DI_V4DI_PCINT64_V4DI_QI_INT, V4SI_V4SI_PCINT_V4SI_QI_INT)
(V8SI_V8SI_PCINT_V8SI_QI_INT, V4SI_V4SI_PCINT_V2DI_QI_INT)
(V4SI_V4SI_PCINT_V4DI_QI_INT, VOID_PFLOAT_HI_V16SI_V16SF_INT)
(VOID_PFLOAT_QI_V8SI_V8SF_INT, VOID_PFLOAT_QI_V4SI_V4SF_INT)
(VOID_PDOUBLE_QI_V8SI_V8DF_INT, VOID_PDOUBLE_QI_V4SI_V4DF_INT)
(VOID_PDOUBLE_QI_V4SI_V2DF_INT, VOID_PFLOAT_QI_V8DI_V8SF_INT)
(VOID_PFLOAT_QI_V4DI_V4SF_INT, VOID_PFLOAT_QI_V2DI_V4SF_INT)
(VOID_PDOUBLE_QI_V8DI_V8DF_INT, VOID_PDOUBLE_QI_V4DI_V4DF_INT)
(VOID_PDOUBLE_QI_V2DI_V2DF_INT, VOID_PINT_HI_V16SI_V16SI_INT)
(VOID_PINT_QI_V8SI_V8SI_INT, VOID_PINT_QI_V4SI_V4SI_INT)
(VOID_PLONGLONG_QI_V8SI_V8DI_INT, VOID_PLONGLONG_QI_V4SI_V4DI_INT)
(VOID_PLONGLONG_QI_V4SI_V2DI_INT, VOID_PINT_QI_V8DI_V8SI_INT)
(VOID_PINT_QI_V4DI_V4SI_INT, VOID_PINT_QI_V2DI_V4SI_INT)
(VOID_PLONGLONG_QI_V8DI_V8DI_INT, VOID_QI_V8SI_PCINT64_INT_INT)
(VOID_PLONGLONG_QI_V4DI_V4DI_INT, VOID_PLONGLONG_QI_V2DI_V2DI_INT)
(VOID_HI_V16SI_PCINT_INT_INT, VOID_QI_V8DI_PCINT64_INT_INT)
(VOID_QI_V8DI_PCINT_INT_INT): Remove.
(V16SF_V16SF_PCVOID_V16SI_HI_INT,  V8DF_V8DF_PCVOID_V8SI_QI_INT)
(V8SF_V8SF_PCVOID_V8DI_QI_INT, V8DF_V8DF_PCVOID_V8DI_QI_INT)
(V16SI_V16SI_PCVOID_V16SI_HI_INT, V8DI_V8DI_PCVOID_V8SI_QI_INT)
(V8SI_V8SI_PCVOID_V8DI_QI_INT, V8DI_V8DI_PCVOID_V8DI_QI_INT)
(VOID_PVOID_HI_V16SI_V16SF_INT, VOID_PVOID_QI_V8SI_V8DF_INT)
(VOID_PVOID_QI_V8DI_V8SF_INT, VOID_PVOID_QI_V8DI_V8DF_INT)
(VOID_PVOID_HI_V16SI_V16SI_INT, VOID_PVOID_QI_V8SI_V8DI_INT)
(VOID_PVOID_QI_V8DI_V8SI_INT, VOID_PVOID_QI_V8DI_V8DI_INT)
(V2DF_V2DF_PCVOID_V4SI_QI_INT, V4DF_V4DF_PCVOID_V4SI_QI_INT)
(V2DF_V2DF_PCVOID_V2DI_QI_INT, V4DF_V4DF_PCVOID_V4DI_QI_INT
(V4SF_V4SF_PCVOID_V4SI_QI_INT, V8SF_V8SF_PCVOID_V8SI_QI_INT)
(V4SF_V4SF_PCVOID_V2DI_QI_INT, V4SF_V4SF_PCVOID_V4DI_QI_INT)
(V2DI_V2DI_PCVOID_V4SI_QI_INT, V4DI_V4DI_PCVOID_V4SI_QI_INT)
(V2DI_V2DI_PCVOID_V2DI_QI_INT, V4DI_V4DI_PCVOID_V4DI_QI_INT)
(V4SI_V4SI_PCVOID_V4SI_QI_INT, V8SI_V8SI_PCVOID_V8SI_QI_INT)
(V4SI_V4SI_PCVOID_V2DI_QI_INT, V4SI_V4SI_PCVOID_V4DI_QI_INT)
(VOID_PVOID_QI_V8SI_V8SF_INT, VOID_PVOID_QI_V4SI_V4SF_INT)
(VOID_PVOID_QI_V4SI_V4DF_INT, VOID_PVOID_QI_V4SI_V2DF_INT)
(VOID_PVOID_QI_V4DI_V4SF_INT, VOID_PVOID_QI_V2DI_V4SF_INT)
(VOID_PVOID_QI_V4DI_V4DF_INT, VOID_PVOID_QI_V2DI_V2DF_INT)
(VOID_PVOID_QI_V8SI_V8SI_INT, VOID_PVOID_QI_V4SI_V4SI_INT)
(VOID_PVOID_QI_V4SI_V4DI_INT, VOID_PVOID_QI_V4SI_V2DI_INT)
(VOID_PVOID_QI_V4DI_V4SI_INT, VOID_PVOID_QI_V2DI_V4SI_INT)
(VOID_PVOID_QI_V4DI_V4DI_INT, VOID_PVOID_QI_V2DI_V2DI_INT)
(VOID_QI_V8SI_PCVOID_INT_INT, VOID_HI_V16SI_PCVOID_INT_INT)
(VOID_QI_V8DI_PCVOID_INT_INT): Add.
* config/i386/i386.c (ix86_init_mmx_sse_builtins): Adjust builtin
definitions accordingly.

From-SVN: r244540

7 years agore PR target/79079 ([6] Wrong code gen for __builtin_mul_overflow when TRULY_NOOP_TRU...
Kito Cheng [Tue, 17 Jan 2017 16:56:30 +0000 (16:56 +0000)]
re PR target/79079 ([6] Wrong code gen for __builtin_mul_overflow when TRULY_NOOP_TRUNCATION (32, 64) == false)

PR target/79079
* internal-fn.c (expand_mul_overflow): Use convert_modes instead of
gen_lowpart.

Co-Authored-By: Kuan-Lin Chen <kuanlinchentw@gmail.com>
From-SVN: r244539

7 years agore PR c++/70565 (ICE at gimplify.c:8832 (cilkplus array extension))
Aldy Hernandez [Tue, 17 Jan 2017 16:54:55 +0000 (16:54 +0000)]
re PR c++/70565 (ICE at gimplify.c:8832 (cilkplus array extension))

PR c++/70565
* cp-array-notation.c (expand_array_notation_exprs): Handle
OMP_PARALLEL.

From-SVN: r244538

7 years agoPR testsuite/79115 - FAIL: gcc.dg/pr78768.c execution test on arm, aarch64
Martin Sebor [Tue, 17 Jan 2017 16:36:55 +0000 (16:36 +0000)]
PR testsuite/79115 - FAIL: gcc.dg/pr78768.c execution test on arm, aarch64

gcc/testsuite/ChangeLog
* gcc.dg/pr78768.c: Make it a link-only test.

From-SVN: r244537

7 years agoFix wording of -Wmisleading-indentation (PR c++/71497)
David Malcolm [Tue, 17 Jan 2017 16:33:44 +0000 (16:33 +0000)]
Fix wording of -Wmisleading-indentation (PR c++/71497)

gcc/c-family/ChangeLog:
PR c++/71497
* c-indentation.c (warn_for_misleading_indentation): Use the past
subjunctive in the note.

gcc/testsuite/ChangeLog:
PR c++/71497
* c-c++-common/Wmisleading-indentation-3.c: Update wording of
expected messages.
* c-c++-common/Wmisleading-indentation.c: Likewise.

From-SVN: r244536

7 years agore PR target/79058 (ARM: internal compiler error: in extract_constrain_insn, at recog...
Vladimir Makarov [Tue, 17 Jan 2017 16:11:55 +0000 (16:11 +0000)]
re PR target/79058 (ARM: internal compiler error: in extract_constrain_insn, at recog.c:2213)

2017-01-17  Vladimir Makarov  <vmakarov@redhat.com>

PR target/79058
* ira-conflicts.c (ira_build_conflicts): Update total conflict
hard regs for inner regno.

2017-01-17  Vladimir Makarov  <vmakarov@redhat.com>

PR target/79058
* gcc.target/arm/pr79058.c: New.

From-SVN: r244535

7 years agore PR tree-optimization/71854 (ICE at -O3 in both 32-bit and 64-bit modes on x86_64...
Jakub Jelinek [Tue, 17 Jan 2017 15:50:24 +0000 (16:50 +0100)]
re PR tree-optimization/71854 (ICE at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu (verify_gimple failed))

PR tree-optimization/71854
* gcc.dg/vect/pr71854.c: New test.

From-SVN: r244534

7 years agore PR c/79116 (ICE on cilkplus array notation with a _Cilk_for)
Aldy Hernandez [Tue, 17 Jan 2017 15:27:18 +0000 (15:27 +0000)]
re PR c/79116 (ICE on cilkplus array notation with a _Cilk_for)

PR c/79116
* array-notation-common.c (cilkplus_extract_an_triplets): Convert
start type to integer_type.

From-SVN: r244533

7 years agoPR69699 document why __GLIBCXX__ macro is useless
Jonathan Wakely [Tue, 17 Jan 2017 15:26:11 +0000 (15:26 +0000)]
PR69699 document why __GLIBCXX__ macro is useless

PR libstdc++/69699
* doc/xml/manual/abi.xml (abi.versioning.history): Explain why the
_GLIBCXX__ macro is not useful. Remove redundant date information
and link to the GCC release timeline.
(abi.versioning.active): Move partial sentence into the previous
paragraph.
* doc/html/*: Regenerate.

From-SVN: r244532

7 years agoPR79114 use decayed type in std::throw_with_nested assertion
Jonathan Wakely [Tue, 17 Jan 2017 15:26:06 +0000 (15:26 +0000)]
PR79114 use decayed type in std::throw_with_nested assertion

PR libstdc++/79114
* libsupc++/nested_exception.h (throw_with_nested): Use decay instead
of remove_reference.
* testsuite/18_support/nested_exception/79114.cc: New test.

From-SVN: r244531

7 years agoFix wrong assumption in contains_type_p (PR ipa/71207).
Martin Liska [Tue, 17 Jan 2017 15:11:00 +0000 (16:11 +0100)]
Fix wrong assumption in contains_type_p (PR ipa/71207).

2017-01-17  Martin Liska  <mliska@suse.cz>

PR ipa/71207
* g++.dg/ipa/pr71207.C: New test.
2017-01-17  Martin Liska  <mliska@suse.cz>

PR ipa/71207
* ipa-polymorphic-call.c (contains_type_p): Fix wrong
assumption and add comment.

From-SVN: r244530

7 years agoipa-visibility.c (localize_node): New function, broken out of ...
Nathan Sidwell [Tue, 17 Jan 2017 15:04:50 +0000 (15:04 +0000)]
ipa-visibility.c (localize_node): New function, broken out of ...

* ipa-visibility.c (localize_node): New function, broken out of ...
(function_and_variable_visibility): ... here. Call it.

From-SVN: r244529

7 years agore PR tree-optimization/77445 (Performance drop after r239219 on coremark test)
Jan Hubicka [Tue, 17 Jan 2017 12:49:41 +0000 (13:49 +0100)]
re PR tree-optimization/77445 (Performance drop after r239219 on coremark test)

PR middle-end/77445
* tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges):
correctly set frequency of oudgoing edge.
(duplicate_thread_path): Fix profile updating.
* gcc.dg/tree-ssa/pr77445-2.c: New testcase.
* gcc.dg/tree-ssa/pr77445.c: New testcase.

From-SVN: r244528

7 years agossa-dse-2.C (size_t): Typedef to __SIZE_TYPE__ rather than long unsigned int.
Jakub Jelinek [Tue, 17 Jan 2017 10:14:40 +0000 (11:14 +0100)]
ssa-dse-2.C (size_t): Typedef to __SIZE_TYPE__ rather than long unsigned int.

* g++.dg/tree-ssa/ssa-dse-2.C (size_t): Typedef to __SIZE_TYPE__
rather than long unsigned int.
* g++.dg/tree-ssa/ssa-dom.C: Likewise.

From-SVN: r244527

7 years agohsa.h: Add GCC runtime library exception.
Jakub Jelinek [Tue, 17 Jan 2017 09:45:23 +0000 (10:45 +0100)]
hsa.h: Add GCC runtime library exception.

* plugin/hsa.h: Add GCC runtime library exception.
* plugin/hsa_ext_finalize.h: Likewise.

From-SVN: r244523

7 years agoconfigfrag.ac: For --without-cuda-driver don't initialize CUDA_DRIVER_INCLUDE nor...
Jakub Jelinek [Tue, 17 Jan 2017 09:44:17 +0000 (10:44 +0100)]
configfrag.ac: For --without-cuda-driver don't initialize CUDA_DRIVER_INCLUDE nor CUDA_DRIVER_LIB.

* plugin/configfrag.ac: For --without-cuda-driver don't initialize
CUDA_DRIVER_INCLUDE nor CUDA_DRIVER_LIB.  If both
CUDA_DRIVER_INCLUDE and CUDA_DRIVER_LIB are empty and linking small
cuda program fails, define PLUGIN_NVPTX_DYNAMIC to 1 and use
plugin/include/cuda as include dir and -ldl instead of -lcuda as
library to link ptx plugin against.
* plugin/plugin-nvptx.c: Include dlfcn.h if PLUGIN_NVPTX_DYNAMIC.
(CUDA_CALLS): Define.
(cuda_lib, cuda_lib_inited): New variables.
(init_cuda_lib): New function.
(CUDA_CALL_PREFIX): Define.
(CUDA_CALL_ERET, CUDA_CALL_ASSERT): Use CUDA_CALL_PREFIX.
(CUDA_CALL): Use FN instead of (FN).
(CUDA_CALL_NOCHECK): Define.
(cuda_error, fini_streams_for_device, select_stream_for_async,
nvptx_attach_host_thread_to_device, nvptx_open_device, link_ptx,
event_gc, nvptx_exec, nvptx_async_test, nvptx_async_test_all,
nvptx_wait_all, nvptx_set_clocktick, GOMP_OFFLOAD_unload_image,
nvptx_stacks_alloc, nvptx_stacks_free, GOMP_OFFLOAD_run): Use
CUDA_CALL_NOCHECK.
(nvptx_init): Call init_cuda_lib, if it fails, return false.  Use
CUDA_CALL_NOCHECK.
(nvptx_get_num_devices): Call init_cuda_lib, if it fails, return 0.
Use CUDA_CALL_NOCHECK.
* plugin/cuda/cuda.h: New file.
* config.h.in: Regenerated.
* configure: Regenerated.

From-SVN: r244522

7 years agore PR other/79046 (g++ -print-file-name=plugin uses full version number in path)
Jakub Jelinek [Tue, 17 Jan 2017 09:38:48 +0000 (10:38 +0100)]
re PR other/79046 (g++ -print-file-name=plugin uses full version number in path)

PR other/79046
* configure: Regenerated.
config/
* acx.m4 (GCC_BASE_VER): New m4 function.
(ACX_TOOL_DIRS): Require GCC_BASE_VER, for
--with-gcc-major-version-only use just major number from BASE-VER.
gcc/
* configure.ac: Add GCC_BASE_VER.
* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
version from BASE-VER file.
(CFLAGS-gcc.o): Add -DBASEVER=$(BASEVER_s).
(gcc.o): Depend on $(BASEVER).
* common.opt (dumpfullversion): New option.
* gcc.c (driver_handle_option): Handle OPT_dumpfullversion.
* doc/invoke.texi: Document -dumpfullversion.
* doc/install.texi: Document --with-gcc-major-version-only.
* configure: Regenerated.
libatomic/
* configure.ac: Add GCC_BASE_VER.
* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* testsuite/Makefile.in: Regenerated.
* configure: Regenerated.
* Makefile.in: Regenerated.
libgomp/
* configure.ac: Add GCC_BASE_VER.
* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* testsuite/Makefile.in: Regenerated.
* configure: Regenerated.
* Makefile.in: Regenerated.
libgcc/
* configure.ac: Add GCC_BASE_VER.
* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
version from BASE-VER file.
* configure: Regenerated.
libssp/
* configure.ac: Add GCC_BASE_VER.
* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* configure: Regenerated.
* Makefile.in: Regenerated.
liboffloadmic/
* configure.ac: Add GCC_BASE_VER.
* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* aclocal.m4: Include ../config/acx.m4.
* configure: Regenerated.
* Makefile.in: Regenerated.
libquadmath/
* configure.ac: Add GCC_BASE_VER.
* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* configure: Regenerated.
* Makefile.in: Regenerated.
libmpx/
* configure.ac: Add GCC_BASE_VER.
* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* configure: Regenerated.
* Makefile.in: Regenerated.
libada/
* configure.ac: Add GCC_BASE_VER.
* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
version from BASE-VER file.
* configure: Regenerated.
lto-plugin/
* configure.ac: Add GCC_BASE_VER.
* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* configure: Regenerated.
* Makefile.in: Regenerated.
libitm/
* configure.ac: Add GCC_BASE_VER.
* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* testsuite/Makefile.in: Regenerated.
* configure: Regenerated.
* Makefile.in: Regenerated.
fixincludes/
* configure.ac: Add GCC_BASE_VER.
* Makefile.in (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* configure: Regenerated.
libcilkrts/
* configure.ac: Add GCC_BASE_VER.
* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* aclocal.m4: Include ../config/acx.m4.
* configure: Regenerated.
* Makefile.in: Regenerated.
libcc1/
* configure.ac: Add GCC_BASE_VER.  For --with-gcc-major-version-only
use just major number from BASE-VER.
* configure: Regenerated.
* Makefile.in: Regenerated.
libobjc/
* configure.ac: Add GCC_BASE_VER.
* Makefile.in (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* configure: Regenerated.
libstdc++-v3/
* configure.ac: Add GCC_BASE_VER.
* fragment.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* po/Makefile.in: Regenerated.
* libsupc++/Makefile.in: Regenerated.
* testsuite/Makefile.in: Regenerated.
* src/Makefile.in: Regenerated.
* configure: Regenerated.
* Makefile.in: Regenerated.
* include/Makefile.in: Regenerated.
* doc/Makefile.in: Regenerated.
* python/Makefile.in: Regenerated.
* src/c++11/Makefile.in: Regenerated.
* src/c++98/Makefile.in: Regenerated.
* src/filesystem/Makefile.in: Regenerated.
libvtv/
* configure.ac: Add GCC_BASE_VER.
* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* testsuite/Makefile.in: Regenerated.
* configure: Regenerated.
* Makefile.in: Regenerated.
libsanitizer/
* configure.ac: Add GCC_BASE_VER.
* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* libbacktrace/Makefile.in: Regenerated.
* interception/Makefile.in: Regenerated.
* asan/Makefile.in: Regenerated.
* ubsan/Makefile.in: Regenerated.
* configure: Regenerated.
* sanitizer_common/Makefile.in: Regenerated.
* lsan/Makefile.in: Regenerated.
* Makefile.in: Regenerated.
* tsan/Makefile.in: Regenerated.
libgfortran/
* configure.ac: Add GCC_BASE_VER.
* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
get version from BASE-VER file.
* configure: Regenerated.
* Makefile.in: Regenerated.

From-SVN: r244521

7 years agore PR tree-optimization/71433 (-Warray-bounds false positive with -O2)
Richard Biener [Tue, 17 Jan 2017 08:38:59 +0000 (08:38 +0000)]
re PR tree-optimization/71433 (-Warray-bounds false positive with -O2)

2017-01-17  Richard Biener  <rguenther@suse.de>

PR tree-optimization/71433
* tree-vrp.c (register_new_assert_for): Merge same asserts
on all incoming edges.
(process_assert_insertions_for): Handle insertions at the
beginning of BBs.

* gcc.dg/Warray-bounds-20.c: New testcase.

From-SVN: r244520

7 years agore PR testsuite/52563 (FAIL: gcc.dg/tree-ssa/scev-[3,4].c scan-tree-dump-times optimi...
Richard Biener [Tue, 17 Jan 2017 08:24:26 +0000 (08:24 +0000)]
re PR testsuite/52563 (FAIL: gcc.dg/tree-ssa/scev-[3,4].c scan-tree-dump-times optimized "&a" 1)

2017-01-17  Richard Biener  <rguenther@suse.de>

PR testsuite/52563
PR testsuite/71237
PR testsuite/77737
* gcc.dg/tree-ssa/scev-3.c: Re-write to a GIMPLE testcase for IVOPTs.
* gcc.dg/tree-ssa/scev-4.c: Likewise.
* gcc.dg/tree-ssa/scev-5.c: Likewise.

From-SVN: r244519

7 years agogcc_update: Remove entries related to GCJ and libgcj.
Gerald Pfeifer [Tue, 17 Jan 2017 07:44:45 +0000 (07:44 +0000)]
gcc_update: Remove entries related to GCJ and libgcj.

* gcc_update: Remove entries related to GCJ and libgcj.
Complete copyright years and adjust my e-mail address.

From-SVN: r244518

7 years agocygwin.h (LIBGCJ_SONAME): Remove.
Gerald Pfeifer [Tue, 17 Jan 2017 07:23:40 +0000 (07:23 +0000)]
cygwin.h (LIBGCJ_SONAME): Remove.

* config/i386/cygwin.h (LIBGCJ_SONAME): Remove.
* config/i386/mingw32.h (LIBGCJ_SONAME): Remove.

From-SVN: r244517

7 years agore PR target/78633 ([SH] libgcc/fp-bit.c:944:1: error: invalid rtl sharing found...
Kaz Kojima [Tue, 17 Jan 2017 04:07:51 +0000 (04:07 +0000)]
re PR target/78633 ([SH] libgcc/fp-bit.c:944:1: error: invalid rtl sharing found in the insn)

PR target/78633
* config/sh/sh.md (cmpeqsi_t+1): Call copy_rtx to avoid invalid
RTL sharing.

From-SVN: r244516

7 years agoPR79066, non-PIC code generated for powerpc glibc with -fpic
Alan Modra [Tue, 17 Jan 2017 02:54:11 +0000 (13:24 +1030)]
PR79066, non-PIC code generated for powerpc glibc with -fpic

PR target/79066
* config/rs6000/rs6000.md (elf_high, elf_low): Disable when pic.
* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Don't allow
symbolic stack limit when pic.
testsuite/
* gcc.target/powerpc/pr79066.c: New.

From-SVN: r244515

7 years agoDaily bump.
GCC Administrator [Tue, 17 Jan 2017 00:16:15 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r244514

7 years agoPR tree-optimization/78608 - gimple-ssa-sprintf.c:570:17: runtime error: negation...
Martin Sebor [Tue, 17 Jan 2017 00:14:52 +0000 (00:14 +0000)]
PR tree-optimization/78608 - gimple-ssa-sprintf.c:570:17: runtime error: negation of -9223372036854775808 cannot be represented in type 'long int'

gcc/ChangeLog:
* gimple-ssa-sprintf.c (tree_digits): Avoid negating TYPE_MIN.

From-SVN: r244511

7 years agorevert: Makefile.in (PREPROCESSOR_DEFINES): Add a level of indirection for several...
Jeff Law [Mon, 16 Jan 2017 23:51:57 +0000 (16:51 -0700)]
revert: Makefile.in (PREPROCESSOR_DEFINES): Add a level of indirection for several include directories that may be relative...

Revert:
2016-12-02  Tadek Kijkowski  <tkijkowski@gmail.com>
        * Makefile.in (PREPROCESSOR_DEFINES): Add a level of indirection
        for several include directories that may be relative to sysroot.
        * config/i386/x-mingw32 (gplus_includedir): Define.
        (gplus_tool_includedir, gplus_backward_include_dir): Likewise.
        (native_system_includedir): Likewise.
        * config/i386/mingw32.h (STANDARD_STARTFILE_PREFIX_1): Do not
        override if TARGET_SYSTEM_ROOT is defined.
        (NATIVE_SYSTEM_HEADER_DIR): Likewise.

From-SVN: r244510

7 years agore PR tree-optimization/79090 (DSE wrongly removes store at variable offset)
Jeff Law [Mon, 16 Jan 2017 23:43:05 +0000 (16:43 -0700)]
re PR tree-optimization/79090 (DSE wrongly removes store at variable offset)

2017-01-16  Jeff Law  <law@redhat.com>

PR tree-optimization/79090
PR tree-optimization/33562
PR tree-optimization/61912
PR tree-optimization/77485
* tree-ssa-dse.c (compute_trims): Accept STMT argument.  Dump STMT
and computed trims into the dump file.

PR tree-optimization/79090
PR tree-optimization/33562
PR tree-optimization/61912
PR tree-optimization/77485
* tree-ssa-dse.c (compute_trims): Accept STMT argument.  Dump STMT
and computed trims into the dump file.

From-SVN: r244509

7 years agoi386.h (LIMIT_RELOAD_CLASS): Remove.
Uros Bizjak [Mon, 16 Jan 2017 23:18:30 +0000 (00:18 +0100)]
i386.h (LIMIT_RELOAD_CLASS): Remove.

* config/i386/i386.h (LIMIT_RELOAD_CLASS): Remove.

From-SVN: r244508

7 years agore PR middle-end/79089 (error: incorrect sharing of tree nodes)
Jakub Jelinek [Mon, 16 Jan 2017 21:35:30 +0000 (22:35 +0100)]
re PR middle-end/79089 (error: incorrect sharing of tree nodes)

PR c/79089
* gimplify.c (gimplify_init_constructor): If want_value and
object == lhs, unshare lhs to avoid invalid tree sharing.  Formatting
fix.

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

From-SVN: r244507

7 years agore PR target/79080 (ICE: internal consistency failure (error: invalid rtl sharing...
Jakub Jelinek [Mon, 16 Jan 2017 21:34:35 +0000 (22:34 +0100)]
re PR target/79080 (ICE: internal consistency failure (error: invalid rtl sharing found in the insn) (error: shared rtx))

PR target/79080
* loop-doloop.c (doloop_modify): Call unshare_all_rtl_in_chain on
sequence.  Formatting fixes.
(doloop_optimize): Formatting fixes.

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

From-SVN: r244506

7 years agore PR driver/49726 (-g0 file.S -g does not produce debug info)
Jakub Jelinek [Mon, 16 Jan 2017 21:33:07 +0000 (22:33 +0100)]
re PR driver/49726 (-g0 file.S -g does not produce debug info)

PR driver/49726
* gcc.c (debug_level_greater_than_spec_func): New function.
(static_spec_functions): Add debug-level-gt spec function.
(ASM_DEBUG_SPEC, cpp_options): Use %:debug-level-gt(0) instead of
!g0.
* config/darwin.h (DSYMUTIL_SPEC, ASM_DEBUG_SPEC): Likewise.
* config/darwin9.h (DSYMUTIL_SPEC, ASM_DEBUG_SPEC): Likewise.
* common.opt (g, gcoff, gdwarf, gdwarf-, ggdb, gno-pubnames,
gpubnames, ggnu-pubnames, gno-record-gcc-switches,
grecord-gcc-switches, gno-strict-dwarf, gstrict-dwarf, gstabs,
gstabs+, gtoggle, gvms, gxcoff, gxcoff+): Add Driver flag.
c-family/
* c.opt (gen-decls): Add Driver flag.
ada/
* gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.

From-SVN: r244505

7 years agoi386.h (HARD_REGNO_CALLER_SAVE_MODE): Apply HImode and QImode fixups to general and...
Uros Bizjak [Mon, 16 Jan 2017 19:58:59 +0000 (20:58 +0100)]
i386.h (HARD_REGNO_CALLER_SAVE_MODE): Apply HImode and QImode fixups to general and mask registers only.

* config/i386/i386.h (HARD_REGNO_CALLER_SAVE_MODE): Apply HImode and
QImode fixups to general and mask registers only.

From-SVN: r244504

7 years ago* sv.po: Update.
Joseph Myers [Mon, 16 Jan 2017 18:20:23 +0000 (18:20 +0000)]
* sv.po: Update.

From-SVN: r244503

7 years agoFix testcases for PR c/78304
David Malcolm [Mon, 16 Jan 2017 18:08:45 +0000 (18:08 +0000)]
Fix testcases for PR c/78304

The testcases as written made assumptions about size_t and long
being invalid for use with "%u".

We only need some invalid type, so this patch converts them to
attempt a "const char *" with "%u", which should be invalid for
every target.

gcc/testsuite/ChangeLog:
PR c/78304
* gcc.dg/format/pr78304.c: Convert argument from integral type
to a pointer.
* gcc.dg/format/pr78304-2.c: Likewise.

From-SVN: r244502

7 years agors6000-c (altivec_overloaded_builtins): Add support for built-in functions vector...
Carl Love [Mon, 16 Jan 2017 17:18:05 +0000 (17:18 +0000)]
rs6000-c (altivec_overloaded_builtins): Add support for built-in functions vector signed char vec_nabs (vector signed...

gcc/ChangeLog:

2017-01-16  Carl Love  <cel@us.ibm.com>

* config/rs6000/rs6000-c (altivec_overloaded_builtins): Add support
for built-in functions
vector signed char vec_nabs (vector signed char)
vector signed short vec_nabs (vector signed short)
vector signed int vec_nabs (vector signed int)
vector signed long long vec_nabs (vector signed long long)
vector float vec_nabs (vector float)
vector double vec_nabs (vector double)
* config/rs6000/rs6000-builtin.def: Add definitions for NABS functions
and NABS overload.
* config/rs6000/altivec.md: New define_expand nabs<mode>2 types
* config/rs6000/altivec.h: New define for vec_nabs built-in function.
* doc/extend.texi: Update the documentation file for the new built-in
functions.

gcc/testsuite/ChangeLog:

2017-01-16  Carl Love  <cel@us.ibm.com>

* gcc.target/powerpc/builtins-3.c: New vec_nabs testcase.
* gcc.target/powerpc/builtins-3-p8.c: New vec_nabs testcase.

From-SVN: r244501

7 years agogimple-ssa-sprintf.c (format_directive): Correct a typo in a warning message.
Martin Sebor [Mon, 16 Jan 2017 17:08:42 +0000 (17:08 +0000)]
gimple-ssa-sprintf.c (format_directive): Correct a typo in a warning message.

gcc/ChangeLog:
* gimple-ssa-sprintf.c (format_directive): Correct a typo in a warning
message.

From-SVN: r244500

7 years agobuiltins-3-p9.c (test_ne_long()): Change arguments and return type to bool long long.
Carl Love [Mon, 16 Jan 2017 17:03:14 +0000 (17:03 +0000)]
builtins-3-p9.c (test_ne_long()): Change arguments and return type to bool long long.

gcc/testsuite/ChangeLog:

2017-01-16 Carl Love  <cel@us.ibm.com>

* gcc.target/powerpc/builtins-3-p9.c (test_ne_long()):
Change arguments and return type to bool long long.

From-SVN: r244499

7 years agoPR66145 use new ABI for std::ios::failure exceptions
Jonathan Wakely [Mon, 16 Jan 2017 15:58:06 +0000 (15:58 +0000)]
PR66145 use new ABI for std::ios::failure exceptions

PR libstdc++/66145
* src/c++11/functexcept.cc: Use new ABI for std::ios_base::failure
exceptions.
* testsuite/27_io/basic_ios/copyfmt/char/1.cc: Don't override ABI
for test, so new ios::failure can be caught.
* testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/
exceptions_failbit.cc: Likewise.
* testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/
exceptions_failbit.cc: Likewise.
* testsuite/27_io/basic_istream/extractors_other/char/
exceptions_null.cc: Likewise.
* testsuite/27_io/basic_istream/extractors_other/wchar_t/
exceptions_null.cc: Likewise.
* testsuite/27_io/basic_istream/sentry/char/12297.cc: Likewise.
* testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_other/char/
exceptions_null.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_other/wchar_t/
exceptions_null.cc: Likewise.
* testsuite/27_io/ios_base/storage/2.cc: Likewise.

From-SVN: r244498

7 years agoPR testsuite/79051 - FAIL: gcc.dg/attr-alloc_size-4.c (test for warnings, line 140)
Martin Sebor [Mon, 16 Jan 2017 15:50:47 +0000 (15:50 +0000)]
PR testsuite/79051 - FAIL: gcc.dg/attr-alloc_size-4.c (test for warnings, line 140)

gcc/testsuite/ChangeLog:
* gcc.dg/attr-alloc_size-4.c: Avoid exercising a test case except
on x86.

From-SVN: r244497

7 years agorevert: re PR c++/71737 (ICE following 2x pack expansion in non-pack with template...
Paolo Carlini [Mon, 16 Jan 2017 15:43:06 +0000 (15:43 +0000)]
revert: re PR c++/71737 (ICE following 2x pack expansion in non-pack with template alias)

/c-family
2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

Revert:
      2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/71737
* c-common.c (set_underlying_type): Always set DECL_ORIGINAL_TYPE.

/testsuite
2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

Revert:
        2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/71737
* g++.dg/cpp0x/pr71737.C: New.

From-SVN: r244496

7 years agors6000.c (rtx_is_swappable_p): Change UNSPEC_VSX__XXSPLTD to require special splat...
Bill Schmidt [Mon, 16 Jan 2017 15:05:35 +0000 (15:05 +0000)]
rs6000.c (rtx_is_swappable_p): Change UNSPEC_VSX__XXSPLTD to require special splat handling.

[gcc]

2017-01-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

* config/rs6000/rs6000.c (rtx_is_swappable_p): Change
UNSPEC_VSX__XXSPLTD to require special splat handling.

[gcc/testsuite]

2017-01-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

* gcc.target/powerpc/swaps-p8-27.c: New.

From-SVN: r244495

7 years agosystem.h: Poison strndup (PR bootstrap/78616)
David Malcolm [Mon, 16 Jan 2017 15:03:41 +0000 (15:03 +0000)]
system.h: Poison strndup (PR bootstrap/78616)

gcc/ChangeLog:
PR bootstrap/78616
* system.h: Poison strndup.

From-SVN: r244494

7 years agoPR78702 fix accessibility of locale::facet::__shim
Jonathan Wakely [Mon, 16 Jan 2017 11:41:41 +0000 (11:41 +0000)]
PR78702 fix accessibility of locale::facet::__shim

PR libstdc++/78702
* include/bits/locale_classes.h (locale::facet::__shim): Change from
private to protected.
* src/c++11/cxx11-shim_facets.cc (__shim_accessor): Define helper to
make locale::facet::__shim accessible.

From-SVN: r244491

7 years agoPR libstdc++/78389 fix backwards size adjustments.
Ville Voutilainen [Mon, 16 Jan 2017 11:36:33 +0000 (13:36 +0200)]
PR libstdc++/78389 fix backwards size adjustments.

PR libstdc++/78389
* include/bits/list.tcc (merge(list&&)): Fix backwards size adjustments.
(merge(list&&, _StrictWeakOrdering)): Likewise.
* testsuite/23_containers/list/operations/78389.cc: Add
better test for the sizes.

From-SVN: r244490

7 years agoPowerpc bootstrap failure due to duplicate case value
Alan Modra [Mon, 16 Jan 2017 11:12:57 +0000 (21:42 +1030)]
Powerpc bootstrap failure due to duplicate case value

PR target/79098
* config/rs6000/rs6000.c (rs6000_legitimate_combined_insn): Don't
use a switch.

From-SVN: r244489

7 years agoavr.h (BRANCH_COST): Increase by 4.
Georg-Johann Lay [Mon, 16 Jan 2017 09:48:45 +0000 (09:48 +0000)]
avr.h (BRANCH_COST): Increase by 4.

gcc/
* config/avr/avr.h (BRANCH_COST) [reload_completed]: Increase by 4.

From-SVN: r244488

7 years agore PR tree-optimization/77283 (Revision 238005 disables loop unrolling)
Richard Biener [Mon, 16 Jan 2017 09:33:12 +0000 (09:33 +0000)]
re PR tree-optimization/77283 (Revision 238005 disables loop unrolling)

2017-01-13  Richard Biener  <rguenther@suse.de>

PR tree-optimization/77283
* gimple-ssa-split-paths.c: Include gimple-ssa.h, tree-phinodes.h
and ssa-iterators.h.
(is_feasible_trace): Implement a cost model based on joiner
PHI node uses.

* gcc.dg/tree-ssa/split-path-7.c: Adjust.
* gcc.dg/tree-ssa/split-path-8.c: New testcase.
* gcc.dg/tree-ssa/split-path-9.c: Likewise.

From-SVN: r244487

7 years agore PR c++/71737 (ICE following 2x pack expansion in non-pack with template alias)
Paolo Carlini [Mon, 16 Jan 2017 09:09:30 +0000 (09:09 +0000)]
re PR c++/71737 (ICE following 2x pack expansion in non-pack with template alias)

/c-family
2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/71737
* c-common.c (set_underlying_type): Always set DECL_ORIGINAL_TYPE.

/testsuite
2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/71737
* g++.dg/cpp0x/pr71737.C: New.

From-SVN: r244486

7 years agoopt62.adb: New test.
Eric Botcazou [Mon, 16 Jan 2017 08:46:20 +0000 (08:46 +0000)]
opt62.adb: New test.

* gnat.dg/opt62.adb: New test.
* gnat.dg/opt62_pkg.ads: New helper.

From-SVN: r244485

7 years agoruntime: rename siginfo to _siginfo_t
Ian Lance Taylor [Mon, 16 Jan 2017 01:21:42 +0000 (01:21 +0000)]
runtime: rename siginfo to _siginfo_t

    Since the name siginfo winds up in runtime.inc, this avoids a name
    collision on systems that define "struct siginfo" in the system header
    files.

    Reviewed-on: https://go-review.googlesource.com/35239

From-SVN: r244484

7 years agolibgo: correct golang_org Makefile variables not used on all systems
Ian Lance Taylor [Mon, 16 Jan 2017 01:05:10 +0000 (01:05 +0000)]
libgo: correct golang_org Makefile variables not used on all systems

    Patch by Rainer Orth.

    Reviewed-on: https://go-review.googlesource.com/35238

From-SVN: r244483

7 years agoDaily bump.
GCC Administrator [Mon, 16 Jan 2017 00:16:21 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r244482

7 years agoi386.c (ix86_legitimate_combined_insn): Do not call recog here.
Uros Bizjak [Sun, 15 Jan 2017 18:42:29 +0000 (19:42 +0100)]
i386.c (ix86_legitimate_combined_insn): Do not call recog here.

* config/i386/i386.c (ix86_legitimate_combined_insn): Do not
call recog here.  Assert that INSN_CODE (insn) is non-negative.

From-SVN: r244478

7 years agoMake rtl_split_edge work for jumps that fall through (PR72749)
Segher Boessenkool [Sun, 15 Jan 2017 17:06:00 +0000 (18:06 +0100)]
Make rtl_split_edge work for jumps that fall through (PR72749)

If a jump always falls through but that cannot be optimised away, like
is the case with the PowerPC bdnz insn if its jump target is the same as
the fallthrough, sched gets confused if it schedules some instructions
from before that jump instruction to behind it: it splits the
fallthrough branch, but the jump target isn't updated, and things fall
apart as in the PR.  This patch fixes it.

The second patch fragment makes -fsched-verbose=N work for N>=4; the
currently scheduled fragment can now contain a label.  Everything else
seems to work fine with that.

PR target/72749
* cfgrtl.c (rtl_split_edge): Also patch jump insns that jump to the
fallthrough.
* haifa-sched.c (dump_insn_stream): Don't crash if there is a label
in the currently scheduled RTL fragment.

From-SVN: r244477

7 years agoifcvt: Don't make invalid insns for a cond trap (PR78751)
Segher Boessenkool [Sun, 15 Jan 2017 17:03:55 +0000 (18:03 +0100)]
ifcvt: Don't make invalid insns for a cond trap (PR78751)

As shown in the PR, ifcvt will happily make invalid insns when given the
chance.  This patch teaches it some manners.

PR rtl-optimization/78751
* ifcvt.c (find_cond_trap): If we generated a non-existing insn,
give up.

From-SVN: r244476

7 years agore PR tree-optimization/79090 (DSE wrongly removes store at variable offset)
Jeff Law [Sun, 15 Jan 2017 09:34:01 +0000 (02:34 -0700)]
re PR tree-optimization/79090 (DSE wrongly removes store at variable offset)

PR tree-optimization/79090
* tree-ssa-dse.c (valid_ao_ref_for_dse): Reject zero length and
variable length stores.
(compute_trims): Delete dead assignment to *trim_tail.
(dse_dom_walker::dse_optimize_stmt): Optimize mem* calls with
zero length.

From-SVN: r244472

7 years agoDaily bump.
GCC Administrator [Sun, 15 Jan 2017 00:16:21 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r244471

7 years ago* fr.po: Update.
Joseph Myers [Sun, 15 Jan 2017 00:03:19 +0000 (00:03 +0000)]
* fr.po: Update.

From-SVN: r244468

7 years agore PR rtl-optimization/78626 (ICE in rtl_verify_bb_insns, at cfgrtl.c:2656 (error...
Bernd Schmidt [Sat, 14 Jan 2017 16:52:18 +0000 (09:52 -0700)]
re PR rtl-optimization/78626 (ICE in rtl_verify_bb_insns, at cfgrtl.c:2656 (error: flow control insn inside a basic block))

PR rtl-optimization/78626
PR rtl-optimization/78727
* cprop.c (one_cprop_pass): Collect unconditional traps in the middle
of a block, and split such blocks after everything else is finished.

        PR rtl-optimization/78626
        PR rtl-optimization/78727
* gcc.dg/torture/pr78626.c: New test.
* gcc.dg/torture/pr78727.c: New test.

From-SVN: r244467

7 years agoTestcase from pr72749
Alan Modra [Sat, 14 Jan 2017 13:29:29 +0000 (23:59 +1030)]
Testcase from pr72749

PR target/72749
* gcc.c-torture/compile/pr72749.c: New test.

From-SVN: r244466

7 years agoAvoid PR72749 by not using unspecs
Alan Modra [Sat, 14 Jan 2017 13:24:46 +0000 (23:54 +1030)]
Avoid PR72749 by not using unspecs

Rather than using unspecs in doloop insns to stop combine creating
these insns, use legitimate_combined_insn.

PR target/72749
* combine.c (recog_for_combine_1): Set INSN_CODE before calling
target legitimate_combined_insn.
* config/rs6000/rs6000.c (TARGET_LEGITIMATE_COMBINED_INSN): Define.
(rs6000_legitimate_combined_insn): New function.
* config/rs6000/rs6000.md (UNSPEC_DOLOOP): Delete, and remove
all uses.
(ctr<mode>_internal3): Rename from *ctr<mode>_internal5.
(ctr<mode>_internal4): Rename from *ctr<mode>_internal6.
(ctr<mode>_internal1, ctr<mode>_internal2): Remove '*' from name.

From-SVN: r244465

7 years agoSkip tests that are incompatible with Profile Mode
Jonathan Wakely [Sat, 14 Jan 2017 11:55:22 +0000 (11:55 +0000)]
Skip tests that are incompatible with Profile Mode

* testsuite/23_containers/array/specialized_algorithms/swap_cxx17.cc:
Skip test when -D_GLIBCXX_PROFILE mode is included in options.
* testsuite/23_containers/map/modifiers/extract.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert_or_assign/1.cc:
Likewise.
* testsuite/23_containers/map/modifiers/try_emplace/1.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/extract.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/extract.cc: Likewise.
* testsuite/23_containers/set/modifiers/extract.cc: Likewise.
* testsuite/23_containers/unordered_map/modifiers/extract.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/modifiers/extract.cc::
Likewise.
* testsuite/23_containers/unordered_multiset/modifiers/extract.cc::
Likewise.
* testsuite/23_containers/unordered_set/modifiers/extract.cc:
Likewise.
* testsuite/23_containers/vector/modifiers/insert_vs_emplace.cc:
Likewise.
* testsuite/25_algorithms/binary_search/partitioned.cc: Likewise.
* testsuite/25_algorithms/equal_range/partitioned.cc: Likewise.
* testsuite/25_algorithms/lexicographical_compare/71545.cc: Likewise.
* testsuite/25_algorithms/lower_bound/partitioned.cc: Likewise.
* testsuite/25_algorithms/upper_bound/partitioned.cc: Likewise.
* testsuite/libstdc++-prettyprinters/cxx11.cc: Likewise.
* testsuite/libstdc++-prettyprinters/cxx17.cc: Likewise.
* testsuite/libstdc++-prettyprinters/debug.cc: Likewise.
* testsuite/libstdc++-prettyprinters/debug_cxx11.cc: Likewise.
* testsuite/libstdc++-prettyprinters/libfundts.cc: Likewise.
* testsuite/libstdc++-prettyprinters/simple.cc: Likewise.
* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
* testsuite/libstdc++-prettyprinters/whatis.cc: Likewise.

From-SVN: r244464

7 years ago* doc/frontends.texi (G++ and GCC): Remove references to Java.
Gerald Pfeifer [Sat, 14 Jan 2017 08:03:17 +0000 (08:03 +0000)]
* doc/frontends.texi (G++ and GCC): Remove references to Java.

From-SVN: r244463

7 years agoFix comment
Jeff Law [Sat, 14 Jan 2017 06:20:16 +0000 (23:20 -0700)]
Fix comment

From-SVN: r244462

7 years agore PR tree-optimization/33562 (aggregate DSE disabled)
Jeff Law [Sat, 14 Jan 2017 06:16:23 +0000 (23:16 -0700)]
re PR tree-optimization/33562 (aggregate DSE disabled)

PR tree-optimization/33562
PR tree-optimization/61912
PR tree-optimization/77485
* tree-ssa-dse.c (delete_dead_call): Accept gsi rather than
a statement.
(delete_dead_assignment): Likewise.
(dse_dom_walker::dse_optimize_stmt): Pass in the gsi rather than
statement to delete_dead_call and delete_dead_assignment.

From-SVN: r244461

7 years agocompiler: implement type aliases
Ian Lance Taylor [Sat, 14 Jan 2017 01:50:31 +0000 (01:50 +0000)]
compiler: implement type aliases

    This is a start of implementing type aliases (`type T1 = T2`) in the
    Go frontend.  This is incomplete, in that the reflection information
    is not updated for an embedded type alias.  It is also not well
    tested.  Finally, the change to the language has not been approved.
    This should be regarded as preliminary work for experimental use.

    Update golang/go#18130.

    Reviewed-on: https://go-review.googlesource.com/35120

From-SVN: r244460

7 years agoDaily bump.
GCC Administrator [Sat, 14 Jan 2017 00:16:13 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r244459

7 years agolibgo: update to Go 1.8 release candidate 1
Ian Lance Taylor [Sat, 14 Jan 2017 00:05:42 +0000 (00:05 +0000)]
libgo: update to Go 1.8 release candidate 1

    Compiler changes:
      * Change map assignment to use mapassign and assign value directly.
      * Change string iteration to use decoderune, faster for ASCII strings.
      * Change makeslice to take int, and use makeslice64 for larger values.
      * Add new noverflow field to hmap struct used for maps.

    Unresolved problems, to be fixed later:
      * Commented out test in go/types/sizes_test.go that doesn't compile.
      * Commented out reflect.TestStructOf test for padding after zero-sized field.

    Reviewed-on: https://go-review.googlesource.com/35231

gotools/:
Updates for Go 1.8rc1.
* Makefile.am (go_cmd_go_files): Add bug.go.
(s-zdefaultcc): Write defaultPkgConfig.
* Makefile.in: Rebuild.

From-SVN: r244456

7 years agot-msp430 (libmul_none.a, [...]): Filter archived prerequisites.
Joe Seymour [Fri, 13 Jan 2017 22:18:07 +0000 (22:18 +0000)]
t-msp430 (libmul_none.a, [...]): Filter archived prerequisites.

2017-01-13  Joe Seymour  <joe.s@somniumtech.com>
* config/msp430/t-msp430 (libmul_none.a, libmul_16.a, libmul_32.a,
libmul_f5.a): Filter archived prerequisites.

From-SVN: r244455

7 years agoRevert r244448
Janne Blomqvist [Fri, 13 Jan 2017 19:53:16 +0000 (21:53 +0200)]
Revert r244448

From-SVN: r244454

7 years agoDon't suppress bogus usage of macros from system headers in -Wformat (PR c/78304)
David Malcolm [Fri, 13 Jan 2017 19:27:43 +0000 (19:27 +0000)]
Don't suppress bogus usage of macros from system headers in -Wformat (PR c/78304)

gcc/ChangeLog:
PR c/78304
* substring-locations.c (format_warning_va): Strengthen case 1 so
that both endpoints of the substring must be within the format
range for just the substring to be printed.

gcc/testsuite/ChangeLog:
PR c/78304
* gcc.dg/format/diagnostic-ranges.c (test_macro): Undef INT_FMT.
(test_macro_2): New test.
(test_macro_3): New test.
(test_macro_4): New test.
(test_non_contiguous_strings): Convert line number to line offset.
* gcc.dg/format/pr78304-2.c: New test case.
* gcc.dg/format/pr78304.c: New test case.

From-SVN: r244453

7 years agoi386.opt (msgx): Use ix86_isa_flags2 variable.
Uros Bizjak [Fri, 13 Jan 2017 18:32:44 +0000 (19:32 +0100)]
i386.opt (msgx): Use ix86_isa_flags2 variable.

* config/i386/i386.opt (msgx): Use ix86_isa_flags2 variable.
* config/i386/i386.c (ix86_target_string): Add missing options
to isa_opts and reorder options by implied ISAs.  Rename isa_opts2 to
isa2_opts, ix86_flag_opts to flag2_opts, ix86_target_other to
flags_other and ix86_target_other to flags2_other.  Display unknown
isa2 options.
(ix86_valid_target_attribute_inner_p): Add missing options and
reorder options by implied ISAs, as in ix86_target_string.

testsuite/ChangeLog:

* gcc.target/i386/funcspec-56.inc: Add missing options and
reorder options by implied ISAs, as in ix86_target_string.

From-SVN: r244452

7 years agoPR65411 don't retry fclose on EINTR
Jonathan Wakely [Fri, 13 Jan 2017 17:52:34 +0000 (17:52 +0000)]
PR65411 don't retry fclose on EINTR

PR libstdc++/65411
* config/io/basic_file_stdio.cc (__basic_file<char>::close()): Don't
retry fclose on EINTR.

From-SVN: r244451

7 years agore PR c++/71166 (ICE with nested constexpr/initializer)
Marek Polacek [Fri, 13 Jan 2017 17:27:54 +0000 (17:27 +0000)]
re PR c++/71166 (ICE with nested constexpr/initializer)

PR c++/71166
* g++.dg/cpp0x/constexpr-array18.C: New test.

From-SVN: r244450

7 years agoRemove unused include from Profile Mode header
Jonathan Wakely [Fri, 13 Jan 2017 17:20:23 +0000 (17:20 +0000)]
Remove unused include from Profile Mode header

* include/profile/base.h: Remove unused header that leads to header
cycle in C++17 mode.

From-SVN: r244449

7 years agoPR 78534 Change character length from int to size_t
Janne Blomqvist [Fri, 13 Jan 2017 17:05:48 +0000 (19:05 +0200)]
PR 78534 Change character length from int to size_t

In order to handle large character lengths on (L)LP64 targets, switch
the GFortran character length from an int to a size_t.

This is an ABI change, as procedures with character arguments take
hidden arguments with the character length.

I also changed the _size member in vtables from int to size_t, as
there were some cases where character lengths and sizes were
apparently mixed up and caused regressions otherwise. Although I
haven't tested, this might enable very large derived types as well.

Also, as there are some places in the frontend were negative character
lengths are used as special flag values, in the frontend the character
length is handled as a signed variable of the same size as a size_t,
although in the runtime library it really is size_t.

I haven't changed the character length variables for the co-array
intrinsics, as this is something that may need to be synchronized with
OpenCoarrays.

This is v4 of the patch. v3 was applied but had to reverted due to
breaking bootstrap. The fix is in resolve.c:resolve_charlen, where
it's necessary to check that an expression is constant before using
mpz_sgn.

Overview of v3 of the patch: All the issues pointed out by FX's review
of v2 have been fixed. In particular, there are now new functions
gfc_mpz_get_hwi and gfc_mpz_set_hwi, similar to the GMP functions
mpz_get_si and mpz_set_si, except that they get/set a HOST_WIDE_INT
instead of a long value. Similarly, gfc_get_int_expr now takes a
HOST_WIDE_INT instead of a long, gfc_extract_long is replaced by
gfc_extract_hwi. Also, the preliminary work to handle
gfc_charlen_type_node being unsigned has been removed.

Regtested on x86_64-pc-linux-gnu and i686-pc-linux-gnu.

frontend:

2017-01-13  Janne Blomqvist  <jb@gcc.gnu.org>

PR fortran/78534
PR fortran/66310
* class.c (gfc_find_derived_vtab): Use gfc_size_kind instead of
hardcoded kind.
(find_intrinsic_vtab): Likewise.
* expr.c (gfc_get_character_expr): Length parameter of type
gfc_charlen_t.
(gfc_get_int_expr): Value argument of type HOST_WIDE_INT.
(gfc_extract_hwi): New function.
(simplify_const_ref): Make string_len of type gfc_charlen_t.
(gfc_simplify_expr): Use HOST_WIDE_INT for substring refs.
* gfortran.h (gfc_mpz_get_hwi): New prototype.
(gfc_mpz_set_hwi): Likewise.
(gfc_charlen_t): New typedef.
(gfc_expr): Use gfc_charlen_t for character lengths.
(gfc_size_kind): New extern variable.
(gfc_extract_hwi): New prototype.
(gfc_get_character_expr): Use gfc_charlen_t for character length.
(gfc_get_int_expr): Use HOST_WIDE_INT type for value argument.
* iresolve.c (gfc_resolve_repeat): Pass string length directly without
temporary, use gfc_charlen_int_kind.
* match.c (select_intrinsic_set_tmp): Use HOST_WIDE_INT for charlen.
* misc.c (gfc_mpz_get_hwi): New function.
(gfc_mpz_set_hwi): New function.
* module.c (atom_int): Change type from int to HOST_WIDE_INT.
(parse_integer): Don't complain about large integers.
(write_atom): Use HOST_WIDE_INT for integers.
(mio_integer): Handle integer type mismatch.
(mio_hwi): New function.
(mio_intrinsic_op): Use HOST_WIDE_INT.
(mio_array_ref): Likewise.
(mio_expr): Likewise.
* resolve.c (resolve_select_type): Use HOST_WIDE_INT for charlen,
use snprintf.
(resolve_substring_charlen): Use gfc_charlen_int_kind.
(resolve_charlen): Use mpz_sgn to determine sign.
* simplify.c (gfc_simplify_repeat): Use HOST_WIDE_INT/gfc_charlen_t
instead of long.
* target-memory.c (size_character): Length argument of type
gfc_charlen_t.
(gfc_encode_character): Likewise.
(gfc_interpret_character): Use gfc_charlen_t.
* target-memory.h (gfc_encode_character): Modify prototype.
* trans-array.c (get_array_ctor_var_strlen): Use
gfc_conv_mpz_to_tree_type.
* trans-const.c (gfc_conv_mpz_to_tree_type): New function.
* trans-const.h (gfc_conv_mpz_to_tree_type): New prototype.
* trans-expr.c (gfc_class_len_or_zero_get): Build const of type
gfc_charlen_type_node.
(gfc_conv_intrinsic_to_class): Use gfc_charlen_int_kind instead of
4, fold_convert to correct type.
(gfc_conv_class_to_class): Build const of type size_type_node for
size.
(gfc_copy_class_to_class): Likewise.
(gfc_conv_string_length): Use same type in expression.
(gfc_conv_substring): Likewise, use HOST_WIDE_INT for charlen.
(gfc_conv_string_tmp): Make sure len is of the right type.
(gfc_conv_concat_op): Use same type in expression.
(gfc_conv_procedure_call): Likewise.
(alloc_scalar_allocatable_for_subcomponent_assignment):
fold_convert to right type.
(gfc_trans_subcomponent_assign): Likewise.
(trans_class_vptr_len_assignment): Build const of correct type.
(gfc_trans_pointer_assignment): Likewise.
(alloc_scalar_allocatable_for_assignment): fold_convert to right
type in expr.
(trans_class_assignment): Build const of correct type.
* trans-intrinsic.c (gfc_conv_associated): Likewise.
(gfc_conv_intrinsic_repeat): Do calculation in sizetype.
* trans-io.c (gfc_build_io_library_fndecls): Use
gfc_charlen_type_node for character lengths.
* trans-stmt.c (gfc_trans_label_assign): Build const of
gfc_charlen_type_node.
(gfc_trans_character_select): Likewise.
(gfc_trans_allocate): Likewise, don't typecast strlen result.
(gfc_trans_deallocate): Don't typecast strlen result.
* trans-types.c (gfc_size_kind): New variable.
(gfc_init_types): Determine gfc_charlen_int_kind and gfc_size_kind
from size_type_node.

testsuite:

2017-01-13  Janne Blomqvist  <jb@gcc.gnu.org>

PR fortran/78534
PR fortran/66310
* gfortran.dg/repeat_4.f90: Use integers of kind C_SIZE_T.
* gfortran.dg/repeat_7.f90: New test for PR 66310.
* gfortran.dg/scan_2.f90: Handle potential cast in assignment.
* gfortran.dg/string_1.f90: Limit to ilp32 targets.
* gfortran.dg/string_1_lp64.f90: New test.
* gfortran.dg/string_3.f90: Limit to ilp32 targets.
* gfortran.dg/string_3_lp64.f90: New test.

libgfortran:

2017-01-13  Janne Blomqvist  <jb@gcc.gnu.org>

PR fortran/78534
* intrinsics/args.c (getarg_i4): Use gfc_charlen_type.
(get_command_argument_i4): Likewise.
(get_command_i4): Likewise.
* intrinsics/chmod.c (chmod_internal): Likewise.
* intrinsics/env.c (get_environment_variable_i4): Likewise.
* intrinsics/extends_type_of.c (struct vtype): Use size_t for size
member.
* intrinsics/gerror.c (gerror): Use gfc_charlen_type.
* intrinsics/getlog.c (getlog): Likewise.
* intrinsics/hostnm.c (hostnm_0): Likewise.
* intrinsics/string_intrinsics_inc.c (string_len_trim): Rework to
work if gfc_charlen_type is unsigned.
(string_scan): Likewise.
* io/transfer.c (transfer_character): Modify prototype.
(transfer_character_write): Likewise.
(transfer_character_wide): Likewise.
(transfer_character_wide_write): Likewise.
(transfer_array): Typecast to avoid signed-unsigned comparison.
* io/unit.c (is_trim_ok): Use gfc_charlen_type.
* io/write.c (namelist_write): Likewise.
* libgfortran.h (gfc_charlen_type): Change typedef to size_t.

From-SVN: r244448

7 years agoAvoid excessively-big hash tables in empty-add cycles
Richard Sandiford [Fri, 13 Jan 2017 16:00:26 +0000 (16:00 +0000)]
Avoid excessively-big hash tables in empty-add cycles

A big source of cache misses when compiling a recent version of
gimple-match.ii was the call to cv_cache.empty () in clear_cv_cache.
The problem was that at one early point the hash table had grown
to 8191 entries (128k on LP64 hosts).  It then stayed at that size
for the rest of the compilation, even though subsequent uses needed
only a small number of entries (usually fewer than ten).  We would
still clear the whole 128k each time clear_cv_cache was called.

empty() already looks for cases where the hash table is very big
and cuts it down.  At the moment it fires when the table is 1M
in size and reduces it to the next selected prime above 1K (so
almost 2K in practice).  One fix would have been to lower the
threshold, but that didn't feel like the right approach.  Reducing
the current limit of 1M by a factor of 8 would be pretty significant
on its own, but I think this cv_cache behaviour would have been a
problem even with 64k or 32k tables.

I think the existing check is really for cases in which even a
well-populated table would need to be shrunk rather than cleared.
Here the problem isn't that the table is excessively big in
absolute terms, more that one outlier has made the table much
too big for the general case.

traverse() already shrinks the table if it's "too empty",
which is taken to be if:

      no. elements * 8 < capacity && capacity > 32

So an alternative would be to apply the same test (and the same choice
of shrunken size) to empty_slow too.  The patch below does this.
It gives a 2.5% improvement in gimple-match.ii compile time at -O0 -g
and doesn't seem to adversely affect any other tests I've tried.

Of course, there's a theoretical risk of a table alternating between
one large element count and one small element count.  If there was a
factor of eight difference between the two, we could shrink the table
on seeing each small element count, then grow it again when adding the
large number of elements.  That seems pretty unlikely in practice
though.

Also, empty_slow() does involve a traversal if some form of manual
gc is needed on active elements, so trying to recover from an outlier
should have even more benefit there.  (cv_cache uses automatic gc and so
the traversal gets optimised away.)

The calculation of the existing 1M threshold was assuming that each
entry was pointer-sized.  This patch makes it use the actual size of the
entry instead.

Tested on aarch64-linux-gnu and x86_64-linux-gnu.

gcc/
* hash-table.h (hash_table::too_empty_p): New function.
(hash_table::expand): Use it.
(hash_table::traverse): Likewise.
(hash_table::empty_slot): Use sizeof (value_type) instead of
sizeof (PTR) to convert bytes to elements.  Shrink the table
if the current size is excessive for the current number of
elements.

From-SVN: r244447

7 years agoShort-circuit alt_fail case in record_reg_classes
Richard Sandiford [Fri, 13 Jan 2017 15:56:04 +0000 (15:56 +0000)]
Short-circuit alt_fail case in record_reg_classes

record_reg_classes is often the hottest function when generating
unoptimised output.  It seems typical for over 60% of the instructions
it handles to be moves, and of course moves tend to be the instructions
with the longest constraint strings.

Maybe we should avoid using move constraints to set costs in unoptimised
output and instead use the "natural" class for the mode being moved.
That's too invasive for stage 3 though.

However, seeing so many moves means that we see many "failing"
alternatives, usually because of '*' or because of hard registers
in function call sequences.  The frequency of alternatives that are
detected as failures after the first operand tends again to be more
than 60%.  Previously we would continue to process the other operands
of the alternative regardless.  This patch instead adds a short-cut.

As well as avoiding unnecessary work, it means that the alt_fail
variable can be jump-threaded away.

Tested on aach64-linux-gnu and x86_64-linux-gnu.  It reduces compile
time by about 1% on some tests with "-g -O0".

gcc/
* ira-costs.c (record_reg_classes): Break from the inner loop
early once alt_fail is known to be true.  Update outer loop
handling accordingly.

From-SVN: r244446

7 years agoAdd string_view support to COW std::string
Jonathan Wakely [Fri, 13 Jan 2017 15:53:07 +0000 (15:53 +0000)]
Add string_view support to COW std::string

PR libstdc++/79075
* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI] (basic_string):
Make _If_sv private.
[!_GLIBCXX_USE_CXX11_ABI] (basic_string): Add member functions taking
basic_string_view arguments.

From-SVN: r244445

7 years agotree-ssa-dse.c (decrement_count): New function.
Jeff Law [Fri, 13 Jan 2017 15:50:11 +0000 (08:50 -0700)]
tree-ssa-dse.c (decrement_count): New function.

* tree-ssa-dse.c (decrement_count): New function.
(increment_start_addr, maybe_trim_memstar_call): Likewise.
(dse_dom_walker::optimize_stmt): Call maybe_trim_memstar_call directly
when we know the partially dead statement is a mem* function.

* gcc.dg/tree-ssa/ssa-dse-25.c: New test.

From-SVN: r244444

7 years agore PR middle-end/61912 (Missed (partial) dead store elimination for structures on...
Jeff Law [Fri, 13 Jan 2017 15:46:22 +0000 (08:46 -0700)]
re PR middle-end/61912 (Missed (partial) dead store elimination for structures on GIMPLE)

PR tree-optimization/61912
PR tree-optimization/77485
* tree-ssa-dse.c: Include expr.h.
(maybe_trim_constructor_store): New function.
(maybe_trim_partially_dead_store): Call maybe_trim_constructor_store.

PR tree-optimization/61912
PR tree-optimization/77485
* g++.dg/tree-ssa/ssa-dse-1.C: New test.
* gcc.dg/tree-ssa/pr30375: Adjust expected output.
* gcc.dg/tree-ssa/ssa-dse-24.c: New test.

From-SVN: r244443

7 years agore PR tree-optimization/33562 (aggregate DSE disabled)
Jeff Law [Fri, 13 Jan 2017 15:42:08 +0000 (08:42 -0700)]
re PR tree-optimization/33562 (aggregate DSE disabled)

        PR tree-optimization/33562
        PR tree-optimization/61912
        PR tree-optimization/77485
* doc/invoke.texi: Document new dse-max-object-size param.
* params.def (PARM_DSE_MAX_OBJECT_SIZE): New PARAM.
* tree-ssa-dse.c: Include params.h.
(dse_store_status): New enum.
(initialize_ao_ref_for_dse): New, partially extracted from
dse_optimize_stmt.
(valid_ao_ref_for_dse, normalize_ref): New.
(setup_live_bytes_from_ref, compute_trims): Likewise.
(clear_bytes_written_by, maybe_trim_complex_store): Likewise.
(maybe_trim_partially_dead_store): Likewise.
(maybe_trim_complex_store): Likewise.
(dse_classify_store): Renamed from dse_possibly_dead_store_p.
Track what bytes live from the original store.  Return tri-state
for dead, partially dead or live.
(dse_dom_walker): Add constructor, destructor and new private members.
(delete_dead_call, delete_dead_assignment): New extracted from
dse_optimize_stmt.
(dse_optimize_stmt): Make a member of dse_dom_walker.
Use initialize_ao_ref_for_dse.

        PR tree-optimization/33562
        PR tree-optimization/61912
        PR tree-optimization/77485
* gcc.dg/tree-ssa/complex-4.c: Remove xfail.
* gcc.dg/tree-ssa/complex-5.c: Likewise.
* gcc.dg/tree-ssa/ssa-dse-9.c: Likewise.
* gcc.dg/tree-ssa/ssa-dse-18.c: New test.
* gcc.dg/tree-ssa/ssa-dse-19.c: Likewise.
* gcc.dg/tree-ssa/ssa-dse-20.c: Likewise.
* gcc.dg/tree-ssa/ssa-dse-21.c: Likewise.

From-SVN: r244442

7 years agore PR tree-optimization/33562 (aggregate DSE disabled)
Jeff Law [Fri, 13 Jan 2017 15:37:09 +0000 (08:37 -0700)]
re PR tree-optimization/33562 (aggregate DSE disabled)

PR tree-optimization/33562
PR tree-optimization/61912
PR tree-optimization/77485
* sbitmap.h (bitmap_count_bits): Prototype.
(bitmap_clear_range, bitmap_set_range): Likewise.
* sbitmap.c (bitmap_clear_range): New function.
(bitmap_set_range, sbitmap_popcount, bitmap_count_bits): Likewise.

From-SVN: r244441

7 years agoDefine cxx11-abi effective target for libstdc++ tests
Jonathan Wakely [Fri, 13 Jan 2017 14:57:33 +0000 (14:57 +0000)]
Define cxx11-abi effective target for libstdc++ tests

PR libstdc++/79075
* testsuite/lib/libstdc++.exp (check_v3_target_filesystem_ts): Remove
redundant option from cxxflags.
(check_effective_target_cxx11-abi): Define.
* testsuite/21_strings/basic_string/allocator/71964.cc: Use cxx11-abi
effective target.
* testsuite/21_strings/basic_string/allocator/char/copy.cc: Likewise.
* testsuite/21_strings/basic_string/allocator/char/copy_assign.cc:
Likewise.
* testsuite/21_strings/basic_string/allocator/char/minimal.cc:
Likewise.
* testsuite/21_strings/basic_string/allocator/char/move.cc: Likewise.
* testsuite/21_strings/basic_string/allocator/char/move_assign.cc:
Likewise.
* testsuite/21_strings/basic_string/allocator/char/noexcept.cc:
Likewise.
* testsuite/21_strings/basic_string/allocator/char/swap.cc: Likewise.
* testsuite/21_strings/basic_string/allocator/wchar_t/copy.cc:
Likewise.
* testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc:
Likewise.
* testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc:
Likewise.
* testsuite/21_strings/basic_string/allocator/wchar_t/move.cc:
Likewise.
* testsuite/21_strings/basic_string/allocator/wchar_t/move_assign.cc:
Likewise.
* testsuite/21_strings/basic_string/allocator/wchar_t/noexcept.cc:
Likewise.
* testsuite/21_strings/basic_string/allocator/wchar_t/swap.cc:
Likewise.
* testsuite/23_containers/list/61347.cc: Likewise.
* testsuite/27_io/basic_fstream/cons/base.cc: Likewise.
* testsuite/27_io/ios_base/failure/cxx11.cc: Likewise.

From-SVN: r244440