Patchwork PR lto/50964: [trans-mem] fail gracefully when -flto and -fgnu-tm

login
register
mail settings
Submitter Aldy Hernandez
Date Nov. 6, 2011, 8:03 p.m.
Message ID <4EB6E81A.1040409@redhat.com>
Download mbox | patch
Permalink /patch/123965/
State New
Headers show

Comments

Aldy Hernandez - Nov. 6, 2011, 8:03 p.m.
As per your comment in the PR...

OK for branch?
* opts.c (finish_options): Error out when using -flto and
	-fgnu-tm.
Diego Novillo - Nov. 6, 2011, 8:23 p.m.
On Sun, Nov 6, 2011 at 15:03, Aldy Hernandez <aldyh@redhat.com> wrote:
> As per your comment in the PR...
>
> OK for branch?

"LTO support is currently not supported with transactional memory"

'support' mentioned one too many times.  Maybe 'LTO is currently not
supported with transactional memory'?


Diego.
Andrew Pinski - Nov. 6, 2011, 11:56 p.m.
On Sun, Nov 6, 2011 at 12:03 PM, Aldy Hernandez <aldyh@redhat.com> wrote:
> As per your comment in the PR...
>
> OK for branch?


Why not just fix the issue instead of erroring out?  No other option
has issues with LTO other than TM.  In fact I think this should have
been a merge blocker really.

Thanks,
Andrew Pinsi
Diego Novillo - Nov. 7, 2011, 12:15 a.m.
On Sun, Nov 6, 2011 at 18:56, Andrew Pinski <pinskia@gmail.com> wrote:

> Why not just fix the issue instead of erroring out?  No other option
> has issues with LTO other than TM.  In fact I think this should have
> been a merge blocker really.

I disagree.  TM is a new experimental feature.  It is fine if it is
not supported with all optimization options.  There are other features
not supported with LTO after all (optimization option nodes, omp
clauses, etc).

In the context of TM, support of LTO and FDO will certainly be an
important optimization vector for future work, so I don't expect it to
be unsupported for long.


Diego.

Patch

Index: opts.c
===================================================================
--- opts.c	(revision 181028)
+++ opts.c	(working copy)
@@ -784,6 +784,8 @@  finish_options (struct gcc_options *opts
 #endif
       if (!opts->x_flag_fat_lto_objects && !HAVE_LTO_PLUGIN)
         error_at (loc, "-fno-fat-lto-objects are supported only with linker plugin.");
+      if (opts->x_flag_tm)
+	error_at (loc, "LTO support is currently not supported with transactional memory");
 }
   if ((opts->x_flag_lto_partition_balanced != 0) + (opts->x_flag_lto_partition_1to1 != 0)
        + (opts->x_flag_lto_partition_none != 0) >= 1)