From: Marek Polacek Date: Thu, 4 May 2017 10:35:58 +0000 (+0000) Subject: re PR tree-optimization/80612 (ICE in get_range_info, at tree-ssanames.c:375) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c89ffd9997ef30cf68d97e979537dc288a5902b2;p=gcc.git re PR tree-optimization/80612 (ICE in get_range_info, at tree-ssanames.c:375) PR tree-optimization/80612 * calls.c (get_size_range): Check for INTEGRAL_TYPE_P. * gcc.dg/torture/pr80612.c: New test. From-SVN: r247586 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 67a97c84ca0..84c1f685744 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-05-04 Marek Polacek + + PR tree-optimization/80612 + * calls.c (get_size_range): Check for INTEGRAL_TYPE_P. + 2017-05-04 Prakhar Bahuguna Andre Simoes Dias Vieira diff --git a/gcc/calls.c b/gcc/calls.c index c26f157b0b1..bd081ccf46c 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1270,7 +1270,7 @@ get_size_range (tree exp, tree range[2]) wide_int min, max; enum value_range_type range_type - = (TREE_CODE (exp) == SSA_NAME + = ((TREE_CODE (exp) == SSA_NAME && INTEGRAL_TYPE_P (TREE_TYPE (exp))) ? get_range_info (exp, &min, &max) : VR_VARYING); if (range_type == VR_VARYING) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d3fc7396653..b93975d07a4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-05-04 Marek Polacek + + PR tree-optimization/80612 + * gcc.dg/torture/pr80612.c: New test. + 2017-05-04 Prakhar Bahuguna Andre Simoes Dias Vieira diff --git a/gcc/testsuite/gcc.dg/torture/pr80612.c b/gcc/testsuite/gcc.dg/torture/pr80612.c new file mode 100644 index 00000000000..225b81127a6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr80612.c @@ -0,0 +1,15 @@ +/* PR tree-optimization/80612 */ +/* { dg-do compile } */ + +struct obstack *a; +struct obstack { + union { + void *plain; + void (*extra)(); + } chunkfun; +} fn1(void p4()) { + a->chunkfun.plain = p4; + a->chunkfun.extra(a); +} +void fn2(int) __attribute__((__alloc_size__(1))); +void fn3() { fn1(fn2); }