From: Kugan Vivekanandarajah Date: Fri, 23 Sep 2016 10:25:09 +0000 (+0000) Subject: Drop TREE_OVERFLOW X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1e401340719c3bb64382f81cf95607898139487f;p=gcc.git Drop TREE_OVERFLOW gcc/ChangeLog: 2016-09-23 Kugan Vivekanandarajah PR ipa/77677 * ipa-cp.c (propagate_vr_accross_jump_function): Drop TREE_OVERFLOW from constant while creating value range. gcc/testsuite/ChangeLog: 2016-09-23 Kugan Vivekanandarajah PR ipa/77677 * gcc.dg/torture/pr77677.c: New test. From-SVN: r240420 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 210d7f9be29..d1226159df0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-09-23 Kugan Vivekanandarajah + + PR ipa/77677 + * ipa-cp.c (propagate_vr_accross_jump_function): Drop TREE_OVERFLOW + from constant while creating value range. + 2016-09-23 Renlin Li * ira.c (ira): Move ira_use_lra_p initialization code to ... diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index fdcce16f412..95a2a1e4b3a 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -2065,6 +2065,8 @@ propagate_vr_accross_jump_function (cgraph_edge *cs, tree val = ipa_get_jf_constant (jfunc); if (TREE_CODE (val) == INTEGER_CST) { + if (TREE_OVERFLOW_P (val)) + val = drop_tree_overflow (val); jfunc->vr_known = true; jfunc->m_vr.type = VR_RANGE; jfunc->m_vr.min = val; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 488e5db5f50..150aff91ead 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-09-23 Kugan Vivekanandarajah + + PR ipa/77677 + * gcc.dg/torture/pr77677.c: New test. + 2016-09-23 Andre Vehreschild * gfortran.dg/coarray_lib_comm_1.f90: Using the old caf-interface diff --git a/gcc/testsuite/gcc.dg/torture/pr77677.c b/gcc/testsuite/gcc.dg/torture/pr77677.c new file mode 100644 index 00000000000..af3f0b0af09 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr77677.c @@ -0,0 +1,18 @@ +/* PR ipa/77677 */ +/* { dg-do compile } */ + +int a, b; + +static void fn1 (short p1) +{ + a = -p1; + if (a || b) + __builtin_printf ("%d\n", b); +} + +int main () +{ + int c[] = { 40000 }; + fn1 (c[0]); + return 0; +}