From 171954d816827f634d6bf6f2ff12286b1f35c2f7 Mon Sep 17 00:00:00 2001 From: Peter Bergner Date: Thu, 29 Nov 2018 19:25:47 +0000 Subject: [PATCH] re PR target/87496 (ICE in aggregate_value_p at gcc/function.c:2046) gcc/ PR target/87496 * config/rs6000/rs6000.c (rs6000_option_override_internal): Disallow -mabi=ieeelongdouble without both -mpopcntd and -mvsx. gcc/testsuite/ PR target/87496 * gcc.target/powerpc/pr87496.c: New test. From-SVN: r266636 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/rs6000.c | 22 ++++++++++++++-------- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/powerpc/pr87496.c | 10 ++++++++++ 4 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/pr87496.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8cf443f6b9f..0985331bc65 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-29 Peter Bergner + + PR target/87496 + * config/rs6000/rs6000.c (rs6000_option_override_internal): Disallow + -mabi=ieeelongdouble without both -mpopcntd and -mvsx. + 2018-11-29 Uros Bizjak * config/i386/i386.c (inline_memory_move_cost): diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index b2fb5c898b3..02e69c103ec 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4291,16 +4291,22 @@ rs6000_option_override_internal (bool global_init_p) if (!global_options_set.x_rs6000_ieeequad) rs6000_ieeequad = TARGET_IEEEQUAD_DEFAULT; - else if (rs6000_ieeequad != TARGET_IEEEQUAD_DEFAULT && TARGET_LONG_DOUBLE_128) + else { - static bool warned_change_long_double; - if (!warned_change_long_double) + if (!TARGET_POPCNTD || !TARGET_VSX) + error ("%qs requires full ISA 2.06 support", "-mabi=ieeelongdouble"); + + if (rs6000_ieeequad != TARGET_IEEEQUAD_DEFAULT && TARGET_LONG_DOUBLE_128) { - warned_change_long_double = true; - if (TARGET_IEEEQUAD) - warning (OPT_Wpsabi, "Using IEEE extended precision long double"); - else - warning (OPT_Wpsabi, "Using IBM extended precision long double"); + static bool warned_change_long_double; + if (!warned_change_long_double) + { + warned_change_long_double = true; + if (TARGET_IEEEQUAD) + warning (OPT_Wpsabi, "Using IEEE extended precision long double"); + else + warning (OPT_Wpsabi, "Using IBM extended precision long double"); + } } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ecb1ad6095d..4a100149165 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-29 Peter Bergner + + PR target/87496 + * gcc.target/powerpc/pr87496.c: New test. + 2018-11-29 Martin Sebor PR c/88172 diff --git a/gcc/testsuite/gcc.target/powerpc/pr87496.c b/gcc/testsuite/gcc.target/powerpc/pr87496.c new file mode 100644 index 00000000000..b2ebc467902 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr87496.c @@ -0,0 +1,10 @@ +/* PR target/87496.c */ +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */ +/* { dg-require-effective-target longdouble128 } */ +/* { dg-options "-O2 -mcpu=power7 -mabi=ieeelongdouble -mno-popcntd -Wno-psabi" } */ + +int i; + +/* { dg-error "'-mabi=ieeelongdouble' requires full ISA 2.06 support" "PR87496" { target *-*-* } 0 } */ -- 2.30.2