From 4424520793854f340df8525512f4ab2d919a4006 Mon Sep 17 00:00:00 2001 From: Richard Earnshaw Date: Mon, 5 Aug 2013 20:24:39 +0000 Subject: PR rtl-optimization/57708 * recog.c (peep2_find_free_register): Validate all regs in a multi-reg mode. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201510 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/recog.c | 64 +++++++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 49 insertions(+), 21 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 61574ced4f5..1265ca28754 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-08-05 Richard Earnshaw + + PR rtl-optimization/57708 + * recog.c (peep2_find_free_register): Validate all regs in a + multi-reg mode. + 2013-08-02 Eric Botcazou * config/sparc/sparc.c (sparc_emit_membar_for_model) : Add diff --git a/gcc/recog.c b/gcc/recog.c index ae394b9b118..f00859cf00a 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -3120,32 +3120,53 @@ peep2_find_free_register (int from, int to, const char *class_str, regno = raw_regno; #endif - /* Don't allocate fixed registers. */ - if (fixed_regs[regno]) - continue; - /* Don't allocate global registers. */ - if (global_regs[regno]) - continue; - /* Make sure the register is of the right class. */ - if (! TEST_HARD_REG_BIT (reg_class_contents[cl], regno)) - continue; - /* And can support the mode we need. */ + /* Can it support the mode we need? */ if (! HARD_REGNO_MODE_OK (regno, mode)) continue; - /* And that we don't create an extra save/restore. */ - if (! call_used_regs[regno] && ! df_regs_ever_live_p (regno)) - continue; - if (! targetm.hard_regno_scratch_ok (regno)) - continue; - - /* And we don't clobber traceback for noreturn functions. */ - if ((regno == FRAME_POINTER_REGNUM || regno == HARD_FRAME_POINTER_REGNUM) - && (! reload_completed || frame_pointer_needed)) - continue; success = 1; - for (j = hard_regno_nregs[regno][mode] - 1; j >= 0; j--) + for (j = 0; success && j < hard_regno_nregs[regno][mode]; j++) { + /* Don't allocate fixed registers. */ + if (fixed_regs[regno + j]) + { + success = 0; + break; + } + /* Don't allocate global registers. */ + if (global_regs[regno + j]) + { + success = 0; + break; + } + /* Make sure the register is of the right class. */ + if (! TEST_HARD_REG_BIT (reg_class_contents[cl], regno + j)) + { + success = 0; + break; + } + /* And that we don't create an extra save/restore. */ + if (! call_used_regs[regno + j] && ! df_regs_ever_live_p (regno + j)) + { + success = 0; + break; + } + + if (! targetm.hard_regno_scratch_ok (regno + j)) + { + success = 0; + break; + } + + /* And we don't clobber traceback for noreturn functions. */ + if ((regno + j == FRAME_POINTER_REGNUM + || regno + j == HARD_FRAME_POINTER_REGNUM) + && (! reload_completed || frame_pointer_needed)) + { + success = 0; + break; + } + if (TEST_HARD_REG_BIT (*reg_set, regno + j) || TEST_HARD_REG_BIT (live, regno + j)) { @@ -3153,6 +3174,7 @@ peep2_find_free_register (int from, int to, const char *class_str, break; } } + if (success) { add_to_hard_reg_set (reg_set, mode, regno); -- cgit v1.2.3 From 51e885d37dc56372bb61cbdb18660f6932d74aed Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Tue, 6 Aug 2013 00:16:21 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201515 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 536e3b3bccc..f801f84461f 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130805 +20130806 -- cgit v1.2.3 From 612c675be2e91b82dd16913cf41a861ae631b5b3 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Tue, 6 Aug 2013 15:08:59 +0000 Subject: 2013-08-06 Martin Jambor PR middle-end/58041 * gimple-ssa-strength-reduction.c (replace_ref): Make sure built MEM_REF has proper alignment information. testsuite/ * gcc.dg/torture/pr58041.c: New test. * gcc.target/arm/pr58041.c: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201530 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/gimple-ssa-strength-reduction.c | 22 ++++++++++++++++----- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/torture/pr58041.c | 35 ++++++++++++++++++++++++++++++++++ gcc/testsuite/gcc.target/arm/pr58041.c | 30 +++++++++++++++++++++++++++++ 5 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr58041.c create mode 100644 gcc/testsuite/gcc.target/arm/pr58041.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1265ca28754..6cd85609ba5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-08-06 Martin Jambor + + PR middle-end/58041 + * gimple-ssa-strength-reduction.c (replace_ref): Make sure built + MEM_REF has proper alignment information. + 2013-08-05 Richard Earnshaw PR rtl-optimization/57708 diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index 57b343ab5cf..5cda3873eb3 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -1525,11 +1525,23 @@ unconditional_cands_with_known_stride_p (slsr_cand_t root) static void replace_ref (tree *expr, slsr_cand_t c) { - tree add_expr = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (c->base_expr), - c->base_expr, c->stride); - tree mem_ref = fold_build2 (MEM_REF, TREE_TYPE (*expr), add_expr, - double_int_to_tree (c->cand_type, c->index)); - + tree add_expr, mem_ref, acc_type = TREE_TYPE (*expr); + unsigned HOST_WIDE_INT misalign; + unsigned align; + + /* Ensure the memory reference carries the minimum alignment + requirement for the data type. See PR58041. */ + get_object_alignment_1 (*expr, &align, &misalign); + if (misalign != 0) + align = (misalign & -misalign); + if (align < TYPE_ALIGN (acc_type)) + acc_type = build_aligned_type (acc_type, align); + + add_expr = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (c->base_expr), + c->base_expr, c->stride); + mem_ref = fold_build2 (MEM_REF, acc_type, add_expr, + double_int_to_tree (c->cand_type, c->index)); + /* Gimplify the base addressing expression for the new MEM_REF tree. */ gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt); TREE_OPERAND (mem_ref, 0) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d3037fa5410..9aedc93d548 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-08-06 Martin Jambor + + PR middle-end/58041 + * gcc.dg/torture/pr58041.c: New test. + * gcc.target/arm/pr58041.c: Likewise. + 2013-08-02 Andreas Krebbel Backport from mainline diff --git a/gcc/testsuite/gcc.dg/torture/pr58041.c b/gcc/testsuite/gcc.dg/torture/pr58041.c new file mode 100644 index 00000000000..e22ec3c86ab --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr58041.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ + +typedef long long V + __attribute__ ((vector_size (2 * sizeof (long long)), may_alias)); + +typedef struct S { V v; } P __attribute__((aligned (1))); + +struct s +{ + char u; + V v[2]; +} __attribute__((packed,aligned(1))); + +__attribute__((noinline, noclone)) +long long foo(struct s *x, int y, V z) +{ + V a = x->v[y]; + x->v[y] = z; + return a[1]; +} + +struct s a = {0,{0,0}}; +int main() +{ + V v1 = {0,1}; + V v2 = {0,2}; + + if (foo(&a,0,v1) != 0) + __builtin_abort(); + if (foo(&a,0,v2) != 1) + __builtin_abort(); + if (foo(&a,1,v1) != 0) + __builtin_abort(); + return 0; +} diff --git a/gcc/testsuite/gcc.target/arm/pr58041.c b/gcc/testsuite/gcc.target/arm/pr58041.c new file mode 100644 index 00000000000..481a72b81c7 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr58041.c @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-options "-Os -mno-unaligned-access" } */ +/* { dg-final { scan-assembler "ldrb" } } */ +/* { dg-final { scan-assembler "strb" } } */ + +struct s +{ + char u; + long long v[2]; +} __attribute__((packed,aligned(1))); + +__attribute__((noinline, noclone)) +long long foo(struct s *x, int y, long long z) +{ + long long a = x->v[y]; + x->v[y] = z; + return a; +} + +struct s a = {0,{0,0}}; +int main() +{ + if (foo(&a,0,1) != 0) + __builtin_abort(); + if (foo(&a,0,2) != 1) + __builtin_abort(); + if (foo(&a,1,1) != 0) + __builtin_abort(); + return 0; +} -- cgit v1.2.3 From bd40dad5cf3c464d9b57ae02d5035a71f06f24fc Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 6 Aug 2013 16:40:25 +0000 Subject: * go-gcc.cc (Gcc_backend::immutable_struct_set_init): Use compute_reloc_for_constant. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201536 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/ChangeLog | 5 +++++ gcc/go/go-gcc.cc | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index 9e8d36ece04..3e77c2929b5 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,8 @@ +2013-08-06 Ian Lance Taylor + + * go-gcc.cc (Gcc_backend::immutable_struct_set_init): Use + compute_reloc_for_constant. + 2013-08-02 Ian Lance Taylor * go-gcc.cc (immutable_struct_set_init): Always call diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index 50dbb3128f1..1ecfaffd73a 100644 --- a/gcc/go/go-gcc.cc +++ b/gcc/go/go-gcc.cc @@ -1525,7 +1525,9 @@ Gcc_backend::immutable_struct_set_init(Bvariable* var, const std::string&, // These variables are often unneeded in the final program, so put // them in their own section so that linker GC can discard them. - resolve_unique_section(decl, 1, 1); + resolve_unique_section(decl, + compute_reloc_for_constant (init_tree), + 1); rest_of_decl_compilation(decl, 1, 0); } -- cgit v1.2.3 From caf4616d87c818c76d4c6fc1cd459f8cf8f7fa57 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Tue, 6 Aug 2013 17:35:11 +0000 Subject: 2013-08-06 Martin Jambor Bernd Edlinger testsuite/ * gcc.dg/torture/pr58041.c (foo): Accept z by reference. (a): Fix constructor. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201539 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/torture/pr58041.c | 14 ++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9aedc93d548..2ae433c9ff1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-08-06 Martin Jambor + Bernd Edlinger + + * gcc.dg/torture/pr58041.c (foo): Accept z by reference. + (a): Fix constructor. + 2013-08-06 Martin Jambor PR middle-end/58041 diff --git a/gcc/testsuite/gcc.dg/torture/pr58041.c b/gcc/testsuite/gcc.dg/torture/pr58041.c index e22ec3c86ab..169a71ae7e4 100644 --- a/gcc/testsuite/gcc.dg/torture/pr58041.c +++ b/gcc/testsuite/gcc.dg/torture/pr58041.c @@ -3,8 +3,6 @@ typedef long long V __attribute__ ((vector_size (2 * sizeof (long long)), may_alias)); -typedef struct S { V v; } P __attribute__((aligned (1))); - struct s { char u; @@ -12,24 +10,24 @@ struct s } __attribute__((packed,aligned(1))); __attribute__((noinline, noclone)) -long long foo(struct s *x, int y, V z) +long long foo(struct s *x, int y, V *z) { V a = x->v[y]; - x->v[y] = z; + x->v[y] = *z; return a[1]; } -struct s a = {0,{0,0}}; +struct s a = {0,{{0,0},{0,0}}}; int main() { V v1 = {0,1}; V v2 = {0,2}; - if (foo(&a,0,v1) != 0) + if (foo(&a,0,&v1) != 0) __builtin_abort(); - if (foo(&a,0,v2) != 1) + if (foo(&a,0,&v2) != 1) __builtin_abort(); - if (foo(&a,1,v1) != 0) + if (foo(&a,1,&v1) != 0) __builtin_abort(); return 0; } -- cgit v1.2.3 From ec6ccc40a00dea72fbd0d2a0eb2822ef899bcc24 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Wed, 7 Aug 2013 00:16:31 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201547 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index f801f84461f..44f197d44ee 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130806 +20130807 -- cgit v1.2.3 From 84c0c53dc5a4d2343f53588ebcf4bdde0f0f1738 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 7 Aug 2013 01:18:57 +0000 Subject: PR c++/57825 * tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201551 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/tree.c | 2 ++ gcc/testsuite/g++.dg/cpp0x/ref-qual14.C | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/ref-qual14.C (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 20e9ebaa646..fde680d0def 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2013-08-06 Jason Merrill + + PR c++/57825 + * tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier. + 2013-07-29 Jason Merrill PR c++/57901 diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index a75663406d4..c7502d6207b 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1220,6 +1220,8 @@ strip_typedefs (tree t) result = build_method_type_directly (class_type, type, TREE_CHAIN (arg_types)); + result + = build_ref_qualified_type (result, type_memfn_rqual (t)); } else { diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C new file mode 100644 index 00000000000..8e55551aeb2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C @@ -0,0 +1,18 @@ +// PR c++/57825 +// { dg-do compile { target c++11 } } + +template +struct target_class +{}; + +template +struct target_class +{}; + +template +struct target_class +{}; + +template +struct target_class +{}; -- cgit v1.2.3 From 81c749f8142ca48376c317ca941a9cff0992ac25 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 7 Aug 2013 19:00:55 +0000 Subject: compiler: Fix "missing return" error for case T1, T2 in type switches. Also change the "missing return" text and report it at the end of the function, rather than the start, to match the gc compiler. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201578 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/gogo.cc | 3 ++- gcc/go/gofrontend/statements.cc | 10 ++++++++++ gcc/testsuite/go.test/test/fixedbugs/bug086.go | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index 0b69d5d9887..4e5bd447831 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -3133,7 +3133,8 @@ Check_return_statements_traverse::function(Named_object* no) return TRAVERSE_CONTINUE; if (func->block()->may_fall_through()) - error_at(func->location(), "control reaches end of non-void function"); + error_at(func->block()->end_location(), + "missing return at end of function"); return TRAVERSE_CONTINUE; } diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc index ca1ad07af6c..7314918a9a1 100644 --- a/gcc/go/gofrontend/statements.cc +++ b/gcc/go/gofrontend/statements.cc @@ -4093,6 +4093,16 @@ Type_case_clauses::Type_case_clause::lower(Type* switch_val_type, bool Type_case_clauses::Type_case_clause::may_fall_through() const { + if (this->is_fallthrough_) + { + // This case means that we automatically fall through to the + // next case (it's used for T1 in case T1, T2:). It does not + // mean that we fall through to the end of the type switch as a + // whole. There is sure to be a next case and that next case + // will determine whether we fall through to the statements + // after the type switch. + return false; + } if (this->statements_ == NULL) return true; return this->statements_->may_fall_through(); diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug086.go b/gcc/testsuite/go.test/test/fixedbugs/bug086.go index fc69e0e3fc7..40d23620669 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug086.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug086.go @@ -6,12 +6,12 @@ package main -func f() int { // ERROR "return|control" +func f() int { if false { return 0; } // we should not be able to return successfully w/o a return statement -} +} // ERROR "return" func main() { print(f(), "\n"); -- cgit v1.2.3 From f715614228276b0f2ae231f5fabf3ee91250b34a Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Thu, 8 Aug 2013 00:16:59 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201587 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 44f197d44ee..e4ce020a3eb 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130807 +20130808 -- cgit v1.2.3 From 268501d1de3c239882100ac09d890bdba84d704f Mon Sep 17 00:00:00 2001 From: Kyrylo Tkachov Date: Thu, 8 Aug 2013 16:53:58 +0000 Subject: 2013-08-08 Kyrylo Tkachov Backport from mainline: 2013-08-08 Kyrylo Tkachov * config/arm/neon.md (movmisalign): Disable when we don't allow unaligned accesses. (*movmisalign_neon_store): Likewise. (*movmisalign_neon_load): Likewise. (*movmisalign_neon_store): Likewise. (*movmisalign_neon_load): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201605 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 12 ++++++++++++ gcc/config/arm/neon.md | 10 +++++----- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6cd85609ba5..e2aabe6b249 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2013-08-08 Kyrylo Tkachov + + Backport from mainline: + 2013-08-08 Kyrylo Tkachov + + * config/arm/neon.md (movmisalign): Disable when we + don't allow unaligned accesses. + (*movmisalign_neon_store): Likewise. + (*movmisalign_neon_load): Likewise. + (*movmisalign_neon_store): Likewise. + (*movmisalign_neon_load): Likewise. + 2013-08-06 Martin Jambor PR middle-end/58041 diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md index 99fb5e89f41..d8d420208ad 100644 --- a/gcc/config/arm/neon.md +++ b/gcc/config/arm/neon.md @@ -244,7 +244,7 @@ [(set (match_operand:VDQX 0 "neon_struct_or_register_operand") (unspec:VDQX [(match_operand:VDQX 1 "neon_struct_or_register_operand")] UNSPEC_MISALIGNED_ACCESS))] - "TARGET_NEON && !BYTES_BIG_ENDIAN" + "TARGET_NEON && !BYTES_BIG_ENDIAN && unaligned_access" { /* This pattern is not permitted to fail during expansion: if both arguments are non-registers (e.g. memory := constant, which can be created by the @@ -258,7 +258,7 @@ [(set (match_operand:VDX 0 "neon_struct_operand" "=Um") (unspec:VDX [(match_operand:VDX 1 "s_register_operand" " w")] UNSPEC_MISALIGNED_ACCESS))] - "TARGET_NEON && !BYTES_BIG_ENDIAN" + "TARGET_NEON && !BYTES_BIG_ENDIAN && unaligned_access" "vst1.\t{%P1}, %A0" [(set_attr "neon_type" "neon_vst1_1_2_regs_vst2_2_regs")]) @@ -266,7 +266,7 @@ [(set (match_operand:VDX 0 "s_register_operand" "=w") (unspec:VDX [(match_operand:VDX 1 "neon_struct_operand" " Um")] UNSPEC_MISALIGNED_ACCESS))] - "TARGET_NEON && !BYTES_BIG_ENDIAN" + "TARGET_NEON && !BYTES_BIG_ENDIAN && unaligned_access" "vld1.\t{%P0}, %A1" [(set_attr "neon_type" "neon_vld1_1_2_regs")]) @@ -274,7 +274,7 @@ [(set (match_operand:VQX 0 "neon_struct_operand" "=Um") (unspec:VQX [(match_operand:VQX 1 "s_register_operand" " w")] UNSPEC_MISALIGNED_ACCESS))] - "TARGET_NEON && !BYTES_BIG_ENDIAN" + "TARGET_NEON && !BYTES_BIG_ENDIAN && unaligned_access" "vst1.\t{%q1}, %A0" [(set_attr "neon_type" "neon_vst1_1_2_regs_vst2_2_regs")]) @@ -282,7 +282,7 @@ [(set (match_operand:VQX 0 "s_register_operand" "=w") (unspec:VQX [(match_operand:VQX 1 "neon_struct_operand" " Um")] UNSPEC_MISALIGNED_ACCESS))] - "TARGET_NEON && !BYTES_BIG_ENDIAN" + "TARGET_NEON && !BYTES_BIG_ENDIAN && unaligned_access" "vld1.\t{%q0}, %A1" [(set_attr "neon_type" "neon_vld1_1_2_regs")]) -- cgit v1.2.3 From 2e7591a7541babe3e9a0ab69f11dfa74d54e679b Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Fri, 9 Aug 2013 00:16:42 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201613 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index e4ce020a3eb..83a264ac0ee 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130808 +20130809 -- cgit v1.2.3 From 8b3a9630c13c18a8c1a372ca314b29fc91ecda12 Mon Sep 17 00:00:00 2001 From: Zhenqiang Chen Date: Fri, 9 Aug 2013 06:59:01 +0000 Subject: gcc/ChangeLog: Backport from mainline: 2013-08-09 Zhenqiang Chen * config/arm/neon.md (vcond): Fix floating-point vector comparisons against 0. gcc/testsuite/ChangeLog: Backport from mainline: 2013-08-09 Zhenqiang Chen * gcc.target/arm/lp1189445.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201620 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 ++++++++ gcc/config/arm/neon.md | 34 +++++++++++++++++++++++++++----- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gcc.target/arm/lp1189445.c | 18 +++++++++++++++++ 4 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.target/arm/lp1189445.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e2aabe6b249..9eeb8ba5531 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2013-08-09 Zhenqiang Chen + + Backport from mainline: + 2013-08-09 Zhenqiang Chen + + * config/arm/neon.md (vcond): Fix floating-point vector + comparisons against 0. + 2013-08-08 Kyrylo Tkachov Backport from mainline: diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md index d8d420208ad..86a5932d7b0 100644 --- a/gcc/config/arm/neon.md +++ b/gcc/config/arm/neon.md @@ -1732,6 +1732,7 @@ ? 3 : 1; rtx magic_rtx = GEN_INT (magic_word); int inverse = 0; + int use_zero_form = 0; int swap_bsl_operands = 0; rtx mask = gen_reg_rtx (mode); rtx tmp = gen_reg_rtx (mode); @@ -1742,12 +1743,16 @@ switch (GET_CODE (operands[3])) { case GE: + case GT: case LE: + case LT: case EQ: - if (!REG_P (operands[5]) - && (operands[5] != CONST0_RTX (mode))) - operands[5] = force_reg (mode, operands[5]); - break; + if (operands[5] == CONST0_RTX (mode)) + { + use_zero_form = 1; + break; + } + /* Fall through. */ default: if (!REG_P (operands[5])) operands[5] = force_reg (mode, operands[5]); @@ -1798,7 +1803,26 @@ a GT b -> a GT b a LE b -> b GE a a LT b -> b GT a - a EQ b -> a EQ b */ + a EQ b -> a EQ b + Note that there also exist direct comparison against 0 forms, + so catch those as a special case. */ + if (use_zero_form) + { + inverse = 0; + switch (GET_CODE (operands[3])) + { + case LT: + base_comparison = gen_neon_vclt; + break; + case LE: + base_comparison = gen_neon_vcle; + break; + default: + /* Do nothing, other zero form cases already have the correct + base_comparison. */ + break; + } + } if (!inverse) emit_insn (base_comparison (mask, operands[4], operands[5], magic_rtx)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2ae433c9ff1..55cd2e41599 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2013-08-09 Zhenqiang Chen + + Backport from mainline: + 2013-08-09 Zhenqiang Chen + + * gcc.target/arm/lp1189445.c: New testcase. + 2013-08-06 Martin Jambor Bernd Edlinger diff --git a/gcc/testsuite/gcc.target/arm/lp1189445.c b/gcc/testsuite/gcc.target/arm/lp1189445.c new file mode 100644 index 00000000000..766748e5509 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/lp1189445.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_neon } */ +/* { dg-add-options arm_neon } */ +/* { dg-options "-O3" } */ + +int id; +int +test (const long int *data) +{ + int i, retval; + retval = id; + for (i = 0; i < id; i++) + { + retval &= (data[i] <= 0); + } + + return (retval); +} -- cgit v1.2.3 From bb2e027f42e6f72df97a35c496ae492e0eae03a1 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 9 Aug 2013 10:53:01 +0000 Subject: * c-ada-spec.c (print_ada_declaration): Prevent accessing null asm name git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201626 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-family/ChangeLog | 4 ++++ gcc/c-family/c-ada-spec.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 3acbfe39292..dd917ae1cca 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,7 @@ +2013-08-09 Arnaud Charlet + + * c-ada-spec.c (print_ada_declaration): Prevent accessing null asm name + 2013-05-31 Release Manager * GCC 4.8.1 released. diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index 21cbfe94fba..2d6ce14ca48 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -2900,7 +2900,7 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, pp_string (buffer, " -- "); dump_sloc (buffer, t); - if (is_abstract) + if (is_abstract || !DECL_ASSEMBLER_NAME (t)) return 1; newline_and_indent (buffer, spc); -- cgit v1.2.3 From a68f25c5a5b00b82116336515a51cea39d249d5a Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sat, 10 Aug 2013 00:16:45 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201642 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 83a264ac0ee..c95a385e1d5 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130809 +20130810 -- cgit v1.2.3 From 0bc050b958fc5fc0c9c9db630b943003c904360b Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sun, 11 Aug 2013 00:16:25 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201650 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index c95a385e1d5..57cbe898858 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130810 +20130811 -- cgit v1.2.3 From e50adc20a5aff018aadd7666b6611445e3077fae Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Sun, 11 Aug 2013 11:31:41 +0000 Subject: 2013-08-11 Janus Weil Backport from trunk: 2013-08-09 Janus Weil PR fortran/58058 * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Free the temporary string, if necessary. 2013-08-11 Janus Weil Backport from trunk: 2013-08-09 Janus Weil PR fortran/58058 * gfortran.dg/transfer_intrinsic_6.f90: New. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201652 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 9 +++++++++ gcc/fortran/trans-intrinsic.c | 10 ++++++++-- gcc/testsuite/ChangeLog | 8 ++++++++ gcc/testsuite/gfortran.dg/transfer_intrinsic_6.f90 | 20 ++++++++++++++++++++ 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/transfer_intrinsic_6.f90 (limited to 'gcc') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9a8b794bc57..be2afaa869d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,12 @@ +2013-08-11 Janus Weil + + Backport from trunk: + 2013-08-09 Janus Weil + + PR fortran/58058 + * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Free the temporary + string, if necessary. + 2013-07-28 Tobias Burnus Backport from mainline diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index a2bb2a78ee7..ddd9eaea5c2 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -5653,8 +5653,7 @@ scalar_transfer: if (expr->ts.type == BT_CHARACTER) { - tree direct; - tree indirect; + tree direct, indirect, free; ptr = convert (gfc_get_pchar_type (expr->ts.kind), source); tmpdecl = gfc_create_var (gfc_get_pchar_type (expr->ts.kind), @@ -5687,6 +5686,13 @@ scalar_transfer: tmp = build3_v (COND_EXPR, tmp, direct, indirect); gfc_add_expr_to_block (&se->pre, tmp); + /* Free the temporary string, if necessary. */ + free = gfc_call_free (tmpdecl); + tmp = fold_build2_loc (input_location, GT_EXPR, boolean_type_node, + dest_word_len, source_bytes); + tmp = build3_v (COND_EXPR, tmp, free, build_empty_stmt (input_location)); + gfc_add_expr_to_block (&se->post, tmp); + se->expr = tmpdecl; se->string_length = fold_convert (gfc_charlen_type_node, dest_word_len); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 55cd2e41599..16f499fc185 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2013-08-11 Janus Weil + + Backport from trunk: + 2013-08-09 Janus Weil + + PR fortran/58058 + * gfortran.dg/transfer_intrinsic_6.f90: New. + 2013-08-09 Zhenqiang Chen Backport from mainline: diff --git a/gcc/testsuite/gfortran.dg/transfer_intrinsic_6.f90 b/gcc/testsuite/gfortran.dg/transfer_intrinsic_6.f90 new file mode 100644 index 00000000000..e76bc49aeda --- /dev/null +++ b/gcc/testsuite/gfortran.dg/transfer_intrinsic_6.f90 @@ -0,0 +1,20 @@ +! { dg-do compile } +! { dg-options "-fdump-tree-original" } +! +! PR 58058: [4.7/4.8/4.9 Regression] Memory leak with transfer function +! +! Contributed by Thomas Jourdan + + implicit none + + integer, dimension(3) :: t1 + character(len=64) :: str + + t1 = (/1,2,3/) + + str = transfer(t1,str) + +end + +! { dg-final { scan-tree-dump-times "__builtin_free" 1 "original" } } +! { dg-final { cleanup-tree-dump "original" } } -- cgit v1.2.3 From 82ba65c0acc151f27b53df5f968faac464e70043 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Mon, 12 Aug 2013 00:16:50 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201656 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 57cbe898858..3047425abcc 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130811 +20130812 -- cgit v1.2.3 From 50971947c41f06ab39f9b43c2d2e9da88c053c03 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Tue, 13 Aug 2013 00:16:22 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201677 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 3047425abcc..524267245e1 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130812 +20130813 -- cgit v1.2.3 From 1e16db518345d9db59c5ecf4182f62227b3fa134 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Tue, 13 Aug 2013 12:45:06 +0000 Subject: 2013-08-13 Uros Bizjak Backport from mainline 2013-08-12 Perez Read PR target/58132 * config/i386/i386.md (*movabs_1): Add PTR before operand 0 for intel asm alternative. (*movabs_2): Ditto for operand 1. testsuite/ChangeLog: 2013-08-13 Uros Bizjak Backport from mainline 2013-08-12 Perez Read PR target/58132 * gcc.target/i386/movabs-1.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201684 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 19 ++++++++++++++----- gcc/config/i386/i386.md | 4 ++-- gcc/testsuite/ChangeLog | 8 ++++++++ gcc/testsuite/gcc.target/i386/movabs-1.c | 10 ++++++++++ 4 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/movabs-1.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9eeb8ba5531..5260af02664 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2013-08-13 Uros Bizjak + + Backport from mainline + 2013-08-12 Perez Read + + PR target/58132 + * config/i386/i386.md (*movabs_1): Add PTR before + operand 0 for intel asm alternative. + (*movabs_2): Ditto for operand 1. + 2013-08-09 Zhenqiang Chen Backport from mainline: @@ -63,8 +73,7 @@ (s390_expand_builtin): New function. (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. - * common/config/s390/s390-common.c (processor_flags_table): Add - PF_TX. + * common/config/s390/s390-common.c (processor_flags_table): Add PF_TX. * config/s390/predicates.md (s390_comparison): Handle CCRAWmode. (s390_alc_comparison): Likewise. * config/s390/s390-modes.def: Add CCRAWmode. @@ -105,7 +114,7 @@ 2013-08-01 Ganesh Gopalasubramanian Backport from mainline - 2013-05-13 Ganesh Gopalasubramanian + 2013-05-13 Ganesh Gopalasubramanian * config/i386/i386.c (processor_target_table): Modified default @@ -162,7 +171,7 @@ (ix86_save_reg): If the function contains a nonlocal label, save the PIC base reg. * config/darwin-protos.h (machopic_should_output_picbase_label): New. - * gcc/config/darwin.c (emitted_pic_label_num): New GTY. + * gcc/config/darwin.c (emitted_pic_label_num): New GTY. (update_pic_label_number_if_needed): New. (machopic_output_function_base_name): Adjust for nonlocal receiver case. @@ -244,7 +253,7 @@ 2013-07-10 Georg-Johann Lay Backport from 2013-07-10 trunk r200870. - + PR target/57506 * config/avr/avr-mcus.def (atmega16hva, atmega16hva2, atmega16hvb) (atmega16m1, atmega16u4, atmega32a, atmega32c1, atmega32hvb) diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 57e0dcacdc0..4d5b2872d09 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -2316,7 +2316,7 @@ "TARGET_LP64 && ix86_check_movabs (insn, 0)" "@ movabs{}\t{%1, %P0|[%P0], %1} - mov{}\t{%1, %a0|%a0, %1}" + mov{}\t{%1, %a0| PTR %a0, %1}" [(set_attr "type" "imov") (set_attr "modrm" "0,*") (set_attr "length_address" "8,0") @@ -2330,7 +2330,7 @@ "TARGET_LP64 && ix86_check_movabs (insn, 1)" "@ movabs{}\t{%P1, %0|%0, [%P1]} - mov{}\t{%a1, %0|%0, %a1}" + mov{}\t{%a1, %0|%0, PTR %a1}" [(set_attr "type" "imov") (set_attr "modrm" "0,*") (set_attr "length_address" "8,0") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 16f499fc185..552636692a7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2013-08-13 Uros Bizjak + + Backport from mainline + 2013-08-12 Perez Read + + PR target/58132 + * gcc.target/i386/movabs-1.c: New test. + 2013-08-11 Janus Weil Backport from trunk: diff --git a/gcc/testsuite/gcc.target/i386/movabs-1.c b/gcc/testsuite/gcc.target/i386/movabs-1.c new file mode 100644 index 00000000000..75ef8d2a6cb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/movabs-1.c @@ -0,0 +1,10 @@ +/* { dg-do assemble } */ +/* { dg-options "-O2 -masm=intel" } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-require-effective-target masm_intel } */ + +void +foo (void) +{ + *(volatile long*)0xFFFF800000000000 = -1; +} -- cgit v1.2.3 From a4fcbac3da75401c3d365002c1cf240e20421d35 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Tue, 13 Aug 2013 13:22:18 +0000 Subject: 2013-08-12 Andrew Haley Backport from mainline: * 2013-07-11 Andreas Schwab * config/aarch64/aarch64-linux.h (CPP_SPEC): Define. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201685 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/config/aarch64/aarch64-linux.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5260af02664..647835cd07f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-08-12 Andrew Haley + + Backport from mainline: + * 2013-07-11 Andreas Schwab + + * config/aarch64/aarch64-linux.h (CPP_SPEC): Define. + 2013-08-13 Uros Bizjak Backport from mainline diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h index e914ed27f1f..83efad447f1 100644 --- a/gcc/config/aarch64/aarch64-linux.h +++ b/gcc/config/aarch64/aarch64-linux.h @@ -23,6 +23,8 @@ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64.so.1" +#define CPP_SPEC "%{pthread:-D_REENTRANT}" + #define LINUX_TARGET_LINK_SPEC "%{h*} \ %{static:-Bstatic} \ %{shared:-shared} \ -- cgit v1.2.3 From 5bfe8ab01d4150ef0b8fbd35867458d3b22ad6a8 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 13 Aug 2013 13:34:08 +0000 Subject: 2013-08-13 Marek Polacek Jakub Jelinek PR tree-optimization/57980 * tree-tailcall.c (process_assignment): Return false when not dealing with integers or floats. * gcc.dg/pr57980.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201687 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr57980.c | 19 +++++++++++++++++++ gcc/tree-tailcall.c | 8 ++++++-- 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr57980.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 647835cd07f..7b987b326fe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-08-13 Marek Polacek + Jakub Jelinek + + PR tree-optimization/57980 + * tree-tailcall.c (process_assignment): Return false + when not dealing with integers or floats. + 2013-08-12 Andrew Haley Backport from mainline: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 552636692a7..55fd03d11c2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-08-13 Marek Polacek + + PR tree-optimization/57980 + * gcc.dg/pr57980.c: New test. + 2013-08-13 Uros Bizjak Backport from mainline diff --git a/gcc/testsuite/gcc.dg/pr57980.c b/gcc/testsuite/gcc.dg/pr57980.c new file mode 100644 index 00000000000..be83536c5f7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr57980.c @@ -0,0 +1,19 @@ +/* PR tree-optimization/57980 */ +/* { dg-do compile } */ +/* { dg-options "-O -foptimize-sibling-calls -w" } */ + +typedef int V __attribute__ ((vector_size (2 * sizeof (int)))); +extern V f (void); + +V +bar (void) +{ + return -f (); +} + +V +foo (void) +{ + V v = { }; + return v - f (); +} diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c index c6581dcedcd..350d707b235 100644 --- a/gcc/tree-tailcall.c +++ b/gcc/tree-tailcall.c @@ -328,8 +328,10 @@ process_assignment (gimple stmt, gimple_stmt_iterator call, tree *m, case NEGATE_EXPR: if (FLOAT_TYPE_P (TREE_TYPE (op0))) *m = build_real (TREE_TYPE (op0), dconstm1); - else + else if (INTEGRAL_TYPE_P (TREE_TYPE (op0))) *m = build_int_cst (TREE_TYPE (op0), -1); + else + return false; *ass_var = dest; return true; @@ -341,8 +343,10 @@ process_assignment (gimple stmt, gimple_stmt_iterator call, tree *m, { if (FLOAT_TYPE_P (TREE_TYPE (non_ass_var))) *m = build_real (TREE_TYPE (non_ass_var), dconstm1); - else + else if (INTEGRAL_TYPE_P (TREE_TYPE (non_ass_var))) *m = build_int_cst (TREE_TYPE (non_ass_var), -1); + else + return false; *a = fold_build1 (NEGATE_EXPR, TREE_TYPE (non_ass_var), non_ass_var); } -- cgit v1.2.3 From 15d51aaf88fc23c77ad024b87a8894ab6914e3b9 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 13 Aug 2013 15:59:03 +0000 Subject: * gcc-interface/trans.c (can_equal_min_or_max_val_p): Be prepared for values outside of the range of the type. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201693 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/gcc-interface/trans.c | 5 ++++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gnat.dg/loop_optimization16.adb | 24 +++++++++++++++++++++++ gcc/testsuite/gnat.dg/loop_optimization16_pkg.adb | 8 ++++++++ gcc/testsuite/gnat.dg/loop_optimization16_pkg.ads | 7 +++++++ 6 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gnat.dg/loop_optimization16.adb create mode 100644 gcc/testsuite/gnat.dg/loop_optimization16_pkg.adb create mode 100644 gcc/testsuite/gnat.dg/loop_optimization16_pkg.ads (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index bdb70ddb8c0..edecddf9118 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2013-08-13 Eric Botcazou + + * gcc-interface/trans.c (can_equal_min_or_max_val_p): Be prepared for + values outside of the range of the type. + 2013-06-13 Eric Botcazou * gcc-interface/ada-tree.h (DECL_BY_DOUBLE_REF_P): Delete. diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index cd78bf33a37..256827dbe16 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -2267,7 +2267,10 @@ can_equal_min_or_max_val_p (tree val, tree type, bool max) if (TREE_CODE (val) != INTEGER_CST) return true; - return tree_int_cst_equal (val, min_or_max_val) == 1; + if (max) + return tree_int_cst_lt (val, min_or_max_val) == 0; + else + return tree_int_cst_lt (min_or_max_val, val) == 0; } /* Return true if VAL (of type TYPE) can equal the minimum value of TYPE. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 55fd03d11c2..2da6d123c5a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-08-13 Eric Botcazou + + * gnat.dg/loop_optimization16.adb: New test. + * gnat.dg/loop_optimization16_pkg.ad[sb]: New helper. + 2013-08-13 Marek Polacek PR tree-optimization/57980 diff --git a/gcc/testsuite/gnat.dg/loop_optimization16.adb b/gcc/testsuite/gnat.dg/loop_optimization16.adb new file mode 100644 index 00000000000..b9f2b70bb45 --- /dev/null +++ b/gcc/testsuite/gnat.dg/loop_optimization16.adb @@ -0,0 +1,24 @@ +-- { dg-do run } + +with Loop_Optimization16_Pkg; use Loop_Optimization16_Pkg; + +procedure Loop_Optimization16 is + + Counter : Natural := 0; + + C : constant Natural := F; + + subtype Index_T is Index_Base range 1 .. Index_Base (C); + +begin + + for I in Index_T'First .. Index_T'Last loop + Counter := Counter + 1; + exit when Counter > 200; + end loop; + + if Counter > 200 then + raise Program_Error; + end if; + +end Loop_Optimization16; diff --git a/gcc/testsuite/gnat.dg/loop_optimization16_pkg.adb b/gcc/testsuite/gnat.dg/loop_optimization16_pkg.adb new file mode 100644 index 00000000000..e4142f6e6a1 --- /dev/null +++ b/gcc/testsuite/gnat.dg/loop_optimization16_pkg.adb @@ -0,0 +1,8 @@ +package body Loop_Optimization16_Pkg is + + function F return Natural is + begin + return Natural (Index_Base'Last); + end; + +end Loop_Optimization16_Pkg; diff --git a/gcc/testsuite/gnat.dg/loop_optimization16_pkg.ads b/gcc/testsuite/gnat.dg/loop_optimization16_pkg.ads new file mode 100644 index 00000000000..abeecfb646f --- /dev/null +++ b/gcc/testsuite/gnat.dg/loop_optimization16_pkg.ads @@ -0,0 +1,7 @@ +package Loop_Optimization16_Pkg is + + type Index_Base is range 0 .. 127; + + function F return Natural; + +end Loop_Optimization16_Pkg; -- cgit v1.2.3 From 626bf7c23d563876f7176be3afcfce15b57b4af1 Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Tue, 13 Aug 2013 16:40:33 +0000 Subject: 2013-08-13 Vladimir Makarov Backport from mainline 2013-06-06 Vladimir Makarov PR rtl-optimization/57459 * lra-constraints.c (update_ebb_live_info): Fix typo for operand type when setting live regs. 2013-08-13 Vladimir Makarov Backport from mainline 2013-06-06 Vladimir Makarov PR rtl-optimization/57459 * gcc.target/i386/pr57459.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201695 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 9 +++++ gcc/lra-constraints.c | 2 +- gcc/testsuite/ChangeLog | 12 +++++-- gcc/testsuite/gcc.target/i386/pr57459.c | 60 +++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr57459.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7b987b326fe..42a5e1b420e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2013-08-13 Vladimir Makarov + + Backport from mainline + 2013-06-06 Vladimir Makarov + + PR rtl-optimization/57459 + * lra-constraints.c (update_ebb_live_info): Fix typo for operand + type when setting live regs. + 2013-08-13 Marek Polacek Jakub Jelinek diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index dfbe93a8037..2d8aa810eb9 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -4396,7 +4396,7 @@ update_ebb_live_info (rtx head, rtx tail) bitmap_clear_bit (&live_regs, reg->regno); /* Mark each used value as live. */ for (reg = curr_id->regs; reg != NULL; reg = reg->next) - if (reg->type == OP_IN + if (reg->type != OP_OUT && bitmap_bit_p (&check_only_regs, reg->regno)) bitmap_set_bit (&live_regs, reg->regno); /* It is quite important to remove dead move insns because it diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2da6d123c5a..fe8c5736da7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2013-08-13 Vladimir Makarov + + Backport from mainline + 2013-06-06 Vladimir Makarov + + PR rtl-optimization/57459 + * gcc.target/i386/pr57459.c: New test. + 2013-08-13 Eric Botcazou * gnat.dg/loop_optimization16.adb: New test. @@ -13,8 +21,8 @@ Backport from mainline 2013-08-12 Perez Read - PR target/58132 - * gcc.target/i386/movabs-1.c: New test. + PR target/58132 + * gcc.target/i386/movabs-1.c: New test. 2013-08-11 Janus Weil diff --git a/gcc/testsuite/gcc.target/i386/pr57459.c b/gcc/testsuite/gcc.target/i386/pr57459.c new file mode 100644 index 00000000000..75101145afc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr57459.c @@ -0,0 +1,60 @@ +/* PR rtl-optimization/57459 */ +/* { dg-do run } */ +/* { dg-options "-fno-inline -O2 -minline-all-stringops -fno-omit-frame-pointer" } */ + +int total1[10], total2[10], total3[10], total4[10], total5[10], a[20]; +int len; + +void stackclean() { + void *ptr = __builtin_alloca(20000); + __builtin_memset(ptr, 0, 20000); +} + +void foo(const char *s) { + int r1 = a[1]; + int r2 = a[2]; + int r3 = a[3]; + int r4 = a[4]; + int r5 = a[5]; + + len = __builtin_strlen(s); + + if (s != 0) + return; + + while (r1) { + total1[r1] = r1; + r1--; + } + + while (r2) { + total2[r2] = r2; + r2--; + } + + while (r3) { + total3[r3] = r3; + r3--; + } + + while (r4) { + total4[r4] = r4; + r4--; + } + + while (r5) { + total5[r5] = r5; + r5--; + } +} + +extern void abort (void); + +int main() { + stackclean(); + foo("abcdefgh"); + if (len != 8) + abort (); + return 0; +} + -- cgit v1.2.3 From a5a64365cbc9b8dc202eb4d74cdc75eafc45c149 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 13 Aug 2013 17:02:13 +0000 Subject: PR sanitizer/56417 * asan.c (instrument_strlen_call): Fix typo in comment. Use char * type even for the lhs of POINTER_PLUS_EXPR. * gcc.dg/asan/pr56417.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201697 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/asan.c | 9 ++++----- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/asan/pr56417.c | 9 +++++++++ 4 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/asan/pr56417.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 42a5e1b420e..b48e0a4084f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-08-13 Jakub Jelinek + + PR sanitizer/56417 + * asan.c (instrument_strlen_call): Fix typo in comment. + Use char * type even for the lhs of POINTER_PLUS_EXPR. + 2013-08-13 Vladimir Makarov Backport from mainline diff --git a/gcc/asan.c b/gcc/asan.c index 52a2dbc5dfd..d68579b2e5e 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -1675,7 +1675,7 @@ instrument_mem_region_access (tree base, tree len, access to the last byte of the argument; it uses the result of the call to deduce the offset of that last byte. - Upon completion, iff the call has actullay been instrumented, this + Upon completion, iff the call has actually been instrumented, this function returns TRUE and *ITER points to the statement logically following the built-in strlen function call *ITER was initially pointing to. Otherwise, the function returns FALSE and *ITER @@ -1706,10 +1706,10 @@ instrument_strlen_call (gimple_stmt_iterator *iter) /* Instrument the access to the first byte of str_arg. i.e: _1 = str_arg; instrument (_1); */ + tree cptr_type = build_pointer_type (char_type_node); gimple str_arg_ssa = gimple_build_assign_with_ops (NOP_EXPR, - make_ssa_name (build_pointer_type - (char_type_node), NULL), + make_ssa_name (cptr_type, NULL), str_arg, NULL); gimple_set_location (str_arg_ssa, loc); gimple_stmt_iterator gsi = *iter; @@ -1728,8 +1728,7 @@ instrument_strlen_call (gimple_stmt_iterator *iter) pointer_plus expr: (_1 + len). */ gimple stmt = gimple_build_assign_with_ops (POINTER_PLUS_EXPR, - make_ssa_name (TREE_TYPE (str_arg), - NULL), + make_ssa_name (cptr_type, NULL), gimple_assign_lhs (str_arg_ssa), len); gimple_set_location (stmt, loc); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fe8c5736da7..a305735aa24 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-08-13 Jakub Jelinek + + PR sanitizer/56417 + * gcc.dg/asan/pr56417.c: New test. + 2013-08-13 Vladimir Makarov Backport from mainline diff --git a/gcc/testsuite/gcc.dg/asan/pr56417.c b/gcc/testsuite/gcc.dg/asan/pr56417.c new file mode 100644 index 00000000000..b7eabf125aa --- /dev/null +++ b/gcc/testsuite/gcc.dg/asan/pr56417.c @@ -0,0 +1,9 @@ +/* PR sanitizer/56417 */ +/* { dg-do compile } */ +/* { dg-options "-w" } */ + +int +foo (void) +{ + return __builtin_strlen (&foo); +} -- cgit v1.2.3 From 9b2c7f7bf76ade99411ff20e852fe9c07951ed41 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Wed, 14 Aug 2013 00:16:42 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201716 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 524267245e1..6c3731088a1 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130813 +20130814 -- cgit v1.2.3 From 6dd8a8ea93f035f571060ac04f4e65cc3c02e6ac Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 14 Aug 2013 09:29:22 +0000 Subject: PR target/58067 * config/i386/i386.c (ix86_delegitimize_address): For CM_MEDIUM_PIC and CM_LARGE_PIC ix86_cmodel fall thru into the -m32 code, handle there also UNSPEC_PLTOFF. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201721 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 ++++++++ gcc/config/i386/i386.c | 40 +++++++++++++++++++++++++--------------- 2 files changed, 33 insertions(+), 15 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b48e0a4084f..281e90741ec 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2013-08-14 Jakub Jelinek + Alexandre Oliva + + PR target/58067 + * config/i386/i386.c (ix86_delegitimize_address): For CM_MEDIUM_PIC + and CM_LARGE_PIC ix86_cmodel fall thru into the -m32 code, handle + there also UNSPEC_PLTOFF. + 2013-08-13 Jakub Jelinek PR sanitizer/56417 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 5dab4f04abc..19e955f9392 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -13598,21 +13598,29 @@ ix86_delegitimize_address (rtx x) x = replace_equiv_address_nv (orig_x, x); return x; } - if (GET_CODE (x) != CONST - || GET_CODE (XEXP (x, 0)) != UNSPEC - || (XINT (XEXP (x, 0), 1) != UNSPEC_GOTPCREL - && XINT (XEXP (x, 0), 1) != UNSPEC_PCREL) - || (!MEM_P (orig_x) && XINT (XEXP (x, 0), 1) != UNSPEC_PCREL)) - return ix86_delegitimize_tls_address (orig_x); - x = XVECEXP (XEXP (x, 0), 0, 0); - if (GET_MODE (orig_x) != GET_MODE (x) && MEM_P (orig_x)) + + if (GET_CODE (x) == CONST + && GET_CODE (XEXP (x, 0)) == UNSPEC + && (XINT (XEXP (x, 0), 1) == UNSPEC_GOTPCREL + || XINT (XEXP (x, 0), 1) == UNSPEC_PCREL) + && (MEM_P (orig_x) || XINT (XEXP (x, 0), 1) == UNSPEC_PCREL)) { - x = simplify_gen_subreg (GET_MODE (orig_x), x, - GET_MODE (x), 0); - if (x == NULL_RTX) - return orig_x; + x = XVECEXP (XEXP (x, 0), 0, 0); + if (GET_MODE (orig_x) != GET_MODE (x) && MEM_P (orig_x)) + { + x = simplify_gen_subreg (GET_MODE (orig_x), x, + GET_MODE (x), 0); + if (x == NULL_RTX) + return orig_x; + } + return x; } - return x; + + if (ix86_cmodel != CM_MEDIUM_PIC && ix86_cmodel != CM_LARGE_PIC) + return ix86_delegitimize_tls_address (orig_x); + + /* Fall thru into the code shared with -m32 for -mcmodel=large -fpic + and -mcmodel=medium -fpic. */ } if (GET_CODE (x) != PLUS @@ -13649,10 +13657,12 @@ ix86_delegitimize_address (rtx x) if (GET_CODE (x) == UNSPEC && ((XINT (x, 1) == UNSPEC_GOT && MEM_P (orig_x) && !addend) - || (XINT (x, 1) == UNSPEC_GOTOFF && !MEM_P (orig_x)))) + || (XINT (x, 1) == UNSPEC_GOTOFF && !MEM_P (orig_x)) + || (XINT (x, 1) == UNSPEC_PLTOFF && ix86_cmodel == CM_LARGE_PIC + && !MEM_P (orig_x) && !addend))) result = XVECEXP (x, 0, 0); - if (TARGET_MACHO && darwin_local_data_pic (x) + if (!TARGET_64BIT && TARGET_MACHO && darwin_local_data_pic (x) && !MEM_P (orig_x)) result = XVECEXP (x, 0, 0); -- cgit v1.2.3 From 68e94167d3cffe4a58b485d8375af011002185b8 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 14 Aug 2013 14:09:59 +0000 Subject: Backport from mainline 2013-08-13 Uros Bizjak * config/i386/sse.md (*sse2_maskmovdqu): Emit addr32 prefix when Pmode != word_mode. Add length_address attribute. (sse3_monitor_): Merge from sse3_monitor and sse3_monitor64_ insn patterns. Emit addr32 prefix when Pmode != word_mode. Update insn length attribute. * config/i386/i386.c (ix86_option_override_internal): Update ix86_gen_monitor selection for merged sse3_monitor insn. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201726 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 13 +++++++++++++ gcc/config/i386/i386.c | 9 +++------ gcc/config/i386/sse.md | 28 ++++++++++++++-------------- 3 files changed, 30 insertions(+), 20 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 281e90741ec..999cb22e58d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2013-08-14 Uros Bizjak + + Backport from mainline + 2013-08-13 Uros Bizjak + + * config/i386/sse.md (*sse2_maskmovdqu): Emit addr32 prefix + when Pmode != word_mode. Add length_address attribute. + (sse3_monitor_): Merge from sse3_monitor and + sse3_monitor64_ insn patterns. Emit addr32 prefix when + Pmode != word_mode. Update insn length attribute. + * config/i386/i386.c (ix86_option_override_internal): Update + ix86_gen_monitor selection for merged sse3_monitor insn. + 2013-08-14 Jakub Jelinek Alexandre Oliva diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 19e955f9392..35cf1ef4a17 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3768,24 +3768,19 @@ ix86_option_override_internal (bool main_args_p) ix86_gen_leave = gen_leave_rex64; if (Pmode == DImode) { - ix86_gen_monitor = gen_sse3_monitor64_di; ix86_gen_tls_global_dynamic_64 = gen_tls_global_dynamic_64_di; ix86_gen_tls_local_dynamic_base_64 = gen_tls_local_dynamic_base_64_di; } else { - ix86_gen_monitor = gen_sse3_monitor64_si; ix86_gen_tls_global_dynamic_64 = gen_tls_global_dynamic_64_si; ix86_gen_tls_local_dynamic_base_64 = gen_tls_local_dynamic_base_64_si; } } else - { - ix86_gen_leave = gen_leave; - ix86_gen_monitor = gen_sse3_monitor; - } + ix86_gen_leave = gen_leave; if (Pmode == DImode) { @@ -3797,6 +3792,7 @@ ix86_option_override_internal (bool main_args_p) ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_di; ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probedi; ix86_gen_probe_stack_range = gen_probe_stack_rangedi; + ix86_gen_monitor = gen_sse3_monitor_di; } else { @@ -3808,6 +3804,7 @@ ix86_option_override_internal (bool main_args_p) ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_si; ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probesi; ix86_gen_probe_stack_range = gen_probe_stack_rangesi; + ix86_gen_monitor = gen_sse3_monitor_si; } #ifdef USE_IX86_CLD diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 4f9bd658e2d..05cf7f9a05e 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -7758,9 +7758,17 @@ (mem:V16QI (match_dup 0))] UNSPEC_MASKMOV))] "TARGET_SSE2" - "%vmaskmovdqu\t{%2, %1|%1, %2}" +{ + /* We can't use %^ here due to ASM_OUTPUT_OPCODE processing + that requires %v to be at the beginning of the opcode name. */ + if (Pmode != word_mode) + fputs ("\taddr32", asm_out_file); + return "%vmaskmovdqu\t{%2, %1|%1, %2}"; +} [(set_attr "type" "ssemov") (set_attr "prefix_data16" "1") + (set (attr "length_address") + (symbol_ref ("Pmode != word_mode"))) ;; The implicit %rdi operand confuses default length_vex computation. (set (attr "length_vex") (symbol_ref ("3 + REX_SSE_REGNO_P (REGNO (operands[2]))"))) @@ -7808,26 +7816,18 @@ "mwait" [(set_attr "length" "3")]) -(define_insn "sse3_monitor" - [(unspec_volatile [(match_operand:SI 0 "register_operand" "a") - (match_operand:SI 1 "register_operand" "c") - (match_operand:SI 2 "register_operand" "d")] - UNSPECV_MONITOR)] - "TARGET_SSE3 && !TARGET_64BIT" - "monitor\t%0, %1, %2" - [(set_attr "length" "3")]) - -(define_insn "sse3_monitor64_" +(define_insn "sse3_monitor_" [(unspec_volatile [(match_operand:P 0 "register_operand" "a") (match_operand:SI 1 "register_operand" "c") (match_operand:SI 2 "register_operand" "d")] UNSPECV_MONITOR)] - "TARGET_SSE3 && TARGET_64BIT" + "TARGET_SSE3" ;; 64bit version is "monitor %rax,%rcx,%rdx". But only lower 32bits in ;; RCX and RDX are used. Since 32bit register operands are implicitly ;; zero extended to 64bit, we only need to set up 32bit registers. - "monitor" - [(set_attr "length" "3")]) + "%^monitor" + [(set (attr "length") + (symbol_ref ("(Pmode != word_mode) + 3")))]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; -- cgit v1.2.3 From 1610b6d172f3198a4f34849ff1981ea1791bb18d Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Wed, 14 Aug 2013 19:44:27 +0000 Subject: 2013-08-14 Andreas Krebbel * config/s390/htmxlintrin.h: Add file missing from last commit. * config/s390/htmintrin.h: Likewise. * config/s390/s390intrin.h: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201746 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++ gcc/config/s390/htmintrin.h | 57 +++++++++++++ gcc/config/s390/htmxlintrin.h | 182 ++++++++++++++++++++++++++++++++++++++++++ gcc/config/s390/s390intrin.h | 33 ++++++++ 4 files changed, 278 insertions(+) create mode 100644 gcc/config/s390/htmintrin.h create mode 100644 gcc/config/s390/htmxlintrin.h create mode 100644 gcc/config/s390/s390intrin.h (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 999cb22e58d..310ca0532f7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-08-14 Andreas Krebbel + + * config/s390/htmxlintrin.h: Add file missing from last commit. + * config/s390/htmintrin.h: Likewise. + * config/s390/s390intrin.h: Likewise. + 2013-08-14 Uros Bizjak Backport from mainline diff --git a/gcc/config/s390/htmintrin.h b/gcc/config/s390/htmintrin.h new file mode 100644 index 00000000000..7aaa9f5bf7c --- /dev/null +++ b/gcc/config/s390/htmintrin.h @@ -0,0 +1,57 @@ +/* GNU compiler hardware transactional execution intrinsics + Copyright (C) 2013 Free Software Foundation, Inc. + Contributed by Andreas Krebbel (Andreas.Krebbel@de.ibm.com) + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#ifndef _HTMINTRIN_H +#define _HTMINTRIN_H + + +/* Condition codes generated by tbegin */ +#define _HTM_TBEGIN_STARTED 0 +#define _HTM_TBEGIN_INDETERMINATE 1 +#define _HTM_TBEGIN_TRANSIENT 2 +#define _HTM_TBEGIN_PERSISTENT 3 + +/* The abort codes below this threshold are reserved for machine + use. */ +#define _HTM_FIRST_USER_ABORT_CODE 256 + +/* The transaction diagnostic block is it is defined in the Principles + of Operation chapter 5-91. */ + +struct __htm_tdb { + unsigned char format; /* 0 */ + unsigned char flags; + unsigned char reserved1[4]; + unsigned short nesting_depth; + unsigned long long abort_code; /* 8 */ + unsigned long long conflict_token; /* 16 */ + unsigned long long atia; /* 24 */ + unsigned char eaid; /* 32 */ + unsigned char dxc; + unsigned char reserved2[2]; + unsigned int program_int_id; + unsigned long long exception_id; /* 40 */ + unsigned long long bea; /* 48 */ + unsigned char reserved3[72]; /* 56 */ + unsigned long long gprs[16]; /* 128 */ +} __attribute__((__packed__, __aligned__ (8))); + + +#endif /* _HTMINTRIN_H */ diff --git a/gcc/config/s390/htmxlintrin.h b/gcc/config/s390/htmxlintrin.h new file mode 100644 index 00000000000..bb142195b2b --- /dev/null +++ b/gcc/config/s390/htmxlintrin.h @@ -0,0 +1,182 @@ +/* XL compiler hardware transactional execution intrinsics + Copyright (C) 2013 Free Software Foundation, Inc. + Contributed by Andreas Krebbel (Andreas.Krebbel@de.ibm.com) + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#ifndef _HTMXLINTRIN_H +#define _HTMXLINTRIN_H + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* These intrinsics are being made available for compatibility with + the IBM XL compiler. For documentation please see the "z/OS XL + C/C++ Programming Guide" publically available on the web. */ + +extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_simple_begin () +{ + return __builtin_tbegin_nofloat (0); +} + +extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_begin (void* const tdb) +{ + return __builtin_tbegin_nofloat (tdb); +} + +extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_end () +{ + return __builtin_tend (); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_abort () +{ + return __builtin_tabort (_HTM_FIRST_USER_ABORT_CODE); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_named_abort (unsigned char const code) +{ + return __builtin_tabort ((int)_HTM_FIRST_USER_ABORT_CODE + code); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_non_transactional_store (void* const addr, long long const value) +{ + __builtin_non_tx_store ((uint64_t*)addr, (uint64_t)value); +} + +extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_nesting_depth (void* const tdb_ptr) +{ + int depth = __builtin_tx_nesting_depth (); + struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr; + + if (depth != 0) + return depth; + + if (tdb->format == 0) + return 0; + return tdb->nesting_depth; +} + +/* Transaction failure diagnostics */ + +extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_is_user_abort (void* const tdb_ptr) +{ + struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr; + + if (tdb->format == 0) + return 0; + + return !!(tdb->abort_code >= _HTM_FIRST_USER_ABORT_CODE); +} + +extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_is_named_user_abort (void* const tdb_ptr, unsigned char* code) +{ + struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr; + + if (tdb->format == 0) + return 0; + + if (tdb->abort_code >= _HTM_FIRST_USER_ABORT_CODE) + { + *code = tdb->abort_code - _HTM_FIRST_USER_ABORT_CODE; + return 1; + } + return 0; +} + +extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_is_illegal (void* const tdb_ptr) +{ + struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr; + + return (tdb->format == 0 + && (tdb->abort_code == 4 /* unfiltered program interruption */ + || tdb->abort_code == 11 /* restricted instruction */)); +} + +extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_is_footprint_exceeded (void* const tdb_ptr) +{ + struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr; + + return (tdb->format == 0 + && (tdb->abort_code == 7 /* fetch overflow */ + || tdb->abort_code == 8 /* store overflow */)); +} + +extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_is_nested_too_deep (void* const tdb_ptr) +{ + struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr; + + return tdb->format == 0 && tdb->abort_code == 13; /* depth exceeded */ +} + +extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_is_conflict (void* const tdb_ptr) +{ + struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr; + + return (tdb->format == 0 + && (tdb->abort_code == 9 /* fetch conflict */ + || tdb->abort_code == 10 /* store conflict */)); +} + +extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_is_failure_persistent (long const result) +{ + return result == _HTM_TBEGIN_PERSISTENT; +} + +extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_failure_address (void* const tdb_ptr) +{ + struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr; +#ifdef __s390x__ + return tdb->atia; +#else + return tdb->atia & 0xffffffff; +#endif +} + +extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +__TM_failure_code (void* const tdb_ptr) +{ + struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr; + + return tdb->abort_code; +} + +#ifdef __cplusplus +} +#endif + +#endif /* _HTMXLINTRIN_H */ diff --git a/gcc/config/s390/s390intrin.h b/gcc/config/s390/s390intrin.h new file mode 100644 index 00000000000..e1a00ce58e3 --- /dev/null +++ b/gcc/config/s390/s390intrin.h @@ -0,0 +1,33 @@ +/* S/390 System z specific intrinsics + Copyright (C) 2013 Free Software Foundation, Inc. + Contributed by Andreas Krebbel (Andreas.Krebbel@de.ibm.com) + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#ifndef _S390INTRIN_H +#define _S390INTRIN_H + +#ifndef __s390__ + #error s390intrin.h included on wrong platform/compiler +#endif + +#ifdef __HTM__ +#include +#endif + + +#endif /* _S390INTRIN_H*/ -- cgit v1.2.3 From 8881ed3db5099022532fda5ec6e4f1b66dc66e45 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 14 Aug 2013 20:36:12 +0000 Subject: PR tree-optimization/58145 * tree-sra.c (build_ref_for_offset): If prev_base has TREE_THIS_VOLATILE or TREE_SIDE_EFFECTS, propagate it to MEM_REF. * gcc.dg/pr58145-1.c: New test. * gcc.dg/pr58145-2.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201749 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 +++++ gcc/testsuite/ChangeLog | 6 +++++ gcc/testsuite/gcc.dg/pr58145-1.c | 37 +++++++++++++++++++++++++++++ gcc/testsuite/gcc.dg/pr58145-2.c | 51 ++++++++++++++++++++++++++++++++++++++++ gcc/tree-sra.c | 8 ++++++- 5 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/pr58145-1.c create mode 100644 gcc/testsuite/gcc.dg/pr58145-2.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 310ca0532f7..354307fa0a3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-08-14 Jakub Jelinek + + PR tree-optimization/58145 + * tree-sra.c (build_ref_for_offset): If prev_base has + TREE_THIS_VOLATILE or TREE_SIDE_EFFECTS, propagate it to MEM_REF. + 2013-08-14 Andreas Krebbel * config/s390/htmxlintrin.h: Add file missing from last commit. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a305735aa24..c88cb4d3d34 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-08-14 Jakub Jelinek + + PR tree-optimization/58145 + * gcc.dg/pr58145-1.c: New test. + * gcc.dg/pr58145-2.c: New test. + 2013-08-13 Jakub Jelinek PR sanitizer/56417 diff --git a/gcc/testsuite/gcc.dg/pr58145-1.c b/gcc/testsuite/gcc.dg/pr58145-1.c new file mode 100644 index 00000000000..0e236c0456d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr58145-1.c @@ -0,0 +1,37 @@ +/* PR tree-optimization/58145 */ +/* { dg-do compile { target { int32plus } } } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +struct S { unsigned int data : 32; }; +struct T { unsigned int data; }; +volatile struct S s2; + +void +f1 (int val) +{ + struct S s = { .data = val }; + *(volatile struct S *) 0x880000UL = s; +} + +void +f2 (int val) +{ + struct T t = { .data = val }; + *(volatile struct T *) 0x880000UL = t; +} + +void +f3 (int val) +{ + *(volatile unsigned int *) 0x880000UL = val; +} + +void +f4 (int val) +{ + struct S s = { .data = val }; + s2 = s; +} + +/* { dg-final { scan-tree-dump-times " ={v} " 4 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/pr58145-2.c b/gcc/testsuite/gcc.dg/pr58145-2.c new file mode 100644 index 00000000000..840e9828972 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr58145-2.c @@ -0,0 +1,51 @@ +/* PR tree-optimization/58145 */ +/* { dg-do compile { target { int32plus } } } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +struct S { unsigned int data : 32; }; +struct T { unsigned int data; }; +volatile struct S s2; + +static inline void +f1 (int val) +{ + struct S s = { .data = val }; + *(volatile struct S *) 0x880000UL = s; +} + +static inline void +f2 (int val) +{ + struct T t = { .data = val }; + *(volatile struct T *) 0x880000UL = t; +} + +static inline void +f3 (int val) +{ + *(volatile unsigned int *) 0x880000UL = val; +} + +static inline void +f4 (int val) +{ + struct S s = { .data = val }; + s2 = s; +} + +void +f5 (void) +{ + int i; + for (i = 0; i < 100; i++) + f1 (0); + for (i = 0; i < 100; i++) + f2 (0); + for (i = 0; i < 100; i++) + f3 (0); + for (i = 0; i < 100; i++) + f4 (0); +} + +/* { dg-final { scan-tree-dump-times " ={v} " 4 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index bb04fd74446..627fadc66a6 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -1440,6 +1440,7 @@ build_ref_for_offset (location_t loc, tree base, HOST_WIDE_INT offset, { tree prev_base = base; tree off; + tree mem_ref; HOST_WIDE_INT base_offset; unsigned HOST_WIDE_INT misalign; unsigned int align; @@ -1490,7 +1491,12 @@ build_ref_for_offset (location_t loc, tree base, HOST_WIDE_INT offset, if (align < TYPE_ALIGN (exp_type)) exp_type = build_aligned_type (exp_type, align); - return fold_build2_loc (loc, MEM_REF, exp_type, base, off); + mem_ref = fold_build2_loc (loc, MEM_REF, exp_type, base, off); + if (TREE_THIS_VOLATILE (prev_base)) + TREE_THIS_VOLATILE (mem_ref) = 1; + if (TREE_SIDE_EFFECTS (prev_base)) + TREE_SIDE_EFFECTS (mem_ref) = 1; + return mem_ref; } /* Construct a memory reference to a part of an aggregate BASE at the given -- cgit v1.2.3 From 870f8283020ef173647ddcd1e91dfb722b689382 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Thu, 15 Aug 2013 00:16:31 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201757 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 6c3731088a1..9ca2dbb5530 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130814 +20130815 -- cgit v1.2.3 From e76bac4bb2e6e3c38612a882859d9940c0dcc88a Mon Sep 17 00:00:00 2001 From: Chung-Ju Wu Date: Thu, 15 Aug 2013 08:03:32 +0000 Subject: 2013-08-15 David Given Backport from mainline 2013-04-26 Vladimir Makarov * lra-constraints.c (process_alt_operands): Use #if HAVE_ATTR_enable instead of #ifdef. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201764 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 ++++++++ gcc/lra-constraints.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 354307fa0a3..9729ce3ba72 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2013-08-15 David Given + + Backport from mainline + 2013-04-26 Vladimir Makarov + + * lra-constraints.c (process_alt_operands): Use #if HAVE_ATTR_enable + instead of #ifdef. + 2013-08-14 Jakub Jelinek PR tree-optimization/58145 diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 2d8aa810eb9..32e8c45f287 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -1388,7 +1388,7 @@ process_alt_operands (int only_alternative) for (nalt = 0; nalt < n_alternatives; nalt++) { /* Loop over operands for one constraint alternative. */ -#ifdef HAVE_ATTR_enabled +#if HAVE_ATTR_enabled if (curr_id->alternative_enabled_p != NULL && ! curr_id->alternative_enabled_p[nalt]) continue; -- cgit v1.2.3 From d79083c53f7a22f8d36420ba2ae0944951976e8b Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Fri, 16 Aug 2013 00:16:32 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201778 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 9ca2dbb5530..bbb921dec99 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130815 +20130816 -- cgit v1.2.3 From 52a2bbf9c101ded60dcbe16a7af466e439f00807 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 16 Aug 2013 09:04:52 +0000 Subject: PR tree-optimization/58165 * tree-call-cdce.c (shrink_wrap_one_built_in_call): If bi_call must be the last stmt in a bb, don't split_block, instead use fallthru edge from it and give up if there is none. Release conds vector when returning early. * g++.dg/opt/pr58165.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201781 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 ++++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/opt/pr58165.C | 14 ++++++++++++++ gcc/tree-call-cdce.c | 23 ++++++++++++++++++----- 4 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/g++.dg/opt/pr58165.C (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9729ce3ba72..223b0a136af 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2013-08-16 Jakub Jelinek + + PR tree-optimization/58165 + * tree-call-cdce.c (shrink_wrap_one_built_in_call): If + bi_call must be the last stmt in a bb, don't split_block, instead + use fallthru edge from it and give up if there is none. + Release conds vector when returning early. + 2013-08-15 David Given Backport from mainline diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c88cb4d3d34..e5e695a2d96 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-08-16 Jakub Jelinek + + PR tree-optimization/58165 + * g++.dg/opt/pr58165.C: New test. + 2013-08-14 Jakub Jelinek PR tree-optimization/58145 diff --git a/gcc/testsuite/g++.dg/opt/pr58165.C b/gcc/testsuite/g++.dg/opt/pr58165.C new file mode 100644 index 00000000000..d758e370050 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr58165.C @@ -0,0 +1,14 @@ +// PR tree-optimization/58165 +// { dg-do compile } +// { dg-options "-O2" } + +extern "C" float sqrtf (float); + +struct A { A (); ~A (); }; + +void +foo (double d) +{ + A a; + sqrtf (d); +} diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c index 9b6186e3393..f145f1752c9 100644 --- a/gcc/tree-call-cdce.c +++ b/gcc/tree-call-cdce.c @@ -726,15 +726,28 @@ shrink_wrap_one_built_in_call (gimple bi_call) return false and do not do any transformation for the call. */ if (nconds == 0) - return false; + { + conds.release (); + return false; + } bi_call_bb = gimple_bb (bi_call); - /* Now find the join target bb -- split - bi_call_bb if needed. */ - bi_call_bsi = gsi_for_stmt (bi_call); + /* Now find the join target bb -- split bi_call_bb if needed. */ + if (stmt_ends_bb_p (bi_call)) + { + /* If the call must be the last in the bb, don't split the block, + it could e.g. have EH edges. */ + join_tgt_in_edge_from_call = find_fallthru_edge (bi_call_bb->succs); + if (join_tgt_in_edge_from_call == NULL) + { + conds.release (); + return false; + } + } + else + join_tgt_in_edge_from_call = split_block (bi_call_bb, bi_call); - join_tgt_in_edge_from_call = split_block (bi_call_bb, bi_call); bi_call_bsi = gsi_for_stmt (bi_call); join_tgt_bb = join_tgt_in_edge_from_call->dest; -- cgit v1.2.3 From 20601ac26172363fb03b7aa7bda175d9ad650d2f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 16 Aug 2013 09:06:41 +0000 Subject: PR tree-optimization/58164 * gimple.c (walk_stmt_load_store_addr_ops): For visit_addr walk gimple_goto_dest of GIMPLE_GOTO. * gcc.c-torture/compile/pr58164.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201784 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/gimple.c | 7 +++++++ gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gcc.c-torture/compile/pr58164.c | 8 ++++++++ 4 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr58164.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 223b0a136af..bdcb43f7a38 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2013-08-16 Jakub Jelinek + PR tree-optimization/58164 + * gimple.c (walk_stmt_load_store_addr_ops): For visit_addr + walk gimple_goto_dest of GIMPLE_GOTO. + PR tree-optimization/58165 * tree-call-cdce.c (shrink_wrap_one_built_in_call): If bi_call must be the last stmt in a bb, don't split_block, instead diff --git a/gcc/gimple.c b/gcc/gimple.c index 785c2f021a7..97a37e32df7 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -4045,6 +4045,13 @@ walk_stmt_load_store_addr_ops (gimple stmt, void *data, ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data); } } + else if (visit_addr + && gimple_code (stmt) == GIMPLE_GOTO) + { + tree op = gimple_goto_dest (stmt); + if (TREE_CODE (op) == ADDR_EXPR) + ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data); + } return ret; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e5e695a2d96..e196017e2ea 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2013-08-16 Jakub Jelinek + PR tree-optimization/58164 + * gcc.c-torture/compile/pr58164.c: New test. + PR tree-optimization/58165 * g++.dg/opt/pr58165.C: New test. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr58164.c b/gcc/testsuite/gcc.c-torture/compile/pr58164.c new file mode 100644 index 00000000000..7fe24fa439f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr58164.c @@ -0,0 +1,8 @@ +/* PR tree-optimization/58164 */ + +int +foo (void) +{ + int x = 0; + goto *&x; +} -- cgit v1.2.3 From 15021af997cfe1fc99301bb539df276f69585f29 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sat, 17 Aug 2013 00:16:23 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201810 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index bbb921dec99..c83faabf30a 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130816 +20130817 -- cgit v1.2.3 From 1835eba99a051e9e07525c724076e982679ee1e3 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 17 Aug 2013 18:04:58 +0000 Subject: compiler: Don't generate value reference in range clause if receiver is a sink. The panic in test/fixedbugs/bug454.go was caused by the generation of an unnecessary var reference when writing a range value into a sink. If the receiving variable is a sink, there's no need to dereference a possible NULL pointer. Fixes Issue 24. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201816 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/parse.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index 429d91bafe2..9d112850fee 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -5266,7 +5266,8 @@ Parse::range_clause_decl(const Typed_identifier_list* til, no->var_value()->set_type_from_range_value(); if (is_new) any_new = true; - p_range_clause->value = Expression::make_var_reference(no, location); + if (!Gogo::is_sink_name(pti->name())) + p_range_clause->value = Expression::make_var_reference(no, location); } if (!any_new) -- cgit v1.2.3 From 87e14b46a8fded273e6d48875b7943e3ae5c6400 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sun, 18 Aug 2013 00:16:22 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201820 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index c83faabf30a..b68ea252647 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130817 +20130818 -- cgit v1.2.3 From 5a569d9739fd0a5d80128da1d0fbc04db1d83261 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sun, 18 Aug 2013 01:07:02 +0000 Subject: PR c++/58083 * name-lookup.c (push_class_level_binding_1): It's OK to push a lambda type after the enclosing type is complete. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201823 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 6 +++++ gcc/cp/name-lookup.c | 6 +++-- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C | 30 ++++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index fde680d0def..f17d4c221cf 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-08-17 Jason Merrill + + PR c++/58083 + * name-lookup.c (push_class_level_binding_1): It's OK to push a + lambda type after the enclosing type is complete. + 2013-08-06 Jason Merrill PR c++/57825 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 2a47331ea73..c121a4163a9 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -3015,8 +3015,10 @@ push_class_level_binding_1 (tree name, tree x) if (name == error_mark_node) return false; - /* Check for invalid member names. */ - gcc_assert (TYPE_BEING_DEFINED (current_class_type)); + /* Check for invalid member names. But don't worry about a default + argument-scope lambda being pushed after the class is complete. */ + gcc_assert (TYPE_BEING_DEFINED (current_class_type) + || LAMBDA_TYPE_P (TREE_TYPE (decl))); /* Check that we're pushing into the right binding level. */ gcc_assert (current_class_type == class_binding_level->this_entity); diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C new file mode 100644 index 00000000000..d85918dd07b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C @@ -0,0 +1,30 @@ +// PR c++/58083 +// { dg-do compile { target c++11 } } + +namespace details { +struct iterator_concept_checker +{ + typedef char yes_type; + typedef char (&no_type)[2]; + + template + static no_type test(...); + + template + static yes_type test( + int* + , void (*)(T) = [](T it) + { + auto copy = T{it}; // copy constructible + copy = it; // copy assignable + copy.~T(); // destroyable + ++it; // incrementable + } + ); +}; +} + +int main() +{ + details::iterator_concept_checker::test(0); +} -- cgit v1.2.3 From 44301ccad6d0ed0104ab0d1aae518aba166283c3 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sun, 18 Aug 2013 15:24:12 +0000 Subject: PR tree-optimization/58006 * tree-parloops.c (take_address_of): Don't ICE if get_name returns NULL. (eliminate_local_variables_stmt): Remove clobber stmts. * g++.dg/opt/pr58006.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201828 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/opt/pr58006.C | 22 ++++++++++++++++++++++ gcc/tree-parloops.c | 15 ++++++++++++--- 4 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/g++.dg/opt/pr58006.C (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bdcb43f7a38..a6ef4d79e3d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-08-18 Jakub Jelinek + + PR tree-optimization/58006 + * tree-parloops.c (take_address_of): Don't ICE if get_name + returns NULL. + (eliminate_local_variables_stmt): Remove clobber stmts. + 2013-08-16 Jakub Jelinek PR tree-optimization/58164 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e196017e2ea..ec5d8550989 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-08-18 Jakub Jelinek + + PR tree-optimization/58006 + * g++.dg/opt/pr58006.C: New test. + 2013-08-16 Jakub Jelinek PR tree-optimization/58164 diff --git a/gcc/testsuite/g++.dg/opt/pr58006.C b/gcc/testsuite/g++.dg/opt/pr58006.C new file mode 100644 index 00000000000..fd3b7bebd8a --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr58006.C @@ -0,0 +1,22 @@ +// PR tree-optimization/58006 +// { dg-do compile } +// { dg-require-effective-target pthread } +// { dg-options "-Ofast -ftree-parallelize-loops=2" } + +extern "C" float sqrtf (float); + +struct S +{ + float i, j; + float foo () const { return sqrtf (i * i + j * j); } + S () : i (1), j (1) {} +}; + +void +bar (int a, int b) +{ + int i; + float f; + for (i = a; i < b; i++) + f = S ().foo (); +} diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index d7b846ae79b..9d2c3ca3b41 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -478,9 +478,12 @@ take_address_of (tree obj, tree type, edge entry, htab_t decl_address, if (gsi == NULL) return NULL; addr = TREE_OPERAND (*var_p, 0); - name = make_temp_ssa_name (TREE_TYPE (addr), NULL, - get_name (TREE_OPERAND - (TREE_OPERAND (*var_p, 0), 0))); + const char *obj_name + = get_name (TREE_OPERAND (TREE_OPERAND (*var_p, 0), 0)); + if (obj_name) + name = make_temp_ssa_name (TREE_TYPE (addr), NULL, obj_name); + else + name = make_ssa_name (TREE_TYPE (addr), NULL); stmt = gimple_build_assign (name, addr); gsi_insert_on_edge_immediate (entry, stmt); @@ -679,6 +682,12 @@ eliminate_local_variables_stmt (edge entry, gimple_stmt_iterator *gsi, dta.changed = true; } } + else if (gimple_clobber_p (stmt)) + { + stmt = gimple_build_nop (); + gsi_replace (gsi, stmt, false); + dta.changed = true; + } else { dta.gsi = gsi; -- cgit v1.2.3 From 2505700945d985165b9dbf7935505486ad705a2e Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Mon, 19 Aug 2013 00:16:39 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201831 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index b68ea252647..c84a8e2f7b9 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130818 +20130819 -- cgit v1.2.3 From a61569b913b603d1e803d0fa5af4ecebf726592a Mon Sep 17 00:00:00 2001 From: Peter Bergner Date: Mon, 19 Aug 2013 17:55:50 +0000 Subject: Backport from mainline * config/rs6000/dfp.md (*negtd2_fpr): Handle non-overlapping destination and source operands. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201850 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/config/rs6000/dfp.md | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a6ef4d79e3d..02e6c578cd5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-08-19 Peter Bergner + Jakub Jelinek + + Backport from mainline + * config/rs6000/dfp.md (*negtd2_fpr): Handle non-overlapping destination + and source operands. + 2013-08-18 Jakub Jelinek PR tree-optimization/58006 diff --git a/gcc/config/rs6000/dfp.md b/gcc/config/rs6000/dfp.md index f73e115e342..040bae49001 100644 --- a/gcc/config/rs6000/dfp.md +++ b/gcc/config/rs6000/dfp.md @@ -394,11 +394,14 @@ "") (define_insn "*negtd2_fpr" - [(set (match_operand:TD 0 "gpc_reg_operand" "=d") - (neg:TD (match_operand:TD 1 "gpc_reg_operand" "d")))] + [(set (match_operand:TD 0 "gpc_reg_operand" "=d,d") + (neg:TD (match_operand:TD 1 "gpc_reg_operand" "0,d")))] "TARGET_HARD_FLOAT && TARGET_FPRS" - "fneg %0,%1" - [(set_attr "type" "fp")]) + "@ + fneg %0,%1 + fneg %0,%1\;fmr %L0,%L1" + [(set_attr "type" "fp") + (set_attr "length" "4,8")]) (define_expand "abstd2" [(set (match_operand:TD 0 "gpc_reg_operand" "") -- cgit v1.2.3 From d70c93b691ac1ee5225f81c19c0a976ff107ad12 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Tue, 20 Aug 2013 00:16:48 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201862 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index c84a8e2f7b9..edd7430ef82 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130819 +20130820 -- cgit v1.2.3 From 50dae77215185b26f20d294e86b86281a8978418 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 20 Aug 2013 01:05:10 +0000 Subject: PR target/57865 * config/rs6000/rs6000.c (rs6000_emit_prologue): Correct ool_adjust. (rs6000_emit_epilogue): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201866 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/rs6000.c | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 02e6c578cd5..aea18a64aad 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-08-20 Alan Modra + + PR target/57865 + * config/rs6000/rs6000.c (rs6000_emit_prologue): Correct ool_adjust. + (rs6000_emit_epilogue): Likewise. + 2013-08-19 Peter Bergner Jakub Jelinek diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index d92248ed404..e8266decb90 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -19960,8 +19960,7 @@ rs6000_emit_prologue (void) HOST_WIDE_INT offset; if (!(strategy & SAVE_INLINE_GPRS)) - ool_adjust = 8 * (info->first_gp_reg_save - - (FIRST_SAVRES_REGISTER + 1)); + ool_adjust = 8 * (info->first_gp_reg_save - FIRST_SAVED_GP_REGNO); offset = info->spe_gp_save_offset + frame_off - ool_adjust; spe_save_area_ptr = gen_rtx_REG (Pmode, 11); save_off = frame_off - offset; @@ -21203,8 +21202,7 @@ rs6000_emit_epilogue (int sibcall) anew to every function. */ if (!restoring_GPRs_inline) - ool_adjust = 8 * (info->first_gp_reg_save - - (FIRST_SAVRES_REGISTER + 1)); + ool_adjust = 8 * (info->first_gp_reg_save - FIRST_SAVED_GP_REGNO); frame_reg_rtx = gen_rtx_REG (Pmode, 11); emit_insn (gen_addsi3 (frame_reg_rtx, old_frame_reg_rtx, GEN_INT (info->spe_gp_save_offset -- cgit v1.2.3 From 71ee94a3f5dd85dabaf16b2c315dbc49474a26e4 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 20 Aug 2013 11:56:29 +0000 Subject: 2013-08-20 Paolo Carlini PR c++/58190 * g++.dg/pr57878.C: Use __SIZE_TYPE__. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201876 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 7 ++++++- gcc/testsuite/g++.dg/pr57878.C | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ec5d8550989..8dac4942e78 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-08-20 Paolo Carlini + + PR c++/58190 + * g++.dg/pr57878.C: Use __SIZE_TYPE__. + 2013-08-18 Jakub Jelinek PR tree-optimization/58006 @@ -110,7 +115,7 @@ 2013-07-18 Wei Mi PR rtl-optimization/57878 - * g++.dg/pr57518.C: New test. + * g++.dg/pr57878.C: New test. 2013-07-19 Georg-Johann Lay diff --git a/gcc/testsuite/g++.dg/pr57878.C b/gcc/testsuite/g++.dg/pr57878.C index b1aa25c486c..da4fc4bb563 100644 --- a/gcc/testsuite/g++.dg/pr57878.C +++ b/gcc/testsuite/g++.dg/pr57878.C @@ -6,7 +6,7 @@ typedef long long int64; typedef unsigned int uint32; typedef unsigned long long uint64; namespace std { - typedef unsigned int size_t; + typedef __SIZE_TYPE__ size_t; template struct char_traits; template @@ -22,7 +22,7 @@ namespace std { return static_cast<_Tp&&>(__t); } } -typedef unsigned int size_t; +typedef __SIZE_TYPE__ size_t; extern "C++" { inline void* operator new(std::size_t, void* __p) noexcept { return __p; -- cgit v1.2.3 From 57f4f4502f48d9cd319d57290f61d50d4e0d5aad Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 20 Aug 2013 12:14:43 +0000 Subject: /testsuite 2013-07-25 Paolo Carlini PR c++/57981 * g++.dg/cpp0x/pr57981.C: New. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201877 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/g++.dg/cpp0x/pr57981.C | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/pr57981.C (limited to 'gcc') diff --git a/gcc/testsuite/g++.dg/cpp0x/pr57981.C b/gcc/testsuite/g++.dg/cpp0x/pr57981.C new file mode 100644 index 00000000000..5ee1f0ed6ff --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr57981.C @@ -0,0 +1,17 @@ +// { dg-options "-std=c++11 -Wall -Wextra" } + +template +void f(T t, void* = 0) // { dg-warning "unused parameter" } +{ +} + +template +auto g(T t) -> decltype(f(t)) +{ + f(t); +} + +int main() +{ + g(0); +} -- cgit v1.2.3 From b44994c6aa2aceb8235c39face4686951c8143da Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 20 Aug 2013 12:59:37 +0000 Subject: PR c++/58119 * cp-tree.h (WILDCARD_TYPE_P): Split out from... (MAYBE_CLASS_TYPE_P): ...here. * cvt.c (build_expr_type_conversion): Don't complain about a template that can't match the desired type category. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201882 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 8 ++++++++ gcc/cp/cp-tree.h | 17 ++++++++++------- gcc/cp/cvt.c | 23 ++++++++++++----------- gcc/testsuite/g++.dg/template/delete2.C | 26 ++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 18 deletions(-) create mode 100644 gcc/testsuite/g++.dg/template/delete2.C (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f17d4c221cf..b5dc49e9627 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2013-08-20 Jason Merrill + + PR c++/58119 + * cp-tree.h (WILDCARD_TYPE_P): Split out from... + (MAYBE_CLASS_TYPE_P): ...here. + * cvt.c (build_expr_type_conversion): Don't complain about a + template that can't match the desired type category. + 2013-08-17 Jason Merrill PR c++/58083 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index b10c53bc499..71b5bf6c96c 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1211,17 +1211,20 @@ enum languages { lang_c, lang_cplusplus, lang_java }; /* The _DECL for this _TYPE. */ #define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE))) -/* Nonzero if T is a class (or struct or union) type. Also nonzero - for template type parameters, typename types, and instantiated - template template parameters. Keep these checks in ascending code - order. */ -#define MAYBE_CLASS_TYPE_P(T) \ +/* Nonzero if T is a type that could resolve to any kind of concrete type + at instantiation time. */ +#define WILDCARD_TYPE_P(T) \ (TREE_CODE (T) == TEMPLATE_TYPE_PARM \ || TREE_CODE (T) == TYPENAME_TYPE \ || TREE_CODE (T) == TYPEOF_TYPE \ || TREE_CODE (T) == BOUND_TEMPLATE_TEMPLATE_PARM \ - || TREE_CODE (T) == DECLTYPE_TYPE \ - || CLASS_TYPE_P (T)) + || TREE_CODE (T) == DECLTYPE_TYPE) + +/* Nonzero if T is a class (or struct or union) type. Also nonzero + for template type parameters, typename types, and instantiated + template template parameters. Keep these checks in ascending code + order. */ +#define MAYBE_CLASS_TYPE_P(T) (WILDCARD_TYPE_P (T) || CLASS_TYPE_P (T)) /* Set CLASS_TYPE_P for T to VAL. T must be a class, struct, or union type. */ diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index f83f3704927..8c03e2086ce 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -1583,17 +1583,6 @@ build_expr_type_conversion (int desires, tree expr, bool complain) if (DECL_NONCONVERTING_P (cand)) continue; - if (TREE_CODE (cand) == TEMPLATE_DECL) - { - if (complain) - { - error ("ambiguous default type conversion from %qT", - basetype); - error (" candidate conversions include %qD", cand); - } - return error_mark_node; - } - candidate = non_reference (TREE_TYPE (TREE_TYPE (cand))); switch (TREE_CODE (candidate)) @@ -1627,11 +1616,23 @@ build_expr_type_conversion (int desires, tree expr, bool complain) break; default: + /* A wildcard could be instantiated to match any desired + type, but we can't deduce the template argument. */ + if (WILDCARD_TYPE_P (candidate)) + win = true; break; } if (win) { + if (TREE_CODE (cand) == TEMPLATE_DECL) + { + if (complain) + error ("default type conversion can't deduce template" + " argument for %qD", cand); + return error_mark_node; + } + if (winner) { if (complain) diff --git a/gcc/testsuite/g++.dg/template/delete2.C b/gcc/testsuite/g++.dg/template/delete2.C new file mode 100644 index 00000000000..b6ab380c9f9 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/delete2.C @@ -0,0 +1,26 @@ +// PR c++/58119 + +template +struct A +{ + operator T*(); + template + operator A(); +}; + +template +struct B +{ + operator T*(); + template + operator A*(); +}; + +int main() +{ + A a; + delete a; + + B b; + delete b; // { dg-error "template|delete" } +} -- cgit v1.2.3 From d0f42ff40982f097e3a265580e2c17fd4812c1bf Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Wed, 21 Aug 2013 00:16:47 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201893 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index edd7430ef82..ceb104d6a4e 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130820 +20130821 -- cgit v1.2.3 From f669e5a7b2790e4260042b9f162c9df34c84d2dc Mon Sep 17 00:00:00 2001 From: Richard Earnshaw Date: Wed, 21 Aug 2013 15:57:02 +0000 Subject: PR target/56979 * arm.c (aapcs_vfp_allocate): Decompose the argument if the suggested mode for the assignment isn't compatible with the registers required. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201903 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/config/arm/arm.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aea18a64aad..a1932917b22 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-08-21 Richard Earnshaw + + PR target/56979 + * arm.c (aapcs_vfp_allocate): Decompose the argument if the + suggested mode for the assignment isn't compatible with the + registers required. + 2013-08-20 Alan Modra PR target/57865 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index d76278bb531..ef92f880ecd 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -4459,7 +4459,9 @@ aapcs_vfp_allocate (CUMULATIVE_ARGS *pcum, enum machine_mode mode, if (((pcum->aapcs_vfp_regs_free >> regno) & mask) == mask) { pcum->aapcs_vfp_reg_alloc = mask << regno; - if (mode == BLKmode || (mode == TImode && !TARGET_NEON)) + if (mode == BLKmode + || (mode == TImode && ! TARGET_NEON) + || ! arm_hard_regno_mode_ok (FIRST_VFP_REGNUM + regno, mode)) { int i; int rcount = pcum->aapcs_vfp_rcount; -- cgit v1.2.3 From d558d64890111b6112e9706ef6ae067f275244ea Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Thu, 22 Aug 2013 00:16:17 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201912 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index ceb104d6a4e..6fe2a8a0600 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130821 +20130822 -- cgit v1.2.3 From 8e4b3cfad620c9350f3c81eb7b0c0af41eab8c88 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Fri, 23 Aug 2013 00:16:47 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201931 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 6fe2a8a0600..a370d32f95b 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130822 +20130823 -- cgit v1.2.3 From 5279692b81dc439f4bdf953528eb3dbc55507d2b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 23 Aug 2013 07:35:01 +0000 Subject: PR tree-optimization/58209 * tree-tailcall.c (find_tail_calls): Give up for pointer result types if m or a is non-NULL. * gcc.c-torture/execute/pr58209.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201937 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 +++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/execute/pr58209.c | 32 +++++++++++++++++++++++++++ gcc/tree-tailcall.c | 5 +++++ 4 files changed, 48 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr58209.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a1932917b22..d2760b5aede 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-08-23 Jakub Jelinek + + PR tree-optimization/58209 + * tree-tailcall.c (find_tail_calls): Give up for pointer result types + if m or a is non-NULL. + 2013-08-21 Richard Earnshaw PR target/56979 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8dac4942e78..e8d6aa1560f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-08-23 Jakub Jelinek + + PR tree-optimization/58209 + * gcc.c-torture/execute/pr58209.c: New test. + 2013-08-20 Paolo Carlini PR c++/58190 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr58209.c b/gcc/testsuite/gcc.c-torture/execute/pr58209.c new file mode 100644 index 00000000000..78743bfb959 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr58209.c @@ -0,0 +1,32 @@ +/* PR tree-optimization/58209 */ + +extern void abort (void); +typedef __INTPTR_TYPE__ T; +T buf[1024]; + +T * +foo (T n) +{ + if (n == 0) + return (T *) buf; + T s = (T) foo (n - 1); + return (T *) (s + sizeof (T)); +} + +T * +bar (T n) +{ + if (n == 0) + return buf; + return foo (n - 1) + 1; +} + +int +main () +{ + int i; + for (i = 0; i < 27; i++) + if (foo (i) != buf + i || bar (i) != buf + i) + abort (); + return 0; +} diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c index 350d707b235..b1b5f967325 100644 --- a/gcc/tree-tailcall.c +++ b/gcc/tree-tailcall.c @@ -574,6 +574,11 @@ find_tail_calls (basic_block bb, struct tailcall **ret) if (!tail_recursion && (m || a)) return; + /* For pointers don't allow additions or multiplications. */ + if ((m || a) + && POINTER_TYPE_P (TREE_TYPE (DECL_RESULT (current_function_decl)))) + return; + nw = XNEW (struct tailcall); nw->call_gsi = gsi; -- cgit v1.2.3 From 39576b88819179202dbdf04e4741cdcbfe42ca86 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 23 Aug 2013 10:01:34 +0000 Subject: PR target/58218 * config/i386/x86-64.h (TARGET_SECTION_TYPE_FLAGS): Define. * config/i386/i386.c (x86_64_elf_section_type_flags): New function. * gcc.target/i386/pr58218.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201939 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/config/i386/i386.c | 22 ++++++++++++++++++++++ gcc/config/i386/x86-64.h | 3 +++ gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gcc.target/i386/pr58218.c | 5 +++++ 5 files changed, 37 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr58218.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d2760b5aede..52cd1e20a6b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2013-08-23 Jakub Jelinek + PR target/58218 + * config/i386/x86-64.h (TARGET_SECTION_TYPE_FLAGS): Define. + * config/i386/i386.c (x86_64_elf_section_type_flags): New function. + PR tree-optimization/58209 * tree-tailcall.c (find_tail_calls): Give up for pointer result types if m or a is non-NULL. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 35cf1ef4a17..8475883823b 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4688,6 +4688,28 @@ x86_64_elf_select_section (tree decl, int reloc, return default_elf_select_section (decl, reloc, align); } +/* Select a set of attributes for section NAME based on the properties + of DECL and whether or not RELOC indicates that DECL's initializer + might contain runtime relocations. */ + +static unsigned int ATTRIBUTE_UNUSED +x86_64_elf_section_type_flags (tree decl, const char *name, int reloc) +{ + unsigned int flags = default_section_type_flags (decl, name, reloc); + + if (decl == NULL_TREE + && (strcmp (name, ".ldata.rel.ro") == 0 + || strcmp (name, ".ldata.rel.ro.local") == 0)) + flags |= SECTION_RELRO; + + if (strcmp (name, ".lbss") == 0 + || strncmp (name, ".lbss.", 5) == 0 + || strncmp (name, ".gnu.linkonce.lb.", 16) == 0) + flags |= SECTION_BSS; + + return flags; +} + /* Build up a unique section name, expressed as a STRING_CST node, and assign it to DECL_SECTION_NAME (decl). RELOC indicates whether the initial value of EXP requires diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h index c103c5865a3..66f96d98e2e 100644 --- a/gcc/config/i386/x86-64.h +++ b/gcc/config/i386/x86-64.h @@ -103,3 +103,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #undef TARGET_ASM_UNIQUE_SECTION #define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section + +#undef TARGET_SECTION_TYPE_FLAGS +#define TARGET_SECTION_TYPE_FLAGS x86_64_elf_section_type_flags diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e8d6aa1560f..6d8365e4ba0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2013-08-23 Jakub Jelinek + PR target/58218 + * gcc.target/i386/pr58218.c: New test. + PR tree-optimization/58209 * gcc.c-torture/execute/pr58209.c: New test. diff --git a/gcc/testsuite/gcc.target/i386/pr58218.c b/gcc/testsuite/gcc.target/i386/pr58218.c new file mode 100644 index 00000000000..4145242059f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr58218.c @@ -0,0 +1,5 @@ +/* PR target/58218 */ +/* { dg-do assemble { target lp64 } } */ +/* { dg-options "-mcmodel=medium" } */ + +struct { float x[16385]; } a = { { 0.f, } }; -- cgit v1.2.3 From 50b06ce7afe13b7994e427b44a46c1cd65396fb3 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 23 Aug 2013 21:04:55 +0000 Subject: compiler: don't export embedded builtins. The panic in test/fixedbugs/bug461.go was caused by the fact that reflect expects unexported fields in a struct to have a valid package path. If a struct field is an embedded built-in type, it is now given the package name of the currently compiling package, so it remains unexported for purposes of reflect. Fixed Issue 25. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201952 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/types.cc | 27 ++++++++++++++++++++++++--- gcc/go/gofrontend/types.h | 4 ++++ 2 files changed, 28 insertions(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index 0a86d472062..b32c0587e6c 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -4221,6 +4221,22 @@ Struct_field::is_field_name(const std::string& name) const } } +// Return whether this field is an embedded built-in type. + +bool +Struct_field::is_embedded_builtin(Gogo* gogo) const +{ + const std::string& name(this->field_name()); + // We know that a field is an embedded type if it is anonymous. + // We can decide if it is a built-in type by checking to see if it is + // registered globally under the field's name. + // This allows us to distinguish between embedded built-in types and + // embedded types that are aliases to built-in types. + return (this->is_anonymous() + && !Gogo::is_hidden_name(name) + && gogo->lookup_global(name.c_str()) != NULL); +} + // Class Struct_type. // A hash table used to find identical unnamed structs so that they @@ -4835,11 +4851,16 @@ Struct_type::do_type_descriptor(Gogo* gogo, Named_type* name) ++q; go_assert(q->is_field_name("pkgPath")); - if (!Gogo::is_hidden_name(pf->field_name())) - fvals->push_back(Expression::make_nil(bloc)); + bool is_embedded_builtin = pf->is_embedded_builtin(gogo); + if (!Gogo::is_hidden_name(pf->field_name()) && !is_embedded_builtin) + fvals->push_back(Expression::make_nil(bloc)); else { - std::string n = Gogo::hidden_name_pkgpath(pf->field_name()); + std::string n; + if (is_embedded_builtin) + n = gogo->package_name(); + else + n = Gogo::hidden_name_pkgpath(pf->field_name()); Expression* s = Expression::make_string(n, bloc); fvals->push_back(Expression::make_unary(OPERATOR_AND, s, bloc)); } diff --git a/gcc/go/gofrontend/types.h b/gcc/go/gofrontend/types.h index 56626f1960e..8bc022eb824 100644 --- a/gcc/go/gofrontend/types.h +++ b/gcc/go/gofrontend/types.h @@ -1926,6 +1926,10 @@ class Struct_field bool is_field_name(const std::string& name) const; + // Return whether this struct field is an embedded built-in type. + bool + is_embedded_builtin(Gogo*) const; + // The field type. Type* type() const -- cgit v1.2.3 From 153b535eb17b3980c60b0158829c99f08bbb8222 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sat, 24 Aug 2013 00:16:39 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201958 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index a370d32f95b..9b95a669606 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130823 +20130824 -- cgit v1.2.3 From 1bf5728889e90479a4c8e744535bbfb0dffcb38b Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Sat, 24 Aug 2013 09:12:21 +0000 Subject: 2013-08-24 Janus Weil Backport from trunk: 2013-08-22 Janus Weil PR fortran/58185 * match.c (copy_ts_from_selector_to_associate): Only build class container for polymorphic selector. Some cleanup. 2013-08-24 Janus Weil Backport from trunk: 2013-08-22 Janus Weil PR fortran/58185 * gfortran.dg/select_type_34.f90: New. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201964 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 9 ++++++ gcc/fortran/match.c | 42 ++++++++-------------------- gcc/testsuite/ChangeLog | 8 ++++++ gcc/testsuite/gfortran.dg/select_type_34.f90 | 10 +++++++ 4 files changed, 38 insertions(+), 31 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/select_type_34.f90 (limited to 'gcc') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index be2afaa869d..759cac57f6a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,12 @@ +2013-08-24 Janus Weil + + Backport from trunk: + 2013-08-22 Janus Weil + + PR fortran/58185 + * match.c (copy_ts_from_selector_to_associate): Only build class + container for polymorphic selector. Some cleanup. + 2013-08-11 Janus Weil Backport from trunk: diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index e9a701bb608..a320248fe3e 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -5142,7 +5142,6 @@ copy_ts_from_selector_to_associate (gfc_expr *associate, gfc_expr *selector) { gfc_ref *ref; gfc_symbol *assoc_sym; - int i; assoc_sym = associate->symtree->n.sym; @@ -5153,9 +5152,8 @@ copy_ts_from_selector_to_associate (gfc_expr *associate, gfc_expr *selector) while (ref && ref->next) ref = ref->next; - if (selector->ts.type == BT_CLASS - && CLASS_DATA (selector)->as - && ref && ref->type == REF_ARRAY) + if (selector->ts.type == BT_CLASS && CLASS_DATA (selector)->as + && ref && ref->type == REF_ARRAY) { /* Ensure that the array reference type is set. We cannot use gfc_resolve_expr at this point, so the usable parts of @@ -5163,7 +5161,7 @@ copy_ts_from_selector_to_associate (gfc_expr *associate, gfc_expr *selector) if (ref->u.ar.type == AR_UNKNOWN) { ref->u.ar.type = AR_ELEMENT; - for (i = 0; i < ref->u.ar.dimen + ref->u.ar.codimen; i++) + for (int i = 0; i < ref->u.ar.dimen + ref->u.ar.codimen; i++) if (ref->u.ar.dimen_type[i] == DIMEN_RANGE || ref->u.ar.dimen_type[i] == DIMEN_VECTOR || (ref->u.ar.dimen_type[i] == DIMEN_UNKNOWN @@ -5182,37 +5180,19 @@ copy_ts_from_selector_to_associate (gfc_expr *associate, gfc_expr *selector) selector->rank = 0; } - if (selector->ts.type != BT_CLASS) + if (selector->rank) { - /* The correct class container has to be available. */ - if (selector->rank) - { - assoc_sym->attr.dimension = 1; - assoc_sym->as = gfc_get_array_spec (); - assoc_sym->as->rank = selector->rank; - assoc_sym->as->type = AS_DEFERRED; - } - else - assoc_sym->as = NULL; - - assoc_sym->ts.type = BT_CLASS; - assoc_sym->ts.u.derived = selector->ts.u.derived; - assoc_sym->attr.pointer = 1; - gfc_build_class_symbol (&assoc_sym->ts, &assoc_sym->attr, - &assoc_sym->as, false); + assoc_sym->attr.dimension = 1; + assoc_sym->as = gfc_get_array_spec (); + assoc_sym->as->rank = selector->rank; + assoc_sym->as->type = AS_DEFERRED; } else + assoc_sym->as = NULL; + + if (selector->ts.type == BT_CLASS) { /* The correct class container has to be available. */ - if (selector->rank) - { - assoc_sym->attr.dimension = 1; - assoc_sym->as = gfc_get_array_spec (); - assoc_sym->as->rank = selector->rank; - assoc_sym->as->type = AS_DEFERRED; - } - else - assoc_sym->as = NULL; assoc_sym->ts.type = BT_CLASS; assoc_sym->ts.u.derived = CLASS_DATA (selector)->ts.u.derived; assoc_sym->attr.pointer = 1; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6d8365e4ba0..a195497b023 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2013-08-24 Janus Weil + + Backport from trunk: + 2013-08-22 Janus Weil + + PR fortran/58185 + * gfortran.dg/select_type_34.f90: New. + 2013-08-23 Jakub Jelinek PR target/58218 diff --git a/gcc/testsuite/gfortran.dg/select_type_34.f90 b/gcc/testsuite/gfortran.dg/select_type_34.f90 new file mode 100644 index 00000000000..e75a7abd56e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/select_type_34.f90 @@ -0,0 +1,10 @@ +! { dg-do compile } +! +! PR 58185: [4.8/4.9 Regression] [OOP] ICE when selector in SELECT TYPE is non-polymorphic +! +! Contributed by John + + integer :: array + select type (a => array) ! { dg-error "Selector shall be polymorphic" } + end select +end -- cgit v1.2.3 From 3a5d76675d5817c2da21d5bdecaf45f806a7b7ee Mon Sep 17 00:00:00 2001 From: Mikael Morin Date: Sat, 24 Aug 2013 09:54:59 +0000 Subject: fortran/ * trans-array.c (gfc_conv_section_startstride): Move &loop->pre access to the callers. (gfc_conv_ss_startstride, gfc_conv_expr_descriptor): Update callers. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201965 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/trans-array.c | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'gcc') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 759cac57f6a..f539bd70d34 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2013-08-24 Mikael Morin + + * trans-array.c (gfc_conv_section_startstride): Move &loop->pre access + to the callers. + (gfc_conv_ss_startstride, gfc_conv_expr_descriptor): Update callers. + 2013-08-24 Janus Weil Backport from trunk: diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 75fed2f651c..7cac2977b27 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -3674,7 +3674,7 @@ evaluate_bound (stmtblock_t *block, tree *bounds, gfc_expr ** values, /* Calculate the lower bound of an array section. */ static void -gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim) +gfc_conv_section_startstride (stmtblock_t * block, gfc_ss * ss, int dim) { gfc_expr *stride = NULL; tree desc; @@ -3703,12 +3703,12 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim) /* Calculate the start of the range. For vector subscripts this will be the range of the vector. */ - evaluate_bound (&loop->pre, info->start, ar->start, desc, dim, true); + evaluate_bound (block, info->start, ar->start, desc, dim, true); /* Similarly calculate the end. Although this is not used in the scalarizer, it is needed when checking bounds and where the end is an expression with side-effects. */ - evaluate_bound (&loop->pre, info->end, ar->end, desc, dim, false); + evaluate_bound (block, info->end, ar->end, desc, dim, false); /* Calculate the stride. */ if (stride == NULL) @@ -3717,8 +3717,8 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim) { gfc_init_se (&se, NULL); gfc_conv_expr_type (&se, stride, gfc_array_index_type); - gfc_add_block_to_block (&loop->pre, &se.pre); - info->stride[dim] = gfc_evaluate_now (se.expr, &loop->pre); + gfc_add_block_to_block (block, &se.pre); + info->stride[dim] = gfc_evaluate_now (se.expr, block); } } @@ -3797,7 +3797,7 @@ done: gfc_conv_ss_descriptor (&loop->pre, ss, !loop->array_parameter); for (n = 0; n < ss->dimen; n++) - gfc_conv_section_startstride (loop, ss, ss->dim[n]); + gfc_conv_section_startstride (&loop->pre, ss, ss->dim[n]); break; case GFC_SS_INTRINSIC: @@ -6690,10 +6690,10 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr) gcc_assert (ar->dimen_type[n + ndim] == DIMEN_THIS_IMAGE); /* Make sure the call to gfc_conv_section_startstride won't - generate unnecessary code to calculate stride. */ + generate unnecessary code to calculate stride. */ gcc_assert (ar->stride[n + ndim] == NULL); - gfc_conv_section_startstride (&loop, ss, n + ndim); + gfc_conv_section_startstride (&loop.pre, ss, n + ndim); loop.from[n + loop.dimen] = info->start[n + ndim]; loop.to[n + loop.dimen] = info->end[n + ndim]; } -- cgit v1.2.3 From f40e350560044269bdd4e94f330b237f4d652f0e Mon Sep 17 00:00:00 2001 From: Mikael Morin Date: Sat, 24 Aug 2013 12:46:17 +0000 Subject: fortran/ PR fortran/57798 * trans-array.c (gfc_conv_ss_startstride, set_loop_bounds, gfc_set_delta): Generate preliminary code before the outermost loop. testsuite/ PR fortran/57798 * gfortran.dg/inline_sum_5.f90: New. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201966 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/trans-array.c | 21 ++++++++++++------- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/inline_sum_5.f90 | 33 ++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/inline_sum_5.f90 (limited to 'gcc') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f539bd70d34..d3a136fe8b5 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2013-08-24 Mikael Morin + + PR fortran/57798 + * trans-array.c (gfc_conv_ss_startstride, set_loop_bounds, + gfc_set_delta): Generate preliminary code before the outermost loop. + 2013-08-24 Mikael Morin * trans-array.c (gfc_conv_section_startstride): Move &loop->pre access diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 7cac2977b27..b34f6fb19a6 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -3735,6 +3735,8 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop) gfc_ss *ss; tree desc; + gfc_loopinfo * const outer_loop = outermost_loop (loop); + loop->dimen = 0; /* Determine the rank of the loop. */ for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain) @@ -3794,10 +3796,11 @@ done: /* Get the descriptor for the array. If it is a cross loops array, we got the descriptor already in the outermost loop. */ if (ss->parent == NULL) - gfc_conv_ss_descriptor (&loop->pre, ss, !loop->array_parameter); + gfc_conv_ss_descriptor (&outer_loop->pre, ss, + !loop->array_parameter); for (n = 0; n < ss->dimen; n++) - gfc_conv_section_startstride (&loop->pre, ss, ss->dim[n]); + gfc_conv_section_startstride (&outer_loop->pre, ss, ss->dim[n]); break; case GFC_SS_INTRINSIC: @@ -3833,7 +3836,7 @@ done: fold_convert (gfc_array_index_type, rank), gfc_index_one_node); - info->end[0] = gfc_evaluate_now (tmp, &loop->pre); + info->end[0] = gfc_evaluate_now (tmp, &outer_loop->pre); info->start[0] = gfc_index_zero_node; info->stride[0] = gfc_index_one_node; continue; @@ -4115,7 +4118,7 @@ done: } tmp = gfc_finish_block (&block); - gfc_add_expr_to_block (&loop->pre, tmp); + gfc_add_expr_to_block (&outer_loop->pre, tmp); } for (loop = loop->nested; loop; loop = loop->next) @@ -4398,6 +4401,8 @@ set_loop_bounds (gfc_loopinfo *loop) mpz_t i; bool nonoptional_arr; + gfc_loopinfo * const outer_loop = outermost_loop (loop); + loopspec = loop->specloop; mpz_init (i); @@ -4583,7 +4588,7 @@ set_loop_bounds (gfc_loopinfo *loop) else { /* Set the delta for this section. */ - info->delta[dim] = gfc_evaluate_now (loop->from[n], &loop->pre); + info->delta[dim] = gfc_evaluate_now (loop->from[n], &outer_loop->pre); /* Number of iterations is (end - start + step) / step. with start = 0, this simplifies to last = end / step; @@ -4595,7 +4600,7 @@ set_loop_bounds (gfc_loopinfo *loop) gfc_array_index_type, tmp, info->stride[dim]); tmp = fold_build2_loc (input_location, MAX_EXPR, gfc_array_index_type, tmp, build_int_cst (gfc_array_index_type, -1)); - loop->to[n] = gfc_evaluate_now (tmp, &loop->pre); + loop->to[n] = gfc_evaluate_now (tmp, &outer_loop->pre); /* Make the loop variable start at 0. */ loop->from[n] = gfc_index_zero_node; } @@ -4671,6 +4676,8 @@ gfc_set_delta (gfc_loopinfo *loop) tree tmp; int n, dim; + gfc_loopinfo * const outer_loop = outermost_loop (loop); + loopspec = loop->specloop; /* Calculate the translation from loop variables to array indices. */ @@ -4706,7 +4713,7 @@ gfc_set_delta (gfc_loopinfo *loop) gfc_array_index_type, info->start[dim], tmp); - info->delta[dim] = gfc_evaluate_now (tmp, &loop->pre); + info->delta[dim] = gfc_evaluate_now (tmp, &outer_loop->pre); } } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a195497b023..332aa088e01 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-08-24 Mikael Morin + + PR fortran/57798 + * gfortran.dg/inline_sum_5.f90: New. + 2013-08-24 Janus Weil Backport from trunk: diff --git a/gcc/testsuite/gfortran.dg/inline_sum_5.f90 b/gcc/testsuite/gfortran.dg/inline_sum_5.f90 new file mode 100644 index 00000000000..bda73fd99a3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/inline_sum_5.f90 @@ -0,0 +1,33 @@ +! { dg-do run } +! +! PR fortran/57798 +! The call to sum used to be inlined into a loop with an uninitialized bound +! +! Original testcase by Stephan Kramer + +program test + implicit none + + call sub(2, 11) + + contains + + function func(m, n) + integer, intent(in):: m,n + real, dimension(m, n):: func + + func = 1.0 + + end function func + + subroutine sub(m, n) + integer, intent(in):: m, n + real, dimension(m,n):: y + + y = 1.0 + if (any(sum(y*func(m,n), dim=1) /= m)) call abort + + end subroutine sub + +end program test + -- cgit v1.2.3 From 6462dc5a2aab03e222f33a81addba8963d7b875e Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sun, 25 Aug 2013 00:16:37 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201971 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 9b95a669606..8c27bf72aba 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130824 +20130825 -- cgit v1.2.3 From 809ce4821011dae72089854dea5a8b56b39e0518 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Mon, 26 Aug 2013 00:16:44 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@201983 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 8c27bf72aba..5153c631103 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130825 +20130826 -- cgit v1.2.3 From 10967f1942de82f70c5dbf3c0338076a02b29c32 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Tue, 27 Aug 2013 00:16:51 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202012 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 5153c631103..6733c07f773 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130826 +20130827 -- cgit v1.2.3 From a265ebeb3d0582e8a63a1eb7e6979f2571e9f884 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Wed, 28 Aug 2013 00:16:35 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202038 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 6733c07f773..db30cf8670f 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130827 +20130828 -- cgit v1.2.3 From 89cddc4bccb6724b732029591f2b098d947965bf Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 28 Aug 2013 08:25:13 +0000 Subject: Backport from mainline 2013-08-27 H.J. Lu * config/i386/driver-i386.c (host_detect_local_cpu): Update Haswell processor detection. Backport from mainline 2013-08-27 Christian Widmer PR target/57927 * config/i386/driver-i386.c (host_detect_local_cpu): Add detection of Ivy Bridge and Haswell processors. Assume core-avx2 for unknown AVX2 capable processors. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202045 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 20 ++++++++++++++++++-- gcc/config/i386/driver-i386.c | 30 ++++++++++++++++++++---------- 2 files changed, 38 insertions(+), 12 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 52cd1e20a6b..c6429a9e918 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2013-08-28 Uros Bizjak + + Backport from mainline + 2013-08-27 H.J. Lu + + * config/i386/driver-i386.c (host_detect_local_cpu): Update + Haswell processor detection. + + Backport from mainline + 2013-08-27 Christian Widmer + + PR target/57927 + * config/i386/driver-i386.c (host_detect_local_cpu): Add detection + of Ivy Bridge and Haswell processors. Assume core-avx2 for unknown + AVX2 capable processors. + 2013-08-23 Jakub Jelinek PR target/58218 @@ -25,8 +41,8 @@ Jakub Jelinek Backport from mainline - * config/rs6000/dfp.md (*negtd2_fpr): Handle non-overlapping destination - and source operands. + * config/rs6000/dfp.md (*negtd2_fpr): Handle non-overlapping + destination and source operands. 2013-08-18 Jakub Jelinek diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c index 55c389a16ee..76375849556 100644 --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -638,13 +638,18 @@ const char *host_detect_local_cpu (int argc, const char **argv) /* Atom. */ cpu = "atom"; break; + case 0x0f: + /* Merom. */ + case 0x17: + case 0x1d: + /* Penryn. */ + cpu = "core2"; + break; case 0x1a: case 0x1e: case 0x1f: case 0x2e: /* Nehalem. */ - cpu = "corei7"; - break; case 0x25: case 0x2c: case 0x2f: @@ -656,20 +661,25 @@ const char *host_detect_local_cpu (int argc, const char **argv) /* Sandy Bridge. */ cpu = "corei7-avx"; break; - case 0x17: - case 0x1d: - /* Penryn. */ - cpu = "core2"; + case 0x3a: + case 0x3e: + /* Ivy Bridge. */ + cpu = "core-avx-i"; break; - case 0x0f: - /* Merom. */ - cpu = "core2"; + case 0x3c: + case 0x45: + case 0x46: + /* Haswell. */ + cpu = "core-avx2"; break; default: if (arch) { /* This is unknown family 0x6 CPU. */ - if (has_avx) + if (has_avx2) + /* Assume Haswell. */ + cpu = "core-avx2"; + else if (has_avx) /* Assume Sandy Bridge. */ cpu = "corei7-avx"; else if (has_sse4_2) -- cgit v1.2.3 From 7567a3c36ddc7d403f38385546634ab724a96c6d Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 28 Aug 2013 08:29:48 +0000 Subject: 2013-08-28 Richard Biener Backport from mainline 2013-06-24 Richard Biener PR middle-end/56977 * passes.c (init_optimization_passes): Move pass_fold_builtins and pass_dce earlier with -Og. * gcc.dg/pr56977.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202046 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 9 +++++++++ gcc/passes.c | 8 ++++---- gcc/testsuite/ChangeLog | 8 ++++++++ gcc/testsuite/gcc.dg/pr56977.c | 10 ++++++++++ 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr56977.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c6429a9e918..9beb893bb87 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2013-08-28 Richard Biener + + Backport from mainline + 2013-06-24 Richard Biener + + PR middle-end/56977 + * passes.c (init_optimization_passes): Move pass_fold_builtins + and pass_dce earlier with -Og. + 2013-08-28 Uros Bizjak Backport from mainline diff --git a/gcc/passes.c b/gcc/passes.c index 8390223e88e..7085f5d247f 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -1531,15 +1531,15 @@ init_optimization_passes (void) /* Perform simple scalar cleanup which is constant/copy propagation. */ NEXT_PASS (pass_ccp); NEXT_PASS (pass_object_sizes); + /* Fold remaining builtins. */ + NEXT_PASS (pass_fold_builtins); /* Copy propagation also copy-propagates constants, this is necessary - to forward object-size results properly. */ + to forward object-size and builtin folding results properly. */ NEXT_PASS (pass_copy_prop); + NEXT_PASS (pass_dce); NEXT_PASS (pass_asan); NEXT_PASS (pass_tsan); NEXT_PASS (pass_rename_ssa_copies); - NEXT_PASS (pass_dce); - /* Fold remaining builtins. */ - NEXT_PASS (pass_fold_builtins); /* ??? We do want some kind of loop invariant motion, but we possibly need to adjust LIM to be more friendly towards preserving accurate debug information here. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 332aa088e01..2c4b075ce27 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2013-08-28 Richard Biener + + Backport from mainline + 2013-06-24 Richard Biener + + PR middle-end/56977 + * gcc.dg/pr56977.c: New testcase. + 2013-08-24 Mikael Morin PR fortran/57798 diff --git a/gcc/testsuite/gcc.dg/pr56977.c b/gcc/testsuite/gcc.dg/pr56977.c new file mode 100644 index 00000000000..fde88afed1d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr56977.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-Og" } */ + +__attribute__((__error__("error"))) void error (); + +void f (int i) { + if (__builtin_constant_p (i)) { + error (); + } +} -- cgit v1.2.3 From 27ffe53bf2e798c0cd50771c0645bce65c7bd6cd Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 28 Aug 2013 10:10:43 +0000 Subject: PR middle-end/58257 * omp-low.c (copy_var_decl): Copy over TREE_NO_WARNING flag. * c-c++-common/gomp/pr58257.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202050 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/omp-low.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/c-c++-common/gomp/pr58257.c | 15 +++++++++++++++ 4 files changed, 26 insertions(+) create mode 100644 gcc/testsuite/c-c++-common/gomp/pr58257.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9beb893bb87..4c5ff4b267d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-08-28 Jakub Jelinek + + PR middle-end/58257 + * omp-low.c (copy_var_decl): Copy over TREE_NO_WARNING flag. + 2013-08-28 Richard Biener Backport from mainline diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 7440bef22b0..354d30ad0a2 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -836,6 +836,7 @@ copy_var_decl (tree var, tree name, tree type) DECL_ARTIFICIAL (copy) = DECL_ARTIFICIAL (var); DECL_IGNORED_P (copy) = DECL_IGNORED_P (var); DECL_CONTEXT (copy) = DECL_CONTEXT (var); + TREE_NO_WARNING (copy) = TREE_NO_WARNING (var); TREE_USED (copy) = 1; DECL_SEEN_IN_BIND_EXPR_P (copy) = 1; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2c4b075ce27..c319a5e1e9d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-08-28 Jakub Jelinek + + PR middle-end/58257 + * c-c++-common/gomp/pr58257.c: New test. + 2013-08-28 Richard Biener Backport from mainline diff --git a/gcc/testsuite/c-c++-common/gomp/pr58257.c b/gcc/testsuite/c-c++-common/gomp/pr58257.c new file mode 100644 index 00000000000..8f8d24a998a --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/pr58257.c @@ -0,0 +1,15 @@ +/* PR middle-end/58257 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp -Wall" } */ + +int +foo (int n) +{ + int a[10][10]; + int x, y; +#pragma omp parallel for collapse(2) /* { dg-bogus "may be used uninitialized in this function" } */ + for (x = 0; x < n; x++) /* { dg-bogus "may be used uninitialized in this function" } */ + for (y = 0; y < n; y++) + a[x][y] = x + y * y; + return a[0][0]; +} -- cgit v1.2.3 From 1d488c180bac92a9980510e24f04f93f046457fa Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Thu, 29 Aug 2013 00:16:34 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202063 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index db30cf8670f..c1110c20e13 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130828 +20130829 -- cgit v1.2.3 From 0bd2cdb466f4f61255c77561c48439f680a3ac67 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 29 Aug 2013 00:49:47 +0000 Subject: * go-gcc.cc (Gcc_backend::immutable_struct): Set TREE_PUBLIC if the struct is not hidden. (Gcc_backend::immutable_struct_set_init): Don't set TREE_PUBLIC. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202066 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/ChangeLog | 6 ++++++ gcc/go/go-gcc.cc | 16 ++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'gcc') diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index 3e77c2929b5..7edfb604686 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,9 @@ +2013-08-28 Ian Lance Taylor + + * go-gcc.cc (Gcc_backend::immutable_struct): Set TREE_PUBLIC if + the struct is not hidden. + (Gcc_backend::immutable_struct_set_init): Don't set TREE_PUBLIC. + 2013-08-06 Ian Lance Taylor * go-gcc.cc (Gcc_backend::immutable_struct_set_init): Use diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index 1ecfaffd73a..025bb2bdca0 100644 --- a/gcc/go/go-gcc.cc +++ b/gcc/go/go-gcc.cc @@ -1475,8 +1475,8 @@ Gcc_backend::temporary_variable(Bfunction* function, Bblock* bblock, // Create a named immutable initialized data structure. Bvariable* -Gcc_backend::immutable_struct(const std::string& name, bool, bool, - Btype* btype, Location location) +Gcc_backend::immutable_struct(const std::string& name, bool is_hidden, + bool, Btype* btype, Location location) { tree type_tree = btype->get_tree(); if (type_tree == error_mark_node) @@ -1490,6 +1490,8 @@ Gcc_backend::immutable_struct(const std::string& name, bool, bool, TREE_CONSTANT(decl) = 1; TREE_USED(decl) = 1; DECL_ARTIFICIAL(decl) = 1; + if (!is_hidden) + TREE_PUBLIC(decl) = 1; // We don't call rest_of_decl_compilation until we have the // initializer. @@ -1503,8 +1505,7 @@ Gcc_backend::immutable_struct(const std::string& name, bool, bool, void Gcc_backend::immutable_struct_set_init(Bvariable* var, const std::string&, - bool is_hidden, bool is_common, Btype*, - Location, + bool, bool is_common, Btype*, Location, Bexpression* initializer) { tree decl = var->get_tree(); @@ -1515,12 +1516,7 @@ Gcc_backend::immutable_struct_set_init(Bvariable* var, const std::string&, DECL_INITIAL(decl) = init_tree; // We can't call make_decl_one_only until we set DECL_INITIAL. - if (!is_common) - { - if (!is_hidden) - TREE_PUBLIC(decl) = 1; - } - else + if (is_common) make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl)); // These variables are often unneeded in the final program, so put -- cgit v1.2.3 From 9c0b580b05c94aa1a51928e6ae4806bc926de16d Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 29 Aug 2013 13:09:26 +0000 Subject: Backported from mainline 2013-05-27 Richard Biener PR tree-optimization/57343 * tree-ssa-loop-niter.c (number_of_iterations_ne_max): Do not use multiple_of_p if not TYPE_OVERFLOW_UNDEFINED. (number_of_iterations_cond): Do not build the folded tree. * gcc.dg/torture/pr57343.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202072 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 10 ++++++++++ gcc/testsuite/ChangeLog | 8 ++++++++ gcc/testsuite/gcc.dg/torture/pr57343.c | 22 ++++++++++++++++++++++ gcc/tree-ssa-loop-niter.c | 20 ++++++++++++++------ 4 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr57343.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4c5ff4b267d..65ed33a6227 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2013-08-29 Jakub Jelinek + + Backported from mainline + 2013-05-27 Richard Biener + + PR tree-optimization/57343 + * tree-ssa-loop-niter.c (number_of_iterations_ne_max): Do not + use multiple_of_p if not TYPE_OVERFLOW_UNDEFINED. + (number_of_iterations_cond): Do not build the folded tree. + 2013-08-28 Jakub Jelinek PR middle-end/58257 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c319a5e1e9d..2b3cca6592e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2013-08-29 Jakub Jelinek + + Backported from mainline + 2013-05-27 Richard Biener + + PR tree-optimization/57343 + * gcc.dg/torture/pr57343.c: New testcase. + 2013-08-28 Jakub Jelinek PR middle-end/58257 diff --git a/gcc/testsuite/gcc.dg/torture/pr57343.c b/gcc/testsuite/gcc.dg/torture/pr57343.c new file mode 100644 index 00000000000..b05bad5cb43 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr57343.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ + +int c = 0; + +int +main () +{ + int i, f = 1; + for (i = 0; i < 5; i++) + { + --c; + unsigned char h = c * 100; + if (h == 0) + { + f = 0; + break; + } + } + if (f != 1) + __builtin_abort (); + return 0; +} diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 090e114c36d..f5629306e4b 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -552,10 +552,18 @@ number_of_iterations_ne_max (mpz_t bnd, bool no_overflow, tree c, tree s, { double_int max; mpz_t d; + tree type = TREE_TYPE (c); bool bnds_u_valid = ((no_overflow && exit_must_be_taken) || mpz_sgn (bnds->below) >= 0); - if (multiple_of_p (TREE_TYPE (c), c, s)) + if (integer_onep (s) + || (TREE_CODE (c) == INTEGER_CST + && TREE_CODE (s) == INTEGER_CST + && tree_to_double_int (c).mod (tree_to_double_int (s), + TYPE_UNSIGNED (type), + EXACT_DIV_EXPR).is_zero ()) + || (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (c)) + && multiple_of_p (type, c, s))) { /* If C is an exact multiple of S, then its value will be reached before the induction variable overflows (unless the loop is exited in some @@ -572,16 +580,15 @@ number_of_iterations_ne_max (mpz_t bnd, bool no_overflow, tree c, tree s, the whole # of iterations analysis will fail). */ if (!no_overflow) { - max = double_int::mask (TYPE_PRECISION (TREE_TYPE (c)) - - tree_low_cst (num_ending_zeros (s), 1)); + max = double_int::mask (TYPE_PRECISION (type) + - tree_low_cst (num_ending_zeros (s), 1)); mpz_set_double_int (bnd, max, true); return; } /* Now we know that the induction variable does not overflow, so the loop iterates at most (range of type / S) times. */ - mpz_set_double_int (bnd, double_int::mask (TYPE_PRECISION (TREE_TYPE (c))), - true); + mpz_set_double_int (bnd, double_int::mask (TYPE_PRECISION (type)), true); /* If the induction variable is guaranteed to reach the value of C before overflow, ... */ @@ -1311,7 +1318,8 @@ number_of_iterations_cond (struct loop *loop, } /* If the loop exits immediately, there is nothing to do. */ - if (integer_zerop (fold_build2 (code, boolean_type_node, iv0->base, iv1->base))) + tree tem = fold_binary (code, boolean_type_node, iv0->base, iv1->base); + if (tem && integer_zerop (tem)) { niter->niter = build_int_cst (unsigned_type_for (type), 0); niter->max = double_int_zero; -- cgit v1.2.3 From fc06b39f6f857bc5517ee94f9a95a0ab73cd208b Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 29 Aug 2013 13:11:01 +0000 Subject: Backported from mainline 2013-05-27 Richard Biener PR tree-optimization/57396 * tree-affine.c (double_int_constant_multiple_p): Properly return false for val == 0 and div != 0. * gfortran.fortran-torture/execute/pr57396.f90: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202073 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 +++ gcc/testsuite/ChangeLog | 3 ++ .../gfortran.fortran-torture/execute/pr57396.f90 | 33 ++++++++++++++++++++++ gcc/tree-affine.c | 17 +++++++---- 4 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/pr57396.f90 (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 65ed33a6227..9645455a8a8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -3,6 +3,10 @@ Backported from mainline 2013-05-27 Richard Biener + PR tree-optimization/57396 + * tree-affine.c (double_int_constant_multiple_p): Properly + return false for val == 0 and div != 0. + PR tree-optimization/57343 * tree-ssa-loop-niter.c (number_of_iterations_ne_max): Do not use multiple_of_p if not TYPE_OVERFLOW_UNDEFINED. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2b3cca6592e..b013e4e9981 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -3,6 +3,9 @@ Backported from mainline 2013-05-27 Richard Biener + PR tree-optimization/57396 + * gfortran.fortran-torture/execute/pr57396.f90: New testcase. + PR tree-optimization/57343 * gcc.dg/torture/pr57343.c: New testcase. diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/pr57396.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/pr57396.f90 new file mode 100644 index 00000000000..8ea92924ad8 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/execute/pr57396.f90 @@ -0,0 +1,33 @@ +module testmod + implicit none + + contains + + subroutine foo(n) + integer, intent(in) :: n + real :: r(0:n,-n:n), a(0:n,-n:n), dj + integer :: k, j + + ! initialize with some dummy values + do j = -n, n + a(:, j) = j + r(:,j) = j + 1 + end do + + ! here be dragons + do k = 0, n + dj = r(k, k - 2) * a(k, k - 2) + r(k,k) = a(k, k - 1) * dj + enddo + + if (r(0,0) .ne. -2.) call abort + + end subroutine + +end module + +program test + use testmod + implicit none + call foo(5) +end program diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c index 0ee5eaa9db6..46a183a07b4 100644 --- a/gcc/tree-affine.c +++ b/gcc/tree-affine.c @@ -736,11 +736,10 @@ free_affine_expand_cache (struct pointer_map_t **cache) } /* If VAL != CST * DIV for any constant CST, returns false. - Otherwise, if VAL != 0 (and hence CST != 0), and *MULT_SET is true, - additionally compares CST and MULT, and if they are different, - returns false. Finally, if neither of these two cases occur, - true is returned, and if CST != 0, CST is stored to MULT and - MULT_SET is set to true. */ + Otherwise, if *MULT_SET is true, additionally compares CST and MULT, + and if they are different, returns false. Finally, if neither of these + two cases occur, true is returned, and CST is stored to MULT and MULT_SET + is set to true. */ static bool double_int_constant_multiple_p (double_int val, double_int div, @@ -749,7 +748,13 @@ double_int_constant_multiple_p (double_int val, double_int div, double_int rem, cst; if (val.is_zero ()) - return true; + { + if (*mult_set && !mult->is_zero ()) + return false; + *mult_set = true; + *mult = double_int_zero; + return true; + } if (div.is_zero ()) return false; -- cgit v1.2.3 From 1077d3cd77808cf7c4d4f3f42b514d10d5126dd7 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 29 Aug 2013 13:14:59 +0000 Subject: Backported from mainline 2013-07-22 Georg-Johann Lay PR testsuite/52641 * gcc.dg/torture/pr57381.c: Add dg-require-effective-target int32plus. 2013-05-27 Richard Biener PR middle-end/57381 PR tree-optimization/57417 * tree-ssa-sccvn.c (vn_reference_fold_indirect): Fix test for unchanged base. (set_ssa_val_to): Compare addresses using get_addr_base_and_unit_offset. PR tree-optimization/57417 * gcc.dg/torture/pr57417.c: New testcase. 2013-05-23 Richard Biener PR middle-end/57381 * gcc.dg/torture/pr57381.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202074 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 13 +++++++++++++ gcc/testsuite/gcc.dg/torture/pr57381.c | 25 +++++++++++++++++++++++++ gcc/testsuite/gcc.dg/torture/pr57417.c | 12 ++++++++++++ gcc/tree-ssa-sccvn.c | 15 +++++++++++++-- 5 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr57381.c create mode 100644 gcc/testsuite/gcc.dg/torture/pr57417.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9645455a8a8..44c9c9f6790 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -3,6 +3,13 @@ Backported from mainline 2013-05-27 Richard Biener + PR middle-end/57381 + PR tree-optimization/57417 + * tree-ssa-sccvn.c (vn_reference_fold_indirect): Fix test + for unchanged base. + (set_ssa_val_to): Compare addresses using + get_addr_base_and_unit_offset. + PR tree-optimization/57396 * tree-affine.c (double_int_constant_multiple_p): Properly return false for val == 0 and div != 0. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b013e4e9981..d4e9f2d7939 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,14 +1,27 @@ 2013-08-29 Jakub Jelinek Backported from mainline + 2013-07-22 Georg-Johann Lay + + PR testsuite/52641 + * gcc.dg/torture/pr57381.c: Add dg-require-effective-target int32plus. + 2013-05-27 Richard Biener + PR tree-optimization/57417 + * gcc.dg/torture/pr57417.c: New testcase. + PR tree-optimization/57396 * gfortran.fortran-torture/execute/pr57396.f90: New testcase. PR tree-optimization/57343 * gcc.dg/torture/pr57343.c: New testcase. + 2013-05-23 Richard Biener + + PR middle-end/57381 + * gcc.dg/torture/pr57381.c: New testcase. + 2013-08-28 Jakub Jelinek PR middle-end/58257 diff --git a/gcc/testsuite/gcc.dg/torture/pr57381.c b/gcc/testsuite/gcc.dg/torture/pr57381.c new file mode 100644 index 00000000000..ff6550a6d5f --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr57381.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target int32plus } */ + +struct S0 { int f0, f1, f2; }; + +struct S1 { + int f0; + volatile struct S0 f2; +}; + +static struct S1 s = {0x47BED265,{0x06D4EB3E,5,0U}}; + +int foo(struct S0 p) +{ + for (s.f2.f2 = 0; (s.f2.f2 <= 12); s.f2.f2++) + { + volatile int *l_61[5][2][2] = {{{&s.f2.f0,&s.f2.f0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,&s.f2.f0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,(void*)0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,&s.f2.f0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,&s.f2.f0},{(void*)0,&s.f2.f0}}}; + + volatile int **l_68 = &l_61[0][0][1]; + volatile int *l_76 = &s.f2.f0; + (*l_68) = l_61[0][0][0]; + if ((*l_76 = (p.f2 % 5))) ; + } + return p.f0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr57417.c b/gcc/testsuite/gcc.dg/torture/pr57417.c new file mode 100644 index 00000000000..6eac6f932b8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr57417.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ + +int a, b; +volatile int *c; + +void foo () +{ + volatile int d[1]; + b = 0; + for (;; a--) + c = &d[b]; +} diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 58fe903e74f..016a5d1bad3 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1062,7 +1062,7 @@ vn_reference_fold_indirect (vec *ops, addr_base = get_addr_base_and_unit_offset (TREE_OPERAND (op->op0, 0), &addr_offset); gcc_checking_assert (addr_base && TREE_CODE (addr_base) != MEM_REF); - if (addr_base != op->op0) + if (addr_base != TREE_OPERAND (op->op0, 0)) { double_int off = tree_to_double_int (mem_op->op0); off = off.sext (TYPE_PRECISION (TREE_TYPE (mem_op->op0))); @@ -2555,6 +2555,7 @@ static inline bool set_ssa_val_to (tree from, tree to) { tree currval = SSA_VAL (from); + HOST_WIDE_INT toff, coff; if (from != to) { @@ -2590,7 +2591,17 @@ set_ssa_val_to (tree from, tree to) print_generic_expr (dump_file, to, 0); } - if (currval != to && !operand_equal_p (currval, to, OEP_PURE_SAME)) + if (currval != to + && !operand_equal_p (currval, to, 0) + /* ??? For addresses involving volatile objects or types operand_equal_p + does not reliably detect ADDR_EXPRs as equal. We know we are only + getting invariant gimple addresses here, so can use + get_addr_base_and_unit_offset to do this comparison. */ + && !(TREE_CODE (currval) == ADDR_EXPR + && TREE_CODE (to) == ADDR_EXPR + && (get_addr_base_and_unit_offset (TREE_OPERAND (currval, 0), &coff) + == get_addr_base_and_unit_offset (TREE_OPERAND (to, 0), &toff)) + && coff == toff)) { VN_INFO (from)->valnum = to; if (dump_file && (dump_flags & TDF_DETAILS)) -- cgit v1.2.3 From 25629c8e0256a460f5eff6dbd7bc14d6c130f6aa Mon Sep 17 00:00:00 2001 From: Oleg Endo Date: Thu, 29 Aug 2013 18:37:46 +0000 Subject: Backport from mainline 2013-08-05 Oleg Endo PR other/12081 * recog.h (rtx (*insn_gen_fn) (rtx, ...)): Replace typedef with new class insn_gen_fn. * expr.c (move_by_pieces_1, store_by_pieces_2): Replace argument rtx (*) (rtx, ...) with insn_gen_fn. * genoutput.c (output_insn_data): Cast gen_? function pointers to insn_gen_fn::stored_funcptr. Add initializer braces. Backport from mainline 2013-08-07 Oleg Endo PR other/12081 * config/rs6000/rs6000.c (gen_2arg_fn_t): Remove typedef. (rs6000_emit_swdiv_high_precision, rs6000_emit_swdiv_low_precision, rs6000_emit_swrsqrt): Don't cast result of GEN_FCN to gen_2arg_fn_t. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202083 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 21 +++++++++++++++++++ gcc/config/rs6000/rs6000.c | 9 +++----- gcc/expr.c | 8 +++---- gcc/genoutput.c | 4 ++-- gcc/recog.h | 52 +++++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 81 insertions(+), 13 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 44c9c9f6790..f1895106a76 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,24 @@ +2013-08-29 Oleg Endo + + Backport from mainline + 2013-08-05 Oleg Endo + + PR other/12081 + * recog.h (rtx (*insn_gen_fn) (rtx, ...)): Replace typedef with new + class insn_gen_fn. + * expr.c (move_by_pieces_1, store_by_pieces_2): Replace argument + rtx (*) (rtx, ...) with insn_gen_fn. + * genoutput.c (output_insn_data): Cast gen_? function pointers to + insn_gen_fn::stored_funcptr. Add initializer braces. + + Backport from mainline + 2013-08-07 Oleg Endo + + PR other/12081 + * config/rs6000/rs6000.c (gen_2arg_fn_t): Remove typedef. + (rs6000_emit_swdiv_high_precision, rs6000_emit_swdiv_low_precision, + rs6000_emit_swrsqrt): Don't cast result of GEN_FCN to gen_2arg_fn_t. + 2013-08-29 Jakub Jelinek Backported from mainline diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index e8266decb90..e22c33dc37e 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -284,9 +284,6 @@ static struct { "rsqrtd", (RECIP_DF_RSQRT | RECIP_V2DF_RSQRT) }, }; -/* 2 argument gen function typedef. */ -typedef rtx (*gen_2arg_fn_t) (rtx, rtx, rtx); - /* Pointer to function (in rs6000-c.c) that can define or undefine target macros that have changed. Languages that don't support the preprocessor don't link in rs6000-c.c, so we can't call it directly. */ @@ -26657,7 +26654,7 @@ rs6000_emit_swdiv_high_precision (rtx dst, rtx n, rtx d) enum machine_mode mode = GET_MODE (dst); rtx x0, e0, e1, y1, u0, v0; enum insn_code code = optab_handler (smul_optab, mode); - gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code); + insn_gen_fn gen_mul = GEN_FCN (code); rtx one = rs6000_load_constant_and_splat (mode, dconst1); gcc_assert (code != CODE_FOR_nothing); @@ -26695,7 +26692,7 @@ rs6000_emit_swdiv_low_precision (rtx dst, rtx n, rtx d) enum machine_mode mode = GET_MODE (dst); rtx x0, e0, e1, e2, y1, y2, y3, u0, v0, one; enum insn_code code = optab_handler (smul_optab, mode); - gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code); + insn_gen_fn gen_mul = GEN_FCN (code); gcc_assert (code != CODE_FOR_nothing); @@ -26766,7 +26763,7 @@ rs6000_emit_swrsqrt (rtx dst, rtx src) int i; rtx halfthree; enum insn_code code = optab_handler (smul_optab, mode); - gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code); + insn_gen_fn gen_mul = GEN_FCN (code); gcc_assert (code != CODE_FOR_nothing); diff --git a/gcc/expr.c b/gcc/expr.c index 2c5f21aa9a7..7e909bc0f5c 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -119,7 +119,7 @@ struct store_by_pieces_d int reverse; }; -static void move_by_pieces_1 (rtx (*) (rtx, ...), enum machine_mode, +static void move_by_pieces_1 (insn_gen_fn, machine_mode, struct move_by_pieces_d *); static bool block_move_libcall_safe_for_call_parm (void); static bool emit_block_move_via_movmem (rtx, rtx, rtx, unsigned, unsigned, HOST_WIDE_INT); @@ -128,7 +128,7 @@ static void emit_block_move_via_loop (rtx, rtx, rtx, unsigned); static rtx clear_by_pieces_1 (void *, HOST_WIDE_INT, enum machine_mode); static void clear_by_pieces (rtx, unsigned HOST_WIDE_INT, unsigned int); static void store_by_pieces_1 (struct store_by_pieces_d *, unsigned int); -static void store_by_pieces_2 (rtx (*) (rtx, ...), enum machine_mode, +static void store_by_pieces_2 (insn_gen_fn, machine_mode, struct store_by_pieces_d *); static tree clear_storage_libcall_fn (int); static rtx compress_float_constant (rtx, rtx); @@ -1043,7 +1043,7 @@ move_by_pieces_ninsns (unsigned HOST_WIDE_INT l, unsigned int align, to make a move insn for that mode. DATA has all the other info. */ static void -move_by_pieces_1 (rtx (*genfun) (rtx, ...), enum machine_mode mode, +move_by_pieces_1 (insn_gen_fn genfun, machine_mode mode, struct move_by_pieces_d *data) { unsigned int size = GET_MODE_SIZE (mode); @@ -2657,7 +2657,7 @@ store_by_pieces_1 (struct store_by_pieces_d *data ATTRIBUTE_UNUSED, to make a move insn for that mode. DATA has all the other info. */ static void -store_by_pieces_2 (rtx (*genfun) (rtx, ...), enum machine_mode mode, +store_by_pieces_2 (insn_gen_fn genfun, machine_mode mode, struct store_by_pieces_d *data) { unsigned int size = GET_MODE_SIZE (mode); diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 995c5c55f11..59afaa452aa 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -404,9 +404,9 @@ output_insn_data (void) } if (d->name && d->name[0] != '*') - printf (" (insn_gen_fn) gen_%s,\n", d->name); + printf (" { (insn_gen_fn::stored_funcptr) gen_%s },\n", d->name); else - printf (" 0,\n"); + printf (" { 0 },\n"); printf (" &operand_data[%d],\n", d->operand_number); printf (" %d,\n", d->n_generator_args); diff --git a/gcc/recog.h b/gcc/recog.h index 67ad0f70d33..27e3b7c71db 100644 --- a/gcc/recog.h +++ b/gcc/recog.h @@ -256,7 +256,57 @@ extern struct operand_alternative recog_op_alt[MAX_RECOG_OPERANDS][MAX_RECOG_ALT typedef int (*insn_operand_predicate_fn) (rtx, enum machine_mode); typedef const char * (*insn_output_fn) (rtx *, rtx); -typedef rtx (*insn_gen_fn) (rtx, ...); + +struct insn_gen_fn +{ + typedef rtx (*f0) (void); + typedef rtx (*f1) (rtx); + typedef rtx (*f2) (rtx, rtx); + typedef rtx (*f3) (rtx, rtx, rtx); + typedef rtx (*f4) (rtx, rtx, rtx, rtx); + typedef rtx (*f5) (rtx, rtx, rtx, rtx, rtx); + typedef rtx (*f6) (rtx, rtx, rtx, rtx, rtx, rtx); + typedef rtx (*f7) (rtx, rtx, rtx, rtx, rtx, rtx, rtx); + typedef rtx (*f8) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); + typedef rtx (*f9) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); + typedef rtx (*f10) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); + typedef rtx (*f11) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); + typedef rtx (*f12) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); + typedef rtx (*f13) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); + typedef rtx (*f14) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); + typedef rtx (*f15) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); + typedef rtx (*f16) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); + + typedef f0 stored_funcptr; + + rtx operator () (void) const { return ((f0)func) (); } + rtx operator () (rtx a0) const { return ((f1)func) (a0); } + rtx operator () (rtx a0, rtx a1) const { return ((f2)func) (a0, a1); } + rtx operator () (rtx a0, rtx a1, rtx a2) const { return ((f3)func) (a0, a1, a2); } + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3) const { return ((f4)func) (a0, a1, a2, a3); } + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4) const { return ((f5)func) (a0, a1, a2, a3, a4); } + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5) const { return ((f6)func) (a0, a1, a2, a3, a4, a5); } + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6) const { return ((f7)func) (a0, a1, a2, a3, a4, a5, a6); } + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7) const { return ((f8)func) (a0, a1, a2, a3, a4, a5, a6, a7); } + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8) const { return ((f9)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8); } + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9) const { return ((f10)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10) const { return ((f11)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11) const { return ((f12)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11, rtx a12) const { return ((f13)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11, rtx a12, rtx a13) const { return ((f14)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11, rtx a12, rtx a13, rtx a14) const { return ((f15)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11, rtx a12, rtx a13, rtx a14, rtx a15) const { return ((f16)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + + // This is for compatibility of code that invokes functions like + // (*funcptr) (arg) + insn_gen_fn operator * (void) const { return *this; } + + // The wrapped function pointer must be public and there must not be any + // constructors. Otherwise the insn_data_d struct initializers generated + // by genoutput.c will result in static initializer functions, which defeats + // the purpose of the generated insn_data_d array. + stored_funcptr func; +}; struct insn_operand_data { -- cgit v1.2.3 From b94d9203a6431d7bb1c331872207c022270be036 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Fri, 30 Aug 2013 00:16:37 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202091 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index c1110c20e13..90c5253341a 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130829 +20130830 -- cgit v1.2.3 From c37dd37338fe536ba37b26ee6120f79519590be2 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 30 Aug 2013 12:53:47 +0000 Subject: PR tree-optimization/58277 * tree-ssa-strlen.c (strlen_enter_block): If do_invalidate gave up after seeing too many stmts with vdef in between dombb and current bb, invalidate everything. * gcc.c-torture/execute/pr58277-1.c: New test. * gcc.c-torture/execute/pr58277-2.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202105 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 ++ gcc/testsuite/ChangeLog | 6 ++ gcc/testsuite/gcc.c-torture/execute/pr58277-1.c | 102 ++++++++++++++++++++++++ gcc/testsuite/gcc.c-torture/execute/pr58277-2.c | 98 +++++++++++++++++++++++ gcc/tree-ssa-strlen.c | 22 +++++ 5 files changed, 235 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr58277-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr58277-2.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f1895106a76..6e0d8ce5f6d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-08-30 Jakub Jelinek + + PR tree-optimization/58277 + * tree-ssa-strlen.c (strlen_enter_block): If do_invalidate gave up + after seeing too many stmts with vdef in between dombb and current + bb, invalidate everything. + 2013-08-29 Oleg Endo Backport from mainline diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d4e9f2d7939..82f8ecdbc84 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-08-30 Jakub Jelinek + + PR tree-optimization/58277 + * gcc.c-torture/execute/pr58277-1.c: New test. + * gcc.c-torture/execute/pr58277-2.c: New test. + 2013-08-29 Jakub Jelinek Backported from mainline diff --git a/gcc/testsuite/gcc.c-torture/execute/pr58277-1.c b/gcc/testsuite/gcc.c-torture/execute/pr58277-1.c new file mode 100644 index 00000000000..811988f4371 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr58277-1.c @@ -0,0 +1,102 @@ +/* PR tree-optimization/58277 */ + +extern void abort (void); +static int a[2]; +int b, c, d, *e, f, g, h, **i = &e, k, l = 1, n, o, p; +static int **volatile j = &e; +const int m; +char u; + +int +bar () +{ + u = 0; + return m; +} + +__attribute__((noinline, noclone)) void +baz () +{ + asm (""); +} + +static int +foo () +{ + int t1; + g = bar (); + if (l) + ; + else + for (;; h++) + { + *i = 0; + o = *e = 0; + if (p) + { + f = 0; + return 0; + } + for (;; k++) + { + int *t2 = 0; + int *const *t3[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, &t2, &t2, &t2, + &t2, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, &t2, + &t2, &t2, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, + &t2, 0, 0, 0, &t2, 0, &t2, 0, 0, &t2, 0, 0, 0, 0, + 0, &t2, 0, 0, 0, 0, &t2, &t2, 0, 0, 0, 0, &t2, 0, + 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, &t2, 0, 0, 0, + &t2, &t2 + }; + int *const **t4[] = {&t3[0]}; + **i = 0; + if (**j) + break; + u = 0; + } + *i = *j; + t1 = 0; + for (; t1 < 5; t1++) + *i = *j; + } + *j = 0; + return 1; +} + +int +main () +{ + int t5; + a[0] = 1; + { + int *t6[6] = {&d, &d}; + for (n = 1; n; n--) + if (foo()) + { + int *t7[] = {0}; + d = 0; + for (; u < 1; u++) + *i = *j; + *i = 0; + *i = 0; + int t8[5] = {0}; + *i = &t8[0]; + int *const *t9 = &t6[0]; + int *const **t10 = &t9; + *t10 = &t7[0]; + } + } + u = 0; + for (; b; b++) + for (t5 = 0; t5 < 10; t5++) + c = a[a[a[a[a[a[a[a[c]]]]]]]]; + + baz (); + + if (!a[a[a[a[a[a[a[a[a[a[a[a[a[a[a[u]]]]]]]]]]]]]]]) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/execute/pr58277-2.c b/gcc/testsuite/gcc.c-torture/execute/pr58277-2.c new file mode 100644 index 00000000000..d919c2f3f80 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr58277-2.c @@ -0,0 +1,98 @@ +/* PR tree-optimization/58277 */ + +extern void abort (void); +static int a[1], b, c, e, i, j, k, m, q[] = { 1, 1 }, t; +int volatile d; +int **r; +static int ***volatile s = &r; +int f, g, o, x; +static int *volatile h = &f, *p; +char n; + +static void +fn1 () +{ + b = a[a[a[a[a[a[a[a[b]]]]]]]]; + b = a[a[a[a[a[a[a[a[b]]]]]]]]; + b = a[a[b]]; + b = a[a[a[a[a[a[a[a[b]]]]]]]]; + b = a[a[a[a[a[a[a[a[b]]]]]]]]; +} + +static int +fn2 () +{ + n = 0; + for (; g; t++) + { + for (;; m++) + { + d; + int *u; + int **v[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, &u, 0, 0, 0, 0, &u, &u, &u, &u, &u, &u, &u, 0, + &u, 0, &u, &u, &u, 0, &u, &u, 0, &u, &u, &u, &u, 0, &u, &u, &u, + &u, &u, 0, &u, &u, 0, &u, 0, &u, &u, 0, &u, &u, &u, &u, &u, 0, + &u, 0, 0, 0, &u, &u, &u, 0, 0, &u, &u, &u, 0, &u, 0, &u, &u + }; + int ***w[] = { &v[0] }; + if (*p) + break; + return 0; + } + *h = 0; + } + return 1; +} + +static void +fn3 () +{ + int *y[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + for (; i; i++) + x = 0; + if (fn2 ()) + { + int *z[6] = { }; + for (; n < 1; n++) + *h = 0; + int t1[7]; + for (; c; c++) + o = t1[0]; + for (; e; e--) + { + int **t2 = &y[0]; + int ***t3 = &t2; + *t3 = &z[0]; + } + } + *s = 0; + for (n = 0;; n = 0) + { + int t4 = 0; + if (q[n]) + break; + *r = &t4; + } +} + +int +main () +{ + for (; j; j--) + a[0] = 0; + fn3 (); + for (; k; k++) + fn1 (); + fn1 (); + + if (n) + abort (); + + return 0; +} diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c index fcb4ab890f6..dbad4a80d86 100644 --- a/gcc/tree-ssa-strlen.c +++ b/gcc/tree-ssa-strlen.c @@ -1890,6 +1890,28 @@ strlen_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED, int count_vdef = 100; do_invalidate (dombb, phi, visited, &count_vdef); BITMAP_FREE (visited); + if (count_vdef == 0) + { + /* If there were too many vdefs in between immediate + dominator and current bb, invalidate everything. + If stridx_to_strinfo has been unshared, we need + to free it, otherwise just set it to NULL. */ + if (!strinfo_shared ()) + { + unsigned int i; + strinfo si; + + for (i = 1; + vec_safe_iterate (stridx_to_strinfo, i, &si); + ++i) + { + free_strinfo (si); + (*stridx_to_strinfo)[i] = NULL; + } + } + else + stridx_to_strinfo = NULL; + } break; } } -- cgit v1.2.3 From 5f0d6bc08b1da7efb90192643b65c4ce06f14b33 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sat, 31 Aug 2013 00:16:24 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202123 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 90c5253341a..aa026ab4cc3 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130830 +20130831 -- cgit v1.2.3 From 5890dbddeac595da34db8faff39e4d05120511c0 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sun, 1 Sep 2013 00:16:28 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202138 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index aa026ab4cc3..4134370d972 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130831 +20130901 -- cgit v1.2.3 From 76c457d75a19479b3e241e53c535b761eead7bc7 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Sun, 1 Sep 2013 16:53:04 +0000 Subject: * config/pa/pa.md: Allow "const 0" operand 1 in "scc" insns. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202151 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/config/pa/pa.md | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6e0d8ce5f6d..ef0bbcd1c81 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2013-09-01 John David Anglin + + * config/pa/pa.md: Allow "const 0" operand 1 in "scc" insns. + 2013-08-30 Jakub Jelinek PR tree-optimization/58277 diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 5e6d5652e71..bcafc5c5329 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -833,7 +833,7 @@ (define_insn "scc" [(set (match_operand:SI 0 "register_operand" "=r") (match_operator:SI 3 "comparison_operator" - [(match_operand:SI 1 "register_operand" "r") + [(match_operand:SI 1 "reg_or_0_operand" "rM") (match_operand:SI 2 "arith11_operand" "rI")]))] "" "{com%I2clr|cmp%I2clr},%B3 %2,%1,%0\;ldi 1,%0" @@ -843,7 +843,7 @@ (define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (match_operator:DI 3 "comparison_operator" - [(match_operand:DI 1 "register_operand" "r") + [(match_operand:DI 1 "reg_or_0_operand" "rM") (match_operand:DI 2 "arith11_operand" "rI")]))] "TARGET_64BIT" "cmp%I2clr,*%B3 %2,%1,%0\;ldi 1,%0" @@ -853,10 +853,10 @@ (define_insn "iorscc" [(set (match_operand:SI 0 "register_operand" "=r") (ior:SI (match_operator:SI 3 "comparison_operator" - [(match_operand:SI 1 "register_operand" "r") + [(match_operand:SI 1 "reg_or_0_operand" "rM") (match_operand:SI 2 "arith11_operand" "rI")]) (match_operator:SI 6 "comparison_operator" - [(match_operand:SI 4 "register_operand" "r") + [(match_operand:SI 4 "reg_or_0_operand" "rM") (match_operand:SI 5 "arith11_operand" "rI")])))] "" "{com%I2clr|cmp%I2clr},%S3 %2,%1,%%r0\;{com%I5clr|cmp%I5clr},%B6 %5,%4,%0\;ldi 1,%0" @@ -866,10 +866,10 @@ (define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (ior:DI (match_operator:DI 3 "comparison_operator" - [(match_operand:DI 1 "register_operand" "r") + [(match_operand:DI 1 "reg_or_0_operand" "rM") (match_operand:DI 2 "arith11_operand" "rI")]) (match_operator:DI 6 "comparison_operator" - [(match_operand:DI 4 "register_operand" "r") + [(match_operand:DI 4 "reg_or_0_operand" "rM") (match_operand:DI 5 "arith11_operand" "rI")])))] "TARGET_64BIT" "cmp%I2clr,*%S3 %2,%1,%%r0\;cmp%I5clr,*%B6 %5,%4,%0\;ldi 1,%0" @@ -881,7 +881,7 @@ (define_insn "negscc" [(set (match_operand:SI 0 "register_operand" "=r") (neg:SI (match_operator:SI 3 "comparison_operator" - [(match_operand:SI 1 "register_operand" "r") + [(match_operand:SI 1 "reg_or_0_operand" "rM") (match_operand:SI 2 "arith11_operand" "rI")])))] "" "{com%I2clr|cmp%I2clr},%B3 %2,%1,%0\;ldi -1,%0" @@ -891,7 +891,7 @@ (define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (neg:DI (match_operator:DI 3 "comparison_operator" - [(match_operand:DI 1 "register_operand" "r") + [(match_operand:DI 1 "reg_or_0_operand" "rM") (match_operand:DI 2 "arith11_operand" "rI")])))] "TARGET_64BIT" "cmp%I2clr,*%B3 %2,%1,%0\;ldi -1,%0" -- cgit v1.2.3 From 45993f2d0a21c49556fab1b2b720d6468f189c4f Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Mon, 2 Sep 2013 00:16:38 +0000 Subject: Daily bump. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202157 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 4134370d972..15420bcb17c 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20130901 +20130902 -- cgit v1.2.3