From 4ca5a717e561d8bc135d4b21df605305dcbe495e Mon Sep 17 00:00:00 2001 From: aldyh Date: Thu, 22 Dec 2011 20:18:11 +0000 Subject: [PATCH] PR middle-end/51212 * opts.c (finish_options): Call sorry on -fgnu-tm and -fnon-call-exceptions combination. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182636 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/opts.c | 3 +++ gcc/testsuite/g++.dg/tm/pr51212.C | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/g++.dg/tm/pr51212.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8e7d8e5..e01b24d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-12-22 Aldy Hernandez + + PR middle-end/51212 + * opts.c (finish_options): Call sorry on -fgnu-tm and + -fnon-call-exceptions combination. + 2011-12-22 Jonathan Wakely * doc/invoke.texi (C++ Dialect Options): Add missing options and diff --git a/gcc/opts.c b/gcc/opts.c index 3153fe5..2ed5560 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -663,6 +663,9 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, opts->x_flag_toplevel_reorder = 0; } + if (opts->x_flag_tm && opts->x_flag_non_call_exceptions) + sorry ("transactional memory is not supported with non-call exceptions"); + /* -Wmissing-noreturn is alias for -Wsuggest-attribute=noreturn. */ if (opts->x_warn_missing_noreturn) opts->x_warn_suggest_attribute_noreturn = true; diff --git a/gcc/testsuite/g++.dg/tm/pr51212.C b/gcc/testsuite/g++.dg/tm/pr51212.C new file mode 100644 index 0000000..9d2971b --- /dev/null +++ b/gcc/testsuite/g++.dg/tm/pr51212.C @@ -0,0 +1,19 @@ +// { dg-do compile } +// { dg-options "-fgnu-tm -fnon-call-exceptions" } + +struct S +{ + S () + { + } +}; + +__attribute__ ((transaction_callable)) +void foo (int *p) +{ + S s; + if (*p) + ; +} + +// { dg-message "sorry, unimplemented: transactional memory is not supported with non-call exceptions" "-fnon-call-exceptions and -fgnu-tm together" { target *-*-* } 0 } -- 2.7.4