* FIx riscv port building with the trunk
@ 2017-03-13 17:50 Jeff Law
2017-03-13 18:22 ` Palmer Dabbelt
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Law @ 2017-03-13 17:50 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 544 bytes --]
RISCV targets were failing to build due to implicit-fallthru warnings.
This changes comments which indicated expected fallthru to use the
attribute and the port builds again. I assume something about the use
of the cpp macro is causing the comment to not have the intended effect.
I didn't dig into that. Nor did I try to change all the fallthru
comments to use the attribute -- just the two that implicit-fallthru was
complaining about.
Verified that after this patch the two riscv targets build. Installed
on the trunk.
Jeff
[-- Attachment #2: P --]
[-- Type: text/plain, Size: 1333 bytes --]
commit 448373f1f2912228dc72605fb6f3343fd57023ee
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon Mar 13 17:49:40 2017 +0000
* config/riscv/riscv.c (riscv_emit_float_compare): Use fallthru
attribute rather than comments.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246101 138bc75d-0d04-0410-961f-82ee72b054a4
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 124dca3..e863cdf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
2017-03-13 Jeff Law <law@redhat.com>
+ * config/riscv/riscv.c (riscv_emit_float_compare): Use fallthru
+ attribute rather than comments.
+
* config/pdp11/pdp11.md (movmemhi): Adjust operand numbers to
match_scratch operand is highest.
diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c
index 89567f7..e5044ba 100644
--- a/gcc/config/riscv/riscv.c
+++ b/gcc/config/riscv/riscv.c
@@ -2089,13 +2089,13 @@ riscv_emit_float_compare (enum rtx_code *code, rtx *op0, rtx *op1)
case UNLT:
std::swap (cmp_op0, cmp_op1);
- /* Fall through. */
+ __attribute__((fallthrough));
UNORDERED_COMPARISON(UNGT, le)
case UNLE:
std::swap (cmp_op0, cmp_op1);
- /* Fall through. */
+ __attribute__((fallthrough));
UNORDERED_COMPARISON(UNGE, lt)
#undef UNORDERED_COMPARISON
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: FIx riscv port building with the trunk
2017-03-13 17:50 FIx riscv port building with the trunk Jeff Law
@ 2017-03-13 18:22 ` Palmer Dabbelt
2017-03-14 3:01 ` Kito Cheng
0 siblings, 1 reply; 4+ messages in thread
From: Palmer Dabbelt @ 2017-03-13 18:22 UTC (permalink / raw)
To: law; +Cc: gcc-patches
On Mon, 13 Mar 2017 10:50:28 PDT (-0700), law@redhat.com wrote:
>
> RISCV targets were failing to build due to implicit-fallthru warnings.
>
> This changes comments which indicated expected fallthru to use the
> attribute and the port builds again. I assume something about the use
> of the cpp macro is causing the comment to not have the intended effect.
> I didn't dig into that. Nor did I try to change all the fallthru
> comments to use the attribute -- just the two that implicit-fallthru was
> complaining about.
>
> Verified that after this patch the two riscv targets build. Installed
> on the trunk.
>
> Jeff
>
> commit 448373f1f2912228dc72605fb6f3343fd57023ee
> Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
> Date: Mon Mar 13 17:49:40 2017 +0000
>
> * config/riscv/riscv.c (riscv_emit_float_compare): Use fallthru
> attribute rather than comments.
>
> git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246101 138bc75d-0d04-0410-961f-82ee72b054a4
>
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index 124dca3..e863cdf 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,5 +1,8 @@
> 2017-03-13 Jeff Law <law@redhat.com>
>
> + * config/riscv/riscv.c (riscv_emit_float_compare): Use fallthru
> + attribute rather than comments.
> +
> * config/pdp11/pdp11.md (movmemhi): Adjust operand numbers to
> match_scratch operand is highest.
>
> diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c
> index 89567f7..e5044ba 100644
> --- a/gcc/config/riscv/riscv.c
> +++ b/gcc/config/riscv/riscv.c
> @@ -2089,13 +2089,13 @@ riscv_emit_float_compare (enum rtx_code *code, rtx *op0, rtx *op1)
>
> case UNLT:
> std::swap (cmp_op0, cmp_op1);
> - /* Fall through. */
> + __attribute__((fallthrough));
>
> UNORDERED_COMPARISON(UNGT, le)
>
> case UNLE:
> std::swap (cmp_op0, cmp_op1);
> - /* Fall through. */
> + __attribute__((fallthrough));
>
> UNORDERED_COMPARISON(UNGE, lt)
> #undef UNORDERED_COMPARISON
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: FIx riscv port building with the trunk
2017-03-13 18:22 ` Palmer Dabbelt
@ 2017-03-14 3:01 ` Kito Cheng
2017-03-14 3:52 ` Palmer Dabbelt
0 siblings, 1 reply; 4+ messages in thread
From: Kito Cheng @ 2017-03-14 3:01 UTC (permalink / raw)
To: Palmer Dabbelt; +Cc: Jeff Law, gcc-patches
Hi Jeff:
It's make older gcc version can't build RISC-V port, how about use
gcc_fallthrough instead?
diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c
index f4c1f23..d1af07f5 100644
--- a/gcc/config/riscv/riscv.c
+++ b/gcc/config/riscv/riscv.c
@@ -2089,13 +2089,13 @@ riscv_emit_float_compare (enum rtx_code *code,
rtx *op0, rtx *op1)
case UNLT:
std::swap (cmp_op0, cmp_op1);
- __attribute__((fallthrough));
+ gcc_fallthrough ();
UNORDERED_COMPARISON(UNGT, le)
case UNLE:
std::swap (cmp_op0, cmp_op1);
- __attribute__((fallthrough));
+ gcc_fallthrough ();
UNORDERED_COMPARISON(UNGE, lt)
#undef UNORDERED_COMPARISON
On Tue, Mar 14, 2017 at 2:22 AM, Palmer Dabbelt <palmer@dabbelt.com> wrote:
> On Mon, 13 Mar 2017 10:50:28 PDT (-0700), law@redhat.com wrote:
>>
>> RISCV targets were failing to build due to implicit-fallthru warnings.
>>
>> This changes comments which indicated expected fallthru to use the
>> attribute and the port builds again. I assume something about the use
>> of the cpp macro is causing the comment to not have the intended effect.
>> I didn't dig into that. Nor did I try to change all the fallthru
>> comments to use the attribute -- just the two that implicit-fallthru was
>> complaining about.
>>
>> Verified that after this patch the two riscv targets build. Installed
>> on the trunk.
>>
>> Jeff
>>
>> commit 448373f1f2912228dc72605fb6f3343fd57023ee
>> Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
>> Date: Mon Mar 13 17:49:40 2017 +0000
>>
>> * config/riscv/riscv.c (riscv_emit_float_compare): Use fallthru
>> attribute rather than comments.
>>
>> git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246101 138bc75d-0d04-0410-961f-82ee72b054a4
>>
>> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
>> index 124dca3..e863cdf 100644
>> --- a/gcc/ChangeLog
>> +++ b/gcc/ChangeLog
>> @@ -1,5 +1,8 @@
>> 2017-03-13 Jeff Law <law@redhat.com>
>>
>> + * config/riscv/riscv.c (riscv_emit_float_compare): Use fallthru
>> + attribute rather than comments.
>> +
>> * config/pdp11/pdp11.md (movmemhi): Adjust operand numbers to
>> match_scratch operand is highest.
>>
>> diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c
>> index 89567f7..e5044ba 100644
>> --- a/gcc/config/riscv/riscv.c
>> +++ b/gcc/config/riscv/riscv.c
>> @@ -2089,13 +2089,13 @@ riscv_emit_float_compare (enum rtx_code *code, rtx *op0, rtx *op1)
>>
>> case UNLT:
>> std::swap (cmp_op0, cmp_op1);
>> - /* Fall through. */
>> + __attribute__((fallthrough));
>>
>> UNORDERED_COMPARISON(UNGT, le)
>>
>> case UNLE:
>> std::swap (cmp_op0, cmp_op1);
>> - /* Fall through. */
>> + __attribute__((fallthrough));
>>
>> UNORDERED_COMPARISON(UNGE, lt)
>> #undef UNORDERED_COMPARISON
>
> Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: FIx riscv port building with the trunk
2017-03-14 3:01 ` Kito Cheng
@ 2017-03-14 3:52 ` Palmer Dabbelt
0 siblings, 0 replies; 4+ messages in thread
From: Palmer Dabbelt @ 2017-03-14 3:52 UTC (permalink / raw)
To: kito.cheng; +Cc: law, gcc-patches
Thanks Kito -- this had broken my build too, I'd just gotten distracted by
another bug and had forgotten to commit it. It's now in as
commit 6ca48c85b40db96f01d49f37afb19100b4a6b75b
Author: palmer <palmer@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue Mar 14 03:51:24 2017 +0000
Use gcc_fallthrough() instead of __attribute__((fallthrough)
Without this my build breaks on older compilers like GCC-5.4.
gcc/ChangeLog:
2017-03-13 Kito Cheng <kito.cheng@gmail.com>
* config/riscv/riscv.c (riscv_emit_float_compare>: Use
gcc_fallthrough() instead of __attribute__((fallthrough));
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246116 138bc75d-0d04-0410-961f-82ee72b054a4
On Mon, 13 Mar 2017 20:00:36 PDT (-0700), kito.cheng@gmail.com wrote:
> Hi Jeff:
>
> It's make older gcc version can't build RISC-V port, how about use
> gcc_fallthrough instead?
>
> diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c
> index f4c1f23..d1af07f5 100644
> --- a/gcc/config/riscv/riscv.c
> +++ b/gcc/config/riscv/riscv.c
> @@ -2089,13 +2089,13 @@ riscv_emit_float_compare (enum rtx_code *code,
> rtx *op0, rtx *op1)
>
> case UNLT:
> std::swap (cmp_op0, cmp_op1);
> - __attribute__((fallthrough));
> + gcc_fallthrough ();
>
> UNORDERED_COMPARISON(UNGT, le)
>
> case UNLE:
> std::swap (cmp_op0, cmp_op1);
> - __attribute__((fallthrough));
> + gcc_fallthrough ();
>
> UNORDERED_COMPARISON(UNGE, lt)
> #undef UNORDERED_COMPARISON
>
> On Tue, Mar 14, 2017 at 2:22 AM, Palmer Dabbelt <palmer@dabbelt.com> wrote:
>> On Mon, 13 Mar 2017 10:50:28 PDT (-0700), law@redhat.com wrote:
>>>
>>> RISCV targets were failing to build due to implicit-fallthru warnings.
>>>
>>> This changes comments which indicated expected fallthru to use the
>>> attribute and the port builds again. I assume something about the use
>>> of the cpp macro is causing the comment to not have the intended effect.
>>> I didn't dig into that. Nor did I try to change all the fallthru
>>> comments to use the attribute -- just the two that implicit-fallthru was
>>> complaining about.
>>>
>>> Verified that after this patch the two riscv targets build. Installed
>>> on the trunk.
>>>
>>> Jeff
>>>
>>> commit 448373f1f2912228dc72605fb6f3343fd57023ee
>>> Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
>>> Date: Mon Mar 13 17:49:40 2017 +0000
>>>
>>> * config/riscv/riscv.c (riscv_emit_float_compare): Use fallthru
>>> attribute rather than comments.
>>>
>>> git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246101 138bc75d-0d04-0410-961f-82ee72b054a4
>>>
>>> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
>>> index 124dca3..e863cdf 100644
>>> --- a/gcc/ChangeLog
>>> +++ b/gcc/ChangeLog
>>> @@ -1,5 +1,8 @@
>>> 2017-03-13 Jeff Law <law@redhat.com>
>>>
>>> + * config/riscv/riscv.c (riscv_emit_float_compare): Use fallthru
>>> + attribute rather than comments.
>>> +
>>> * config/pdp11/pdp11.md (movmemhi): Adjust operand numbers to
>>> match_scratch operand is highest.
>>>
>>> diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c
>>> index 89567f7..e5044ba 100644
>>> --- a/gcc/config/riscv/riscv.c
>>> +++ b/gcc/config/riscv/riscv.c
>>> @@ -2089,13 +2089,13 @@ riscv_emit_float_compare (enum rtx_code *code, rtx *op0, rtx *op1)
>>>
>>> case UNLT:
>>> std::swap (cmp_op0, cmp_op1);
>>> - /* Fall through. */
>>> + __attribute__((fallthrough));
>>>
>>> UNORDERED_COMPARISON(UNGT, le)
>>>
>>> case UNLE:
>>> std::swap (cmp_op0, cmp_op1);
>>> - /* Fall through. */
>>> + __attribute__((fallthrough));
>>>
>>> UNORDERED_COMPARISON(UNGE, lt)
>>> #undef UNORDERED_COMPARISON
>>
>> Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-14 3:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13 17:50 FIx riscv port building with the trunk Jeff Law
2017-03-13 18:22 ` Palmer Dabbelt
2017-03-14 3:01 ` Kito Cheng
2017-03-14 3:52 ` Palmer Dabbelt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).