This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Backport to GCC5
- From: Martin Liška <mliska at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 22 Mar 2017 13:22:11 +0100
- Subject: Backport to GCC5
- Authentication-results: sourceware.org; auth=none
- References: <f9ba1364-c118-5090-0eb1-e1582576377f@suse.cz>
Hello.
This is very same series as the one for GCC6. Only exception is toplev.c, which is
squashed just to a single patch. And a multi-versioning patch is omitted.
Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
I'm going to install the series.
Martin
>From 62b6cbefcf9eba678d77aa6e979b3f0c6a3f6b79 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 17 Feb 2017 14:47:08 +0000
Subject: [PATCH 01/15] Backport r245532
gcc/ChangeLog:
2017-02-17 Martin Liska <mliska@suse.cz>
PR rtl-optimization/79577
* params.def (selsched-max-sched-times): Increase minimum to 1.
---
gcc/params.def | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/params.def b/gcc/params.def
index 48b39a25041..33d637675ab 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -656,7 +656,7 @@ DEFPARAM(PARAM_SELSCHED_MAX_LOOKAHEAD,
DEFPARAM(PARAM_SELSCHED_MAX_SCHED_TIMES,
"selsched-max-sched-times",
"Maximum number of times that an insn could be scheduled",
- 2, 0, 0)
+ 2, 1, 0)
DEFPARAM(PARAM_SELSCHED_INSNS_TO_RENAME,
"selsched-insns-to-rename",
--
2.12.0
>From 3005209ed0529e7cefed1fdb27c76e9c6c001a9d Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 17 Feb 2017 14:46:14 +0000
Subject: [PATCH 02/15] Backport r245531
gcc/ChangeLog:
2017-02-17 Martin Liska <mliska@suse.cz>
PR rtl-optimization/79574
* gcse.c (want_to_gcse_p): Prevent integer overflow.
gcc/testsuite/ChangeLog:
2017-02-17 Martin Liska <mliska@suse.cz>
PR rtl-optimization/79574
* gcc.dg/pr79574.c: New test.
---
gcc/gcse.c | 5 +++--
gcc/testsuite/gcc.dg/pr79574.c | 10 ++++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/pr79574.c
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 0f6d456ab39..c6bea33c6d2 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -824,7 +824,7 @@ want_to_gcse_p (rtx x, int *max_distance_ptr)
/* PRE doesn't implement max_distance restriction. */
{
int cost;
- int max_distance;
+ HOST_WIDE_INT max_distance;
gcc_assert (!optimize_function_for_speed_p (cfun)
&& optimize_function_for_size_p (cfun));
@@ -832,7 +832,8 @@ want_to_gcse_p (rtx x, int *max_distance_ptr)
if (cost < COSTS_N_INSNS (GCSE_UNRESTRICTED_COST))
{
- max_distance = (GCSE_COST_DISTANCE_RATIO * cost) / 10;
+ max_distance
+ = ((HOST_WIDE_INT)GCSE_COST_DISTANCE_RATIO * cost) / 10;
if (max_distance == 0)
return 0;
diff --git a/gcc/testsuite/gcc.dg/pr79574.c b/gcc/testsuite/gcc.dg/pr79574.c
new file mode 100644
index 00000000000..1b666e20d21
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr79574.c
@@ -0,0 +1,10 @@
+/* PR rtl-optimization/79574 */
+/* { dg-do compile } */
+/* { dg-options "-Os --param gcse-cost-distance-ratio=2147483647" } */
+
+void a (void)
+{
+ volatile int b;
+ for (;; b)
+ ;
+}
--
2.12.0
>From 895302c15bcfefca67a3c9f6a9802112ca1b2b12 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 3 Mar 2017 11:53:14 +0000
Subject: [PATCH 03/15] Backport r245868
gcc/ChangeLog:
2017-03-03 Martin Liska <mliska@suse.cz>
PR rtl-optimization/79574
* gcse.c (struct gcse_expr): Use HOST_WIDE_INT instead of int.
(hash_scan_set): Likewise.
(dump_hash_table): Likewise.
(hoist_code): Likewise.
gcc/testsuite/ChangeLog:
2017-03-03 Martin Liska <mliska@suse.cz>
PR rtl-optimization/79574
* gcc.dg/pr79574-2.c: New test.
---
gcc/gcse.c | 29 +++++++++++++++++------------
gcc/testsuite/gcc.dg/pr79574-2.c | 33 +++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+), 12 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/pr79574-2.c
diff --git a/gcc/gcse.c b/gcc/gcse.c
index c6bea33c6d2..394620d64f6 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -311,7 +311,7 @@ struct gcse_expr
to keep register pressure under control.
A value of "0" removes restrictions on how far the expression can
travel. */
- int max_distance;
+ HOST_WIDE_INT max_distance;
};
/* Occurrence of an expression.
@@ -486,12 +486,12 @@ static void hash_scan_insn (rtx_insn *, struct gcse_hash_table_d *);
static void hash_scan_set (rtx, rtx_insn *, struct gcse_hash_table_d *);
static void hash_scan_clobber (rtx, rtx_insn *, struct gcse_hash_table_d *);
static void hash_scan_call (rtx, rtx_insn *, struct gcse_hash_table_d *);
-static int want_to_gcse_p (rtx, int *);
+static int want_to_gcse_p (rtx, HOST_WIDE_INT *);
static int oprs_unchanged_p (const_rtx, const rtx_insn *, int);
static int oprs_anticipatable_p (const_rtx, const rtx_insn *);
static int oprs_available_p (const_rtx, const rtx_insn *);
static void insert_expr_in_table (rtx, machine_mode, rtx_insn *, int, int,
- int, struct gcse_hash_table_d *);
+ HOST_WIDE_INT, struct gcse_hash_table_d *);
static unsigned int hash_expr (const_rtx, machine_mode, int *, int);
static void record_last_reg_set_info (rtx, int);
static void record_last_mem_set_info (rtx_insn *);
@@ -521,8 +521,10 @@ static void alloc_code_hoist_mem (int, int);
static void free_code_hoist_mem (void);
static void compute_code_hoist_vbeinout (void);
static void compute_code_hoist_data (void);
-static int should_hoist_expr_to_dom (basic_block, struct gcse_expr *, basic_block,
- sbitmap, int, int *, enum reg_class,
+static int should_hoist_expr_to_dom (basic_block, struct gcse_expr *,
+ basic_block,
+ sbitmap, HOST_WIDE_INT, int *,
+ enum reg_class,
int *, bitmap, rtx_insn *);
static int hoist_code (void);
static enum reg_class get_regno_pressure_class (int regno, int *nregs);
@@ -777,7 +779,7 @@ static basic_block current_bb;
GCSE. */
static int
-want_to_gcse_p (rtx x, int *max_distance_ptr)
+want_to_gcse_p (rtx x, HOST_WIDE_INT *max_distance_ptr)
{
#ifdef STACK_REGS
/* On register stack architectures, don't GCSE constants from the
@@ -1150,7 +1152,8 @@ expr_equiv_p (const_rtx x, const_rtx y)
static void
insert_expr_in_table (rtx x, machine_mode mode, rtx_insn *insn,
int antic_p,
- int avail_p, int max_distance, struct gcse_hash_table_d *table)
+ int avail_p, HOST_WIDE_INT max_distance,
+ struct gcse_hash_table_d *table)
{
int found, do_not_record_p;
unsigned int hash;
@@ -1266,7 +1269,7 @@ hash_scan_set (rtx set, rtx_insn *insn, struct gcse_hash_table_d *table)
else if (REG_P (dest))
{
unsigned int regno = REGNO (dest);
- int max_distance = 0;
+ HOST_WIDE_INT max_distance = 0;
/* See if a REG_EQUAL note shows this equivalent to a simpler expression.
@@ -1335,7 +1338,7 @@ hash_scan_set (rtx set, rtx_insn *insn, struct gcse_hash_table_d *table)
else if (flag_gcse_las && REG_P (src) && MEM_P (dest))
{
unsigned int regno = REGNO (src);
- int max_distance = 0;
+ HOST_WIDE_INT max_distance = 0;
/* Only record sets of pseudo-regs in the hash table. */
if (regno >= FIRST_PSEUDO_REGISTER
@@ -1448,7 +1451,8 @@ dump_hash_table (FILE *file, const char *name, struct gcse_hash_table_d *table)
if (flat_table[i] != 0)
{
expr = flat_table[i];
- fprintf (file, "Index %d (hash value %d; max distance %d)\n ",
+ fprintf (file, "Index %d (hash value %d; max distance "
+ HOST_WIDE_INT_PRINT_DEC ")\n ",
expr->bitmap_index, hash_val[i], expr->max_distance);
print_rtl (file, expr->expr);
fprintf (file, "\n");
@@ -2909,7 +2913,8 @@ update_bb_reg_pressure (basic_block bb, rtx_insn *from)
static int
should_hoist_expr_to_dom (basic_block expr_bb, struct gcse_expr *expr,
- basic_block bb, sbitmap visited, int distance,
+ basic_block bb, sbitmap visited,
+ HOST_WIDE_INT distance,
int *bb_size, enum reg_class pressure_class,
int *nregs, bitmap hoisted_bbs, rtx_insn *from)
{
@@ -3186,7 +3191,7 @@ hoist_code (void)
computes the expression. */
FOR_EACH_VEC_ELT (domby, j, dominated)
{
- int max_distance;
+ HOST_WIDE_INT max_distance;
/* Ignore self dominance. */
if (bb == dominated)
diff --git a/gcc/testsuite/gcc.dg/pr79574-2.c b/gcc/testsuite/gcc.dg/pr79574-2.c
new file mode 100644
index 00000000000..995dff40174
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr79574-2.c
@@ -0,0 +1,33 @@
+/* PR rtl-optimization/79574 */
+/* { dg-do compile } */
+/* { dg-options "-Os --param gcse-cost-distance-ratio=2147483647" } */
+
+#include "stdarg.h"
+
+int buf[100];
+int buf1[10];
+
+int rd (int *pppp, int n, ...)
+{
+ va_list argp;
+ int *p;
+ int i;
+ int res;
+
+ va_start (argp, n);
+ for (; n > 0; n--)
+ va_arg (argp, double);
+ p = va_arg (argp, int *);
+ i = va_arg (argp, int);
+
+ res = p[i];
+ __builtin_printf ("%d\n", res);
+
+ return res;
+}
+
+int mpx_test (int argc, const char **argv)
+{
+ rd (buf1, 2, 10.0d, 10.0d, buf, 100, buf1);
+ return 0;
+}
--
2.12.0
>From be291d46722aab9978ad041c1868521c5ddf5d8a Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 3 Mar 2017 11:53:56 +0000
Subject: [PATCH 04/15] Backport r245869
gcc/ChangeLog:
2017-03-03 Martin Liska <mliska@suse.cz>
PR tree-optimization/79803
* tree-ssa-loop-prefetch.c (tree_ssa_prefetch_arrays): Remove
assert.
(pass_loop_prefetch::execute): Disabled optimization if an
assumption about L1 cache size is not met.
gcc/testsuite/ChangeLog:
2017-03-03 Martin Liska <mliska@suse.cz>
PR tree-optimization/79803
* gcc.dg/tree-ssa/pr79803.c: New test.
---
gcc/testsuite/gcc.dg/tree-ssa/pr79803.c | 60 +++++++++++++++++++++++++++++++++
gcc/tree-ssa-loop-prefetch.c | 19 ++++++++---
2 files changed, 75 insertions(+), 4 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr79803.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr79803.c b/gcc/testsuite/gcc.dg/tree-ssa/pr79803.c
new file mode 100644
index 00000000000..51b245d4d5b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr79803.c
@@ -0,0 +1,60 @@
+/* { dg-do compile { target { x86_64-*-* } } } */
+/* { dg-options "-march=opteron-sse3 -Ofast --param l1-cache-line-size=3 -Wdisabled-optimization" } */
+/* { dg-require-effective-target indirect_jumps } */
+
+#include <setjmp.h>
+
+extern void abort (void);
+
+jmp_buf buf;
+
+void raise0(void)
+{
+ __builtin_longjmp (buf, 1);
+}
+
+int execute(int cmd) /* { dg-warning "'l1-cache-size' parameter is not a power of two 3" } */
+{
+ int last = 0;
+
+ if (__builtin_setjmp (buf) == 0)
+ while (1)
+ {
+ last = 1;
+ raise0 ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+int execute2(int cmd, int cmd2)
+{
+ int last = 0;
+
+ if (__builtin_setjmp (buf) == 0)
+ while (1)
+ {
+ last = 1;
+ raise0 ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+
+int main(void)
+{
+ if (execute (1) == 0)
+ abort ();
+
+ if (execute2 (1, 2) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index 10e156e997f..a007f726cbc 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -65,6 +65,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "tree-inline.h"
#include "tree-data-ref.h"
+#include "diagnostic-core.h"
/* FIXME: Needed for optabs, but this should all be moved to a TBD interface
@@ -2005,10 +2006,6 @@ tree_ssa_prefetch_arrays (void)
set_builtin_decl (BUILT_IN_PREFETCH, decl, false);
}
- /* We assume that size of cache line is a power of two, so verify this
- here. */
- gcc_assert ((PREFETCH_BLOCK & (PREFETCH_BLOCK - 1)) == 0);
-
FOR_EACH_LOOP (loop, LI_FROM_INNERMOST)
{
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -2066,6 +2063,20 @@ pass_loop_prefetch::execute (function *fun)
if (number_of_loops (fun) <= 1)
return 0;
+ if ((PREFETCH_BLOCK & (PREFETCH_BLOCK - 1)) != 0)
+ {
+ static bool warned = false;
+
+ if (!warned)
+ {
+ warning (OPT_Wdisabled_optimization,
+ "%<l1-cache-size%> parameter is not a power of two %d",
+ PREFETCH_BLOCK);
+ warned = true;
+ }
+ return 0;
+ }
+
return tree_ssa_prefetch_arrays ();
}
--
2.12.0
>From 7a120621efda943b27748276f1f01d81057692a6 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 9 Mar 2017 09:20:59 +0000
Subject: [PATCH 05/15] Backport r245992
gcc/c-family/ChangeLog:
2017-03-09 Martin Liska <mliska@suse.cz>
* c-ada-spec.c (macro_length): Increment value instead of a pointer.
---
gcc/c-family/c-ada-spec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index 8d6e01421cd..2814be426db 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -85,7 +85,7 @@ macro_length (const cpp_macro *macro, int *supported, int *buffer_len,
if (macro->fun_like)
{
- param_len++;
+ (*param_len)++;
for (i = 0; i < macro->paramc; i++)
{
cpp_hashnode *param = macro->params[i];
--
2.12.0
>From 37ea6d19212a188080081d0e087882693bdc75c1 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 9 Mar 2017 09:22:29 +0000
Subject: [PATCH 06/15] Backport r245993
gcc/ChangeLog:
2017-03-09 Martin Liska <mliska@suse.cz>
PR ipa/79761
* tree-chkp.c (chkp_get_bound_for_parm): Get bounds for a param.
(chkp_find_bounds_1): Remove gcc_unreachable.
gcc/testsuite/ChangeLog:
2017-03-09 Martin Liska <mliska@suse.cz>
PR ipa/79761
* g++.dg/pr79761.C: New test.
---
gcc/testsuite/g++.dg/pr79761.C | 34 ++++++++++++++++++++++++++++++++++
gcc/tree-chkp.c | 4 ++--
2 files changed, 36 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/g++.dg/pr79761.C
diff --git a/gcc/testsuite/g++.dg/pr79761.C b/gcc/testsuite/g++.dg/pr79761.C
new file mode 100644
index 00000000000..a97325a1fc4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr79761.C
@@ -0,0 +1,34 @@
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms" } */
+
+struct Foo
+{
+ Foo() : a(1), b(1), c('a') {}
+ int a;
+ int b;
+ char c;
+};
+
+static Foo copy_foo(Foo) __attribute__((noinline, noclone));
+
+static Foo copy_foo(Foo A)
+{
+ return A;
+}
+
+struct Bar : Foo
+{
+ Bar(Foo t) : Foo(copy_foo(t)) {}
+};
+
+Foo F;
+
+int main (void)
+{
+ Bar B (F);
+
+ if (B.a != 1 || B.b != 1 || B.c != 'a')
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c
index 218c7eb40ab..237399ecc96 100644
--- a/gcc/tree-chkp.c
+++ b/gcc/tree-chkp.c
@@ -3556,8 +3556,8 @@ chkp_find_bounds_1 (tree ptr, tree ptr_src, gimple_stmt_iterator *iter)
break;
case PARM_DECL:
- gcc_unreachable ();
- bounds = chkp_get_bound_for_parm (ptr_src);
+ /* Handled above but failed. */
+ bounds = chkp_get_invalid_op_bounds ();
break;
case TARGET_MEM_REF:
--
2.12.0
>From e268aa788c0c69f2015d124b8e2270e478a31d30 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 9 Mar 2017 10:10:02 +0000
Subject: [PATCH 07/15] Backport r245998
gcc/ChangeLog:
2017-03-09 Martin Liska <mliska@suse.cz>
PR tree-optimization/79631
* tree-chkp-opt.c (chkp_is_constant_addr): Call
tree_int_cst_sign_bit just for INTEGER constants.
gcc/testsuite/ChangeLog:
2017-03-09 Martin Liska <mliska@suse.cz>
PR tree-optimization/79631
* gcc.target/i386/mpx/pr79631.c: New test.
---
gcc/testsuite/gcc.target/i386/mpx/pr79631.c | 15 +++++++++++++++
gcc/tree-chkp-opt.c | 4 +++-
2 files changed, 18 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/gcc.target/i386/mpx/pr79631.c
diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr79631.c b/gcc/testsuite/gcc.target/i386/mpx/pr79631.c
new file mode 100644
index 00000000000..075d46b835f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/pr79631.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { ! x32 } } } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -O2" } */
+
+typedef struct { int _mp_size; } mpz_t[1];
+int a, b;
+void fn1()
+{
+ mpz_t c[1][b];
+ for (;;) {
+ int d = 0 >= 0 ? 0 == 0 ? c[0][0]->_mp_size ? -1 : 0 : 0 : 0,
+ e = 0 >= 0 ? 0 == 0 ? c[1][1]->_mp_size ? -1 : 0 : 0 : 0;
+ if (d != e)
+ a++;
+ }
+}
diff --git a/gcc/tree-chkp-opt.c b/gcc/tree-chkp-opt.c
index 3fa2380d4bf..e594b332d76 100644
--- a/gcc/tree-chkp-opt.c
+++ b/gcc/tree-chkp-opt.c
@@ -282,9 +282,11 @@ chkp_is_constant_addr (const address_t &addr, int *sign)
return false;
else if (addr.pol[0].var)
return false;
+ else if (TREE_CODE (addr.pol[0].cst) != INTEGER_CST)
+ return false;
else if (integer_zerop (addr.pol[0].cst))
*sign = 0;
- else if (tree_int_cst_sign_bit (addr.pol[0].cst))
+ else if (tree_int_cst_sign_bit (addr.pol[0].cst))
*sign = -1;
else
*sign = 1;
--
2.12.0
>From cd55c88655fcaeb6729614745aaf0e8b68278410 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 13 Jun 2016 07:17:16 +0000
Subject: [PATCH 08/15] Backport r237353,r245997,r246027
gcc/ChangeLog:
2016-06-13 Martin Liska <mliska@suse.cz>
PR target/65705
PR target/69804
PR sanitizer/71458
* toplev.c (process_options): Enable MPX with LSAN and UBSAN.
* tree-chkp.c (chkp_walk_pointer_assignments): Verify that
FIELD != NULL.
gcc/testsuite/ChangeLog:
2016-06-13 Martin Liska <mliska@suse.cz>
PR sanitizer/71458
* gcc.target/i386/pr71458.c: New test.
---
gcc/testsuite/gcc.target/i386/pr71458.c | 7 +++++++
gcc/toplev.c | 21 +++++++++++++++++++--
gcc/tree-chkp.c | 2 +-
3 files changed, 27 insertions(+), 3 deletions(-)
create mode 100644 gcc/testsuite/gcc.target/i386/pr71458.c
diff --git a/gcc/testsuite/gcc.target/i386/pr71458.c b/gcc/testsuite/gcc.target/i386/pr71458.c
new file mode 100644
index 00000000000..d36b61cbe02
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr71458.c
@@ -0,0 +1,7 @@
+/* { dg-do compile { target { ! x32 } } } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -fsanitize=bounds" } */
+/* { dg-error "'-fcheck-pointer-bounds' is not supported with '-fsanitize=bounds'" "" { target *-*-* } 0 } */
+
+enum {} a[0];
+void fn1(int);
+void fn2() { fn1(a[-1]); }
diff --git a/gcc/toplev.c b/gcc/toplev.c
index cb6c51739ff..c565ea4797e 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1367,16 +1367,33 @@ process_options (void)
{
if (targetm.chkp_bound_mode () == VOIDmode)
{
- error ("-fcheck-pointer-bounds is not supported for this target");
+ error ("%<-fcheck-pointer-bounds%> is not supported for this "
+ "target");
flag_check_pointer_bounds = 0;
}
+ if (flag_sanitize & SANITIZE_BOUNDS)
+ {
+ error ("%<-fcheck-pointer-bounds%> is not supported with "
+ "%<-fsanitize=bounds%>");
+ flag_check_pointer_bounds = 0;
+ }
+
if (flag_sanitize & SANITIZE_ADDRESS)
{
- error ("-fcheck-pointer-bounds is not supported with "
+ error ("%<-fcheck-pointer-bounds%> is not supported with "
"Address Sanitizer");
flag_check_pointer_bounds = 0;
}
+
+ if (flag_sanitize & SANITIZE_THREAD)
+ {
+ error (UNKNOWN_LOCATION,
+ "%<-fcheck-pointer-bounds%> is not supported with "
+ "Thread Sanitizer");
+
+ flag_check_pointer_bounds = 0;
+ }
}
/* One region RA really helps to decrease the code size. */
diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c
index 237399ecc96..049bafae4e2 100644
--- a/gcc/tree-chkp.c
+++ b/gcc/tree-chkp.c
@@ -3690,7 +3690,7 @@ chkp_walk_pointer_assignments (tree lhs, tree rhs, void *arg,
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (rhs), cnt, field, val)
{
- if (chkp_type_has_pointer (TREE_TYPE (field)))
+ if (field && chkp_type_has_pointer (TREE_TYPE (field)))
{
tree lhs_field = chkp_build_component_ref (lhs, field);
chkp_walk_pointer_assignments (lhs_field, val, arg, handler);
--
2.12.0
>From 7e456669fa321fc59ff249ab95bf2f5f6f7e8867 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 13 Mar 2017 15:30:17 +0000
Subject: [PATCH 09/15] Backport r246098
gcc/ChangeLog:
2017-03-13 Martin Liska <mliska@suse.cz>
PR middle-end/78339
* ipa-pure-const.c (warn_function_noreturn): If the declarations
is a CHKP clone, use original declaration.
gcc/testsuite/ChangeLog:
2017-03-13 Martin Liska <mliska@suse.cz>
PR middle-end/78339
* gcc.target/i386/mpx/pr78339.c: New test.
---
gcc/ipa-pure-const.c | 8 +++++++-
gcc/testsuite/gcc.target/i386/mpx/pr78339.c | 5 +++++
2 files changed, 12 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/gcc.target/i386/mpx/pr78339.c
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 8bfc649e148..f86d6fbbc40 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -249,11 +249,17 @@ warn_function_const (tree decl, bool known_finite)
static void
warn_function_noreturn (tree decl)
{
+ tree original_decl = decl;
+
+ cgraph_node *node = cgraph_node::get (decl);
+ if (node->instrumentation_clone)
+ decl = node->instrumented_version->decl;
+
static hash_set<tree> *warned_about;
if (!lang_hooks.missing_noreturn_ok_p (decl)
&& targetm.warn_func_return (decl))
warned_about
- = suggest_attribute (OPT_Wsuggest_attribute_noreturn, decl,
+ = suggest_attribute (OPT_Wsuggest_attribute_noreturn, original_decl,
true, warned_about, "noreturn");
}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr78339.c b/gcc/testsuite/gcc.target/i386/mpx/pr78339.c
new file mode 100644
index 00000000000..3dd04240e8c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/pr78339.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -Wsuggest-attribute=noreturn" } */
+
+extern _Noreturn void exit (int);
+int main (void) { exit (1); }
--
2.12.0
>From 80b1d8da103e0495e579e4ff15bef3b244b0673a Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 14 Mar 2017 15:31:53 +0000
Subject: [PATCH 10/15] Backport r246129
gcc/ChangeLog:
2017-03-14 Martin Liska <mliska@suse.cz>
PR middle-end/79831
* doc/invoke.texi (-Wchkp): Document the option.
---
gcc/doc/invoke.texi | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 1ca4dcc3221..05a04210002 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -245,7 +245,7 @@ Objective-C and Objective-C++ Dialects}.
-Wno-attributes -Wno-builtin-macro-redefined @gol
-Wc90-c99-compat -Wc99-c11-compat @gol
-Wc++-compat -Wc++11-compat -Wc++14-compat -Wcast-align -Wcast-qual @gol
--Wchar-subscripts -Wclobbered -Wcomment -Wconditionally-supported @gol
+-Wchar-subscripts -Wchkp -Wclobbered -Wcomment -Wconditionally-supported @gol
-Wconversion -Wcoverage-mismatch -Wdate-time -Wdelete-incomplete -Wno-cpp @gol
-Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init @gol
-Wdisabled-optimization @gol
@@ -3538,6 +3538,11 @@ Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
This warning is enabled by @option{-Wall}.
+@item -Wchkp
+@opindex Wchkp
+Warn about an invalid memory access that is found by Pointer Bounds Checker
+(@option{-fcheck-pointer-bounds}).
+
@item -Wno-coverage-mismatch
@opindex Wno-coverage-mismatch
Warn if feedback profiles do not match when using the
--
2.12.0
>From 4b7929721b814546ffeb4d4beaa453915843f46c Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 20 Mar 2017 10:04:06 +0000
Subject: [PATCH 11/15] Backport r246275
gcc/ChangeLog:
2017-03-20 Martin Liska <mliska@suse.cz>
PR target/79769
PR target/79770
* tree-chkp.c (chkp_find_bounds_1): Handle REAL_CST,
COMPLEX_CST and VECTOR_CST.
gcc/testsuite/ChangeLog:
2017-03-20 Martin Liska <mliska@suse.cz>
PR target/79769
PR target/79770
* g++.dg/pr79769.C: New test.
* gcc.target/i386/mpx/pr79770.c: New test.
---
gcc/testsuite/g++.dg/pr79769.C | 4 ++++
gcc/testsuite/gcc.target/i386/mpx/pr79770.c | 19 +++++++++++++++++++
gcc/tree-chkp.c | 2 ++
3 files changed, 25 insertions(+)
create mode 100644 gcc/testsuite/g++.dg/pr79769.C
create mode 100644 gcc/testsuite/gcc.target/i386/mpx/pr79770.c
diff --git a/gcc/testsuite/g++.dg/pr79769.C b/gcc/testsuite/g++.dg/pr79769.C
new file mode 100644
index 00000000000..c3186877f60
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr79769.C
@@ -0,0 +1,4 @@
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms" } */
+
+void a (_Complex) { a (3); }
diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr79770.c b/gcc/testsuite/gcc.target/i386/mpx/pr79770.c
new file mode 100644
index 00000000000..0890fcc7bf1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/pr79770.c
@@ -0,0 +1,19 @@
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms -Wno-psabi" } */
+
+typedef unsigned U __attribute__ ((vector_size (64)));
+typedef unsigned __int128 V __attribute__ ((vector_size (64)));
+
+static inline V
+bar (U u, U x, V v)
+{
+ v = (V)(U) { 0, ~0 };
+ v[x[0]] <<= u[-63];
+ return v;
+}
+
+V
+foo (U u)
+{
+ return bar (u, (U) {}, (V) {});
+}
diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c
index 049bafae4e2..39a9f62df53 100644
--- a/gcc/tree-chkp.c
+++ b/gcc/tree-chkp.c
@@ -3618,6 +3618,8 @@ chkp_find_bounds_1 (tree ptr, tree ptr_src, gimple_stmt_iterator *iter)
break;
case INTEGER_CST:
+ case COMPLEX_CST:
+ case VECTOR_CST:
if (integer_zerop (ptr_src))
bounds = chkp_get_none_bounds ();
else
--
2.12.0
>From e3c4be217d5a06fdbfb6f86ca8a98a42086dfb81 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 20 Mar 2017 10:06:00 +0000
Subject: [PATCH 12/15] Backport r246276
gcc/ChangeLog:
2017-03-20 Martin Liska <mliska@suse.cz>
PR middle-end/79753
* tree-chkp.c (chkp_build_returned_bound): Do not build
returned bounds for a LHS that's not a BOUNDED_P type.
gcc/testsuite/ChangeLog:
2017-03-20 Martin Liska <mliska@suse.cz>
PR middle-end/79753
* gcc.target/i386/mpx/pr79753.c: New test.
---
gcc/testsuite/gcc.target/i386/mpx/pr79753.c | 14 ++++++++++++++
gcc/tree-chkp.c | 11 ++++++-----
2 files changed, 20 insertions(+), 5 deletions(-)
create mode 100644 gcc/testsuite/gcc.target/i386/mpx/pr79753.c
diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr79753.c b/gcc/testsuite/gcc.target/i386/mpx/pr79753.c
new file mode 100644
index 00000000000..9b7bc52e1ed
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/pr79753.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -O2" } */
+
+int
+foo (void)
+{
+ return 0;
+}
+
+void
+bar (int **p)
+{
+ *p = (int *) (__UINTPTR_TYPE__) foo ();
+}
diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c
index 39a9f62df53..824827768f4 100644
--- a/gcc/tree-chkp.c
+++ b/gcc/tree-chkp.c
@@ -2236,6 +2236,7 @@ chkp_build_returned_bound (gcall *call)
tree bounds;
gimple stmt;
tree fndecl = gimple_call_fndecl (call);
+ tree lhs = gimple_call_lhs (call);
unsigned int retflags;
/* To avoid fixing alloca expands in targets we handle
@@ -2246,9 +2247,8 @@ chkp_build_returned_bound (gcall *call)
|| DECL_FUNCTION_CODE (fndecl) == BUILT_IN_ALLOCA_WITH_ALIGN))
{
tree size = gimple_call_arg (call, 0);
- tree lb = gimple_call_lhs (call);
gimple_stmt_iterator iter = gsi_for_stmt (call);
- bounds = chkp_make_bounds (lb, size, &iter, true);
+ bounds = chkp_make_bounds (lhs, size, &iter, true);
}
/* We know bounds returned by set_bounds builtin call. */
else if (fndecl
@@ -2301,9 +2301,10 @@ chkp_build_returned_bound (gcall *call)
bounds = chkp_find_bounds (gimple_call_arg (call, argno), &iter);
}
- else if (chkp_call_returns_bounds_p (call))
+ else if (chkp_call_returns_bounds_p (call)
+ && BOUNDED_P (lhs))
{
- gcc_assert (TREE_CODE (gimple_call_lhs (call)) == SSA_NAME);
+ gcc_assert (TREE_CODE (lhs) == SSA_NAME);
/* In general case build checker builtin call to
obtain returned bounds. */
@@ -2330,7 +2331,7 @@ chkp_build_returned_bound (gcall *call)
print_gimple_stmt (dump_file, call, 0, TDF_VOPS|TDF_MEMSYMS);
}
- bounds = chkp_maybe_copy_and_register_bounds (gimple_call_lhs (call), bounds);
+ bounds = chkp_maybe_copy_and_register_bounds (lhs, bounds);
return bounds;
}
--
2.12.0
>From 534038d98522ecd9a8695faa8996fda05a6b059e Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 21 Mar 2017 12:01:40 +0000
Subject: [PATCH 13/15] Backport r246316
gcc/testsuite/ChangeLog:
2017-03-21 Martin Liska <mliska@suse.cz>
* gcc.target/i386/pr65044.c: Add '.' in order to catch
apostrophes.
---
gcc/testsuite/gcc.target/i386/pr65044.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/testsuite/gcc.target/i386/pr65044.c b/gcc/testsuite/gcc.target/i386/pr65044.c
index 3b129862aa9..24b038e56a9 100644
--- a/gcc/testsuite/gcc.target/i386/pr65044.c
+++ b/gcc/testsuite/gcc.target/i386/pr65044.c
@@ -1,4 +1,4 @@
-/* { dg-error "-fcheck-pointer-bounds is not supported with Address Sanitizer" } */
+/* { dg-error ".-fcheck-pointer-bounds. is not supported with Address Sanitizer" } */
/* { dg-do compile { target { ! x32 } } } */
/* { dg-options "-fcheck-pointer-bounds -mmpx -fsanitize=address" } */
--
2.12.0
>From c210cd5e6777be3acca40d2352cc3be2c3167dad Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 21 Mar 2017 14:41:11 +0000
Subject: [PATCH 14/15] Backport r246321
gcc/ChangeLog:
2017-03-21 Martin Liska <mliska@suse.cz>
PR gcov-profile/80081
* Makefile.in: Add gcov-dump and fix installation of gcov-tool.
* doc/gcc.texi: Include gcov-dump stuff.
* doc/gcov-dump.texi: New file.
---
gcc/Makefile.in | 11 ++++--
gcc/doc/gcc.texi | 3 ++
gcc/doc/gcov-dump.texi | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 105 insertions(+), 2 deletions(-)
create mode 100644 gcc/doc/gcov-dump.texi
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f00600dd30d..c9fec159ef0 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2897,7 +2897,7 @@ TEXI_GCC_FILES = gcc.texi gcc-common.texi gcc-vers.texi frontends.texi \
gcov.texi trouble.texi bugreport.texi service.texi \
contribute.texi compat.texi funding.texi gnu.texi gpl_v3.texi \
fdl.texi contrib.texi cppenv.texi cppopts.texi avr-mmcu.texi \
- implement-c.texi implement-cxx.texi gcov-tool.texi
+ implement-c.texi implement-cxx.texi gcov-tool.texi gcov-dump.texi
# we explicitly use $(srcdir)/doc/tm.texi here to avoid confusion with
# the generated tm.texi; the latter might have a more recent timestamp,
@@ -3020,7 +3020,7 @@ $(build_htmldir)/gccinstall/index.html: $(TEXI_GCCINSTALL_FILES)
$(SHELL) $(srcdir)/doc/install.texi2html
MANFILES = doc/gcov.1 doc/cpp.1 doc/gcc.1 doc/gfdl.7 doc/gpl.7 \
- doc/fsf-funding.7 doc/gcov-tool.1
+ doc/fsf-funding.7 doc/gcov-tool.1 doc/gcov-dump.1
generated-manpages: man
@@ -3414,6 +3414,8 @@ install-man: lang.install-man \
$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) \
$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext) \
$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext) \
+ $(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext) \
+ $(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext) \
$(DESTDIR)$(man7dir)/fsf-funding$(man7ext) \
$(DESTDIR)$(man7dir)/gfdl$(man7ext) \
$(DESTDIR)$(man7dir)/gpl$(man7ext)
@@ -3443,6 +3445,11 @@ $(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcov-tool.1 instal
-$(INSTALL_DATA) $< $@
-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcov-dump.1 installdirs
+ -rm -f $@
+ -$(INSTALL_DATA) $< $@
+ -chmod a-x $@
+
# Install all the header files built in the include subdirectory.
install-headers: $(INSTALL_HEADERS_DIR)
# Fix symlinks to absolute paths in the installed include directory to
diff --git a/gcc/doc/gcc.texi b/gcc/doc/gcc.texi
index ba6b60807d8..429a8138616 100644
--- a/gcc/doc/gcc.texi
+++ b/gcc/doc/gcc.texi
@@ -67,6 +67,7 @@ Texts being (a) (see below), and with the Back-Cover Texts being (b)
* g++: (gcc). The GNU C++ compiler.
* gcov: (gcc) Gcov. @command{gcov}---a test coverage program.
* gcov-tool: (gcc) Gcov-tool. @command{gcov-tool}---an offline gcda profile processing program.
+* gcov-dump: (gcc) Gcov-dump. @command{gcov-dump}---an offline gcda and gcno profile dump tool.
@end direntry
This file documents the use of the GNU compilers.
@sp 1
@@ -140,6 +141,7 @@ Introduction, gccint, GNU Compiler Collection (GCC) Internals}.
* Compatibility:: Binary Compatibility
* Gcov:: @command{gcov}---a test coverage program.
* Gcov-tool:: @command{gcov-tool}---an offline gcda profile processing program.
+* Gcov-dump:: @command{gcov-dump}---an offline gcda and gcno profile dump tool.
* Trouble:: If you have trouble using GCC.
* Bugs:: How, why and where to report bugs.
* Service:: How To Get Help with GCC
@@ -167,6 +169,7 @@ Introduction, gccint, GNU Compiler Collection (GCC) Internals}.
@include compat.texi
@include gcov.texi
@include gcov-tool.texi
+@include gcov-dump.texi
@include trouble.texi
@include bugreport.texi
@include service.texi
diff --git a/gcc/doc/gcov-dump.texi b/gcc/doc/gcov-dump.texi
new file mode 100644
index 00000000000..d7931fd3a19
--- /dev/null
+++ b/gcc/doc/gcov-dump.texi
@@ -0,0 +1,93 @@
+@c Copyright (C) 2017 Free Software Foundation, Inc.
+@c This is part of the GCC manual.
+@c For copying conditions, see the file gcc.texi.
+
+@ignore
+@c man begin COPYRIGHT
+Copyright @copyright{} 2017 Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'' and ``Funding
+Free Software'', the Front-Cover texts being (a) (see below), and with
+the Back-Cover Texts being (b) (see below). A copy of the license is
+included in the gfdl(7) man page.
+
+(a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
+@c man end
+@c Set file name and title for the man page.
+@setfilename gcov-dump
+@settitle offline gcda and gcno profile dump tool
+@end ignore
+
+@node Gcov-dump
+@chapter @command{gcov-dump}---an Offline Gcda and Gcno Profile Dump Tool
+
+@menu
+* Gcov-dump Intro:: Introduction to gcov-dump.
+* Invoking Gcov-dump:: How to use gcov-dump.
+@end menu
+
+@node Gcov-dump Intro
+@section Introduction to @command{gcov-dump}
+@c man begin DESCRIPTION
+
+@command{gcov-dump} is a tool you can use in conjunction with GCC to
+dump content of gcda and gcno profile files offline.
+
+@c man end
+
+@node Invoking Gcov-dump
+@section Invoking @command{gcov-dump}
+
+@smallexample
+Usage: gcov-dump @r{[}@var{OPTION}@r{]} ... @var{gcovfiles}
+@end smallexample
+
+@command{gcov-dump} accepts the following options:
+
+@ignore
+@c man begin SYNOPSIS
+gcov-dump [@option{-v}|@option{--version}]
+ [@option{-h}|@option{--help}]
+ [@option{-l}|@option{--long}]
+ [@option{-p}|@option{--positions}]
+ [@option{-w}|@option{--working-sets}] @var{gcovfiles}
+@c man end
+@end ignore
+
+@c man begin OPTIONS
+@table @gcctabopt
+@item -h
+@itemx --help
+Display help about using @command{gcov-dump} (on the standard output), and
+exit without doing any further processing.
+
+@item -v
+@itemx --version
+Display the @command{gcov-dump} version number (on the standard output),
+and exit without doing any further processing.
+
+@item -l
+@itemx --long
+Dump content of records.
+
+@item -p
+@itemx --positions
+Dump positions of records.
+
+@item -w
+@itemx --working-sets
+Dump working set computed from summary.
+@end table
+
+@c man end
--
2.12.0
>From a836b9520781f265eef7b54ded40f8fcaa7d77c5 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 22 Mar 2017 09:21:56 +0000
Subject: [PATCH 15/15] Backport r246345
gcc/ChangeLog:
2017-03-22 Martin Liska <mliska@suse.cz>
PR target/79906
* config/rs6000/rs6000.c (rs6000_inner_target_options): Show
error message instead of an ICE.
gcc/testsuite/ChangeLog:
2017-03-22 Martin Liska <mliska@suse.cz>
PR target/79906
* g++.dg/ext/mv8.C: Add power* targets.
---
gcc/config/rs6000/rs6000.c | 5 ++++-
gcc/testsuite/g++.dg/ext/mv8.C | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 63b65dac4cc..cd3a73d6670 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -32628,7 +32628,10 @@ rs6000_inner_target_options (tree args, bool attr_p)
}
else
- gcc_unreachable ();
+ {
+ error ("attribute %<target%> argument not a string");
+ return false;
+ }
return ret;
}
diff --git a/gcc/testsuite/g++.dg/ext/mv8.C b/gcc/testsuite/g++.dg/ext/mv8.C
index 2e98dd7ad85..bbf90b5a328 100644
--- a/gcc/testsuite/g++.dg/ext/mv8.C
+++ b/gcc/testsuite/g++.dg/ext/mv8.C
@@ -1,4 +1,4 @@
-// { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-do compile { target i?86-*-* x86_64-*-* powerpc*-*-* } }
// { dg-options "" }
__attribute__((target (11,12)))
--
2.12.0