On 02/16/2016 08:24 AM, Jakub Jelinek wrote:
Hi!

As mentioned in the PR, %{ftree-parallelize-loops=*} expands to
all -ftree-parallelize-loops= options, not just the last one.
So greater_than_spec_func is actually called say for
-ftree-parallelize-loops=0 -ftree-parallelize-loops=2 with
- ftree-parallelize-loops=0 - ftree-parallelize-loops=2 1
(each whitespace separated sequence separate arg), but it asserts
it sees just 3 arguments.
Passing the - and ftree-parallelize-loops= stuff looks weird,
and we have %* that substitutes just the variable part of the option,
so in addition to fixing the case of multiple options I've also changed
%:gt() behaviour, so that it now gets just the numbers and compares the
last two of them.  So for the above options it would be called with
0 2 1
and would compare
2 > 1
and return "", or for
-ftree-parallelize-loops=2 -ftree-parallelize-loops=0 -ftree-parallelize-loops=1
would be
2 0 1 1
and compare
1 > 1
and return NULL. %:gt() is not used anywhere else, and has been introduced
only in GCC 6.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2016-02-16  Jakub Jelinek  <ja...@redhat.com>

        PR driver/69805
        * gcc.c (LINK_COMMAND_SPEC, GOMP_SELF_SPECS): Use
        :%* in %:gt() argument.
        (greater_than_spec_func): Adjust for expecting only numbers,
        if there are more than two numbers, compare the last two.

        * testsuite/libgomp.c/pr69805.c: New test.
I'll note that Tom ack'd in c#3, and he certainly know this functionality better than I. So OK for trunk.

Jeff

Reply via email to