public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] : [gcc/config/rs600/rs6000.cc][Fix typo] Add parentheses for if statement
@ 2022-09-07 23:20 Akari Takahashi
  2022-09-08 18:53 ` Akari Takahashi
  2022-09-10 15:26 ` Segher Boessenkool
  0 siblings, 2 replies; 4+ messages in thread
From: Akari Takahashi @ 2022-09-07 23:20 UTC (permalink / raw)
  To: gcc-patches; +Cc: takahashiakari

Hello:
I am very interested in GCC and have joined the FSF membership.
I found a small bug in the latest source code, so I report it.

Patch:
[Fix typo]Add parentheses for if statement in line 18117.
gcc/config/rs600/rs6000.cc

Diff:
----------------------------------
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index bcf634a146d..a656cb32a47 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -18114,7 +18114,7 @@ get_memref_parts (rtx mem, rtx *base,
HOST_WIDE_INT *offset,
                  HOST_WIDE_INT *size)
 {
   rtx addr_rtx;
-  if (MEM_SIZE_KNOWN_P (mem))
+  if MEM_SIZE_KNOWN_P (mem)
     *size = MEM_SIZE (mem);
   else
     return false;
----------------------------------

Takahashi Akari

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] : [gcc/config/rs600/rs6000.cc][Fix typo] Add parentheses for if statement
  2022-09-07 23:20 [PATCH] : [gcc/config/rs600/rs6000.cc][Fix typo] Add parentheses for if statement Akari Takahashi
@ 2022-09-08 18:53 ` Akari Takahashi
  2022-09-10 15:26 ` Segher Boessenkool
  1 sibling, 0 replies; 4+ messages in thread
From: Akari Takahashi @ 2022-09-08 18:53 UTC (permalink / raw)
  To: gcc-patches

Hello:
I sent a pull request. Please review and merge.

Branch name:
patch/rc6000/fixtypo

Log:
commit d55c6c49e0f7760c0b85ee74eb9c2b4e68275a26 (HEAD -> patch/rc6000/fixtypo)
Author: Takahashi Akari <akaritakahashioss@gmail.com>
Date:   Fri Sep 9 03:37:34 2022 +0900

    [Fix typo] Add parentheses for if statement in line 18117.

Diff:
git diff 30c811f2bac73e63e0b461ba7ed3805b77898798
d55c6c49e0f7760c0b85ee74eb9c2b4e68275a26
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index a656cb32a47..bcf634a146d 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -18114,7 +18114,7 @@ get_memref_parts (rtx mem, rtx *base,
HOST_WIDE_INT *offset,
                  HOST_WIDE_INT *size)
 {
   rtx addr_rtx;
-  if MEM_SIZE_KNOWN_P (mem)
+  if (MEM_SIZE_KNOWN_P (mem))
     *size = MEM_SIZE (mem);
   else
     return false;

Takahashi Akari
https://github.com/takahashi-akari
GPG Key: 9DD8 F529 83A0 3182 D318 6184 9309 E8D2 2FD4 4365

On Thu, Sep 8, 2022 at 8:20 AM Akari Takahashi
<akaritakahashioss@gmail.com> wrote:
>
> Hello:
> I am very interested in GCC and have joined the FSF membership.
> I found a small bug in the latest source code, so I report it.
>
> Patch:
> [Fix typo]Add parentheses for if statement in line 18117.
> gcc/config/rs600/rs6000.cc
>
> Diff:
> ----------------------------------
> diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
> index bcf634a146d..a656cb32a47 100644
> --- a/gcc/config/rs6000/rs6000.cc
> +++ b/gcc/config/rs6000/rs6000.cc
> @@ -18114,7 +18114,7 @@ get_memref_parts (rtx mem, rtx *base,
> HOST_WIDE_INT *offset,
>                   HOST_WIDE_INT *size)
>  {
>    rtx addr_rtx;
> -  if (MEM_SIZE_KNOWN_P (mem))
> +  if MEM_SIZE_KNOWN_P (mem)
>      *size = MEM_SIZE (mem);
>    else
>      return false;
> ----------------------------------
>
> Takahashi Akari

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] : [gcc/config/rs600/rs6000.cc][Fix typo] Add parentheses for if statement
  2022-09-07 23:20 [PATCH] : [gcc/config/rs600/rs6000.cc][Fix typo] Add parentheses for if statement Akari Takahashi
  2022-09-08 18:53 ` Akari Takahashi
@ 2022-09-10 15:26 ` Segher Boessenkool
  2022-09-10 16:03   ` Akari Takahashi
  1 sibling, 1 reply; 4+ messages in thread
From: Segher Boessenkool @ 2022-09-10 15:26 UTC (permalink / raw)
  To: Akari Takahashi; +Cc: gcc-patches, takahashiakari

Hi!

Please cc: the rs6000 maintainers on rs6000 patches.

On Thu, Sep 08, 2022 at 08:20:07AM +0900, Akari Takahashi via Gcc-patches wrote:
> --- a/gcc/config/rs6000/rs6000.cc
> +++ b/gcc/config/rs6000/rs6000.cc
> @@ -18114,7 +18114,7 @@ get_memref_parts (rtx mem, rtx *base,
> HOST_WIDE_INT *offset,
>                   HOST_WIDE_INT *size)
>  {
>    rtx addr_rtx;
> -  if (MEM_SIZE_KNOWN_P (mem))
> +  if MEM_SIZE_KNOWN_P (mem)
>      *size = MEM_SIZE (mem);
>    else
>      return false;

This patch is generated backwards.

I committed the following.  Thanks!


Segher


Subject: [PATCH] rs6000: Make an "if" statement more regular

As Akari noticed, we have an unusual "if" statement without parentheses
around the condition.  The condition is a macro that expands to
something with parentheses in the right spot, but, let's make the code a
little less surprising :-)


2022-09-10  Akari Takahashi  <akaritakahashioss@gmail.com>
	    Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.cc (get_memref_parts): Regularize some code.
---
 gcc/config/rs6000/rs6000.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index a656cb32a472..bcf634a146de 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -18114,7 +18114,7 @@ get_memref_parts (rtx mem, rtx *base, HOST_WIDE_INT *offset,
 		  HOST_WIDE_INT *size)
 {
   rtx addr_rtx;
-  if MEM_SIZE_KNOWN_P (mem)
+  if (MEM_SIZE_KNOWN_P (mem))
     *size = MEM_SIZE (mem);
   else
     return false;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] : [gcc/config/rs600/rs6000.cc][Fix typo] Add parentheses for if statement
  2022-09-10 15:26 ` Segher Boessenkool
@ 2022-09-10 16:03   ` Akari Takahashi
  0 siblings, 0 replies; 4+ messages in thread
From: Akari Takahashi @ 2022-09-10 16:03 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-patches, takahashiakari

Hi, Segher!

I'd like to thank you from the bottom of my heart !
I was happy to see my name listed in the github repository as well.

This will motivate me to do my best to commit more to GCC.. :)

Best Regards,

Takahashi Akari
https://github.com/takahashi-akari
GPG Key: 9DD8 F529 83A0 3182 D318 6184 9309 E8D2 2FD4 4365

On Sun, Sep 11, 2022 at 12:28 AM Segher Boessenkool
<segher@kernel.crashing.org> wrote:
>
> Hi!
>
> Please cc: the rs6000 maintainers on rs6000 patches.
>
> On Thu, Sep 08, 2022 at 08:20:07AM +0900, Akari Takahashi via Gcc-patches wrote:
> > --- a/gcc/config/rs6000/rs6000.cc
> > +++ b/gcc/config/rs6000/rs6000.cc
> > @@ -18114,7 +18114,7 @@ get_memref_parts (rtx mem, rtx *base,
> > HOST_WIDE_INT *offset,
> >                   HOST_WIDE_INT *size)
> >  {
> >    rtx addr_rtx;
> > -  if (MEM_SIZE_KNOWN_P (mem))
> > +  if MEM_SIZE_KNOWN_P (mem)
> >      *size = MEM_SIZE (mem);
> >    else
> >      return false;
>
> This patch is generated backwards.
>
> I committed the following.  Thanks!
>
>
> Segher
>
>
> Subject: [PATCH] rs6000: Make an "if" statement more regular
>
> As Akari noticed, we have an unusual "if" statement without parentheses
> around the condition.  The condition is a macro that expands to
> something with parentheses in the right spot, but, let's make the code a
> little less surprising :-)
>
>
> 2022-09-10  Akari Takahashi  <akaritakahashioss@gmail.com>
>             Segher Boessenkool  <segher@kernel.crashing.org>
>
>         * config/rs6000/rs6000.cc (get_memref_parts): Regularize some code.
> ---
>  gcc/config/rs6000/rs6000.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
> index a656cb32a472..bcf634a146de 100644
> --- a/gcc/config/rs6000/rs6000.cc
> +++ b/gcc/config/rs6000/rs6000.cc
> @@ -18114,7 +18114,7 @@ get_memref_parts (rtx mem, rtx *base, HOST_WIDE_INT *offset,
>                   HOST_WIDE_INT *size)
>  {
>    rtx addr_rtx;
> -  if MEM_SIZE_KNOWN_P (mem)
> +  if (MEM_SIZE_KNOWN_P (mem))
>      *size = MEM_SIZE (mem);
>    else
>      return false;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-10 16:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 23:20 [PATCH] : [gcc/config/rs600/rs6000.cc][Fix typo] Add parentheses for if statement Akari Takahashi
2022-09-08 18:53 ` Akari Takahashi
2022-09-10 15:26 ` Segher Boessenkool
2022-09-10 16:03   ` Akari Takahashi

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).