From: Ilya Enkovich Date: Thu, 21 May 2015 08:32:52 +0000 (+0000) Subject: re PR middle-end/66221 (lto1: error: type variant has different TYPE_ARG_TYPES) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=551dc3008c48b64027cc8b143ee5a342834b0ba4;p=gcc.git re PR middle-end/66221 (lto1: error: type variant has different TYPE_ARG_TYPES) gcc/ PR middle-end/66221 * ipa-chkp.c (chkp_copy_function_type_adding_bounds): Use build_distinct_type_copy to copy bounds. gcc/testsuite/ PR middle-end/66221 * gcc.dg/lto/pr66221_0.c: New test. * gcc.dg/lto/pr66221_1.c: New test. From-SVN: r223471 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a62199a2faa..550d98c30eb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-05-21 Ilya Enkovich + + PR middle-end/66221 + * ipa-chkp.c (chkp_copy_function_type_adding_bounds): Use + build_distinct_type_copy to copy bounds. + 2015-05-21 Thomas Schwinge * genrecog.c (MAX_DEPTH, MIN_NUM_STATEMENTS, MAX_NUM_STATEMENTS): diff --git a/gcc/ipa-chkp.c b/gcc/ipa-chkp.c index ac5eb358a95..c7102915cbf 100644 --- a/gcc/ipa-chkp.c +++ b/gcc/ipa-chkp.c @@ -308,7 +308,7 @@ chkp_copy_function_type_adding_bounds (tree orig_type) if (!arg_type) return orig_type; - type = copy_node (orig_type); + type = build_distinct_type_copy (orig_type); TYPE_ARG_TYPES (type) = copy_list (TYPE_ARG_TYPES (type)); for (arg_type = TYPE_ARG_TYPES (type); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 868e1e941da..1823df322d9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-05-21 Ilya Enkovich + + PR middle-end/66221 + * gcc.dg/lto/pr66221_0.c: New test. + * gcc.dg/lto/pr66221_1.c: New test. + 2015-05-21 Manuel López-Ibáñez PR c/52952 diff --git a/gcc/testsuite/gcc.dg/lto/pr66221_0.c b/gcc/testsuite/gcc.dg/lto/pr66221_0.c new file mode 100644 index 00000000000..dbb92829be6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr66221_0.c @@ -0,0 +1,10 @@ +/* { dg-lto-do link } */ +/* { dg-require-effective-target mpx } */ +/* { dg-lto-options { { -O2 -flto -fcheck-pointer-bounds -mmpx } } } */ + +int test1 (const char *); + +int main (int argc, const char **argv) +{ + return test1 (argv[0]); +} diff --git a/gcc/testsuite/gcc.dg/lto/pr66221_1.c b/gcc/testsuite/gcc.dg/lto/pr66221_1.c new file mode 100644 index 00000000000..4c94544beed --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr66221_1.c @@ -0,0 +1,4 @@ +int test1 (const char *p) +{ + return (int)(*p); +}