summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/lto-wrapper.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/trans-mem-3_0.c8
-rw-r--r--gcc/testsuite/gcc.dg/lto/trans-mem-3_1.c18
4 files changed, 34 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0dabe647147..91b7f267199 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-19 Aldy Hernandez <aldyh@redhat.com>
+
+ PR lto/51280
+ * lto-wrapper.c (run_gcc): Pass -fgnu_tm on.
+ (merge_and_complain): Same.
+
2012-01-19 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/50237
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 1cc7bfb843d..6d262e8040b 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -403,6 +403,7 @@ merge_and_complain (struct cl_decoded_option **decoded_options,
case OPT_fpie:
case OPT_fcommon:
case OPT_fexceptions:
+ case OPT_fgnu_tm:
/* Do what the old LTO code did - collect exactly one option
setting per OPT code, we pick the first we encounter.
??? This doesn't make too much sense, but when it doesn't
@@ -555,6 +556,7 @@ run_gcc (unsigned argc, char *argv[])
case OPT_fpie:
case OPT_fcommon:
case OPT_fexceptions:
+ case OPT_fgnu_tm:
break;
default:
diff --git a/gcc/testsuite/gcc.dg/lto/trans-mem-3_0.c b/gcc/testsuite/gcc.dg/lto/trans-mem-3_0.c
new file mode 100644
index 00000000000..dd578907da0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/trans-mem-3_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-options {{-flto}} } */
+/* { dg-lto-do link } */
+
+/* Test that we can build one object file with -fgnu-tm
+ (trans-mem-3_1.c), but do the final link of all objects without
+ -fgnu-tm. */
+
+int i;
diff --git a/gcc/testsuite/gcc.dg/lto/trans-mem-3_1.c b/gcc/testsuite/gcc.dg/lto/trans-mem-3_1.c
new file mode 100644
index 00000000000..d907f68384f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/trans-mem-3_1.c
@@ -0,0 +1,18 @@
+/* { dg-options "-fgnu-tm" } */
+
+extern int i;
+
+main()
+{
+ __transaction_atomic { i = 0; }
+}
+
+#define dummy(func) \
+ __attribute__((noinline,noclone,used)) void func() { asm (""); }
+
+dummy(_ITM_beginTransaction)
+dummy(_ITM_commitTransaction)
+dummy(_ITM_WU4)
+dummy(_ITM_WU8)
+dummy(_ITM_registerTMCloneTable)
+dummy(_ITM_deregisterTMCloneTable)