From 85339618b6ba3edab19d8bd98eb19d8c5627c276 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Mon, 5 Oct 2015 15:28:06 +0000 Subject: [PATCH] re PR middle-end/67821 (ICE in duplicate_ssa_name_range_info) PR tree-optimization/67821 * tree-ssanames.c (duplicate_ssa_name_range_info): Remove an assert. * gcc.dg/torture/pr67821-2.c: New test. * gcc.dg/torture/pr67821.c: New test. From-SVN: r228490 --- gcc/ChangeLog | 5 +++++ gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/torture/pr67821-2.c | 14 ++++++++++++++ gcc/testsuite/gcc.dg/torture/pr67821.c | 15 +++++++++++++++ gcc/tree-ssanames.c | 1 - 5 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr67821-2.c create mode 100644 gcc/testsuite/gcc.dg/torture/pr67821.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5340f47a1be..ff76048438a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-10-05 Marek Polacek + + PR tree-optimization/67821 + * tree-ssanames.c (duplicate_ssa_name_range_info): Remove an assert. + 2015-10-05 Thomas Schwinge PR other/65021 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f6f920307b1..762da2abeba 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-10-05 Marek Polacek + + PR tree-optimization/67821 + * gcc.dg/torture/pr67821-2.c: New test. + * gcc.dg/torture/pr67821.c: New test. + 2015-10-05 Kirill Yukhin * gcc.target/i386/builtin_target.c: Add check for "skylake-avx512". diff --git a/gcc/testsuite/gcc.dg/torture/pr67821-2.c b/gcc/testsuite/gcc.dg/torture/pr67821-2.c new file mode 100644 index 00000000000..38cfc8420d9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr67821-2.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ + +int a, b, c, d, e, g; +short f; + +void +fn1 () +{ + int i; + f = a - b; + e = (c && (i = d = (unsigned) f - 1)) || i; + g = (unsigned) f - 1; + c && (d = 0); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr67821.c b/gcc/testsuite/gcc.dg/torture/pr67821.c new file mode 100644 index 00000000000..1c9e8b9db3f --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr67821.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ + +int isdigit (int); + +int +foo (const char *s) +{ + int success = 1; + const char *p = s + 2; + if (!isdigit (*p)) + success = 0; + while (isdigit (*p)) + ++p; + return success; +} diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c index 64e23790ae3..91f4ed8d7f1 100644 --- a/gcc/tree-ssanames.c +++ b/gcc/tree-ssanames.c @@ -503,7 +503,6 @@ duplicate_ssa_name_range_info (tree name, enum value_range_type range_type, gcc_assert (!POINTER_TYPE_P (TREE_TYPE (name))); gcc_assert (!SSA_NAME_RANGE_INFO (name)); - gcc_assert (!SSA_NAME_ANTI_RANGE_P (name)); if (!range_info) return; -- 2.30.2