public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] gcc: m68k: fix PR target/107645
@ 2022-11-11 19:43 Max Filippov
  2022-11-12 19:42 ` Jeff Law
  0 siblings, 1 reply; 5+ messages in thread
From: Max Filippov @ 2022-11-11 19:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jeff Law, Andreas Schwab, Max Filippov

gcc/
	PR target/107645
	* config/m68k/predicates.md (symbolic_operand): Return false
	when UNSPEC is under the CONST node.
---
Regtested with --enable-checking=all for target=m68k-linux-uclibc, no
new regressions compared to the compiler built without checking.
Ok for master?

 gcc/config/m68k/predicates.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/config/m68k/predicates.md b/gcc/config/m68k/predicates.md
index f8dedd9f8375..094a18955534 100644
--- a/gcc/config/m68k/predicates.md
+++ b/gcc/config/m68k/predicates.md
@@ -141,6 +141,8 @@
 
     case CONST:
       op = XEXP (op, 0);
+      if (GET_CODE (op) == UNSPEC)
+        return false;
       return ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
 	       || GET_CODE (XEXP (op, 0)) == LABEL_REF)
 	      && GET_CODE (XEXP (op, 1)) == CONST_INT);
-- 
2.30.2


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

* Re: [PATCH] gcc: m68k: fix PR target/107645
  2022-11-11 19:43 [PATCH] gcc: m68k: fix PR target/107645 Max Filippov
@ 2022-11-12 19:42 ` Jeff Law
  2022-11-13  3:47   ` Max Filippov
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Law @ 2022-11-12 19:42 UTC (permalink / raw)
  To: Max Filippov, gcc-patches; +Cc: Andreas Schwab


On 11/11/22 12:43, Max Filippov wrote:
> gcc/
> 	PR target/107645
> 	* config/m68k/predicates.md (symbolic_operand): Return false
> 	when UNSPEC is under the CONST node.

Isn't the underlying object still symbolic though, thus returning false 
seems wrong.

insn 342 341 343 35 (set (reg:SI 97)
         (mem/u:SI (plus:SI (reg:SI 13 %a5)
                 (const:SI (unspec:SI [
                             (symbol_ref:SI 
("__gcov_kvp_dynamic_pool_index") [flags 0x40]  <var_decl 0x7f9e83fe7cf0 
__gcov_kvp_dynamic_pool_index>)
                             (const_int 0 [0])
                         ] 6))) [0  S4 A8])) 
"gcc/libgcc/libgcov.h":472:44 55 {*movsi_m68k2}
      (expr_list:REG_EQUAL (symbol_ref:SI 
("__gcov_kvp_dynamic_pool_index") [flags 0x40]  <var_decl 0x7f9e83fe7cf0 
__gcov_kvp_dynamic_pool_index>)
         (nil)))


ISTM that we'd need to strip the unspec and process its argument 
instead.  But maybe I'm missing something.


jeff



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

* Re: [PATCH] gcc: m68k: fix PR target/107645
  2022-11-12 19:42 ` Jeff Law
@ 2022-11-13  3:47   ` Max Filippov
  2022-11-16  3:33     ` Jeff Law
  0 siblings, 1 reply; 5+ messages in thread
From: Max Filippov @ 2022-11-13  3:47 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches, Andreas Schwab

On Sat, Nov 12, 2022 at 11:42 AM Jeff Law <jeffreyalaw@gmail.com> wrote:
> ISTM that we'd need to strip the unspec and process its argument
> instead.

I tried that first, the result was more ICEs because that pattern
wasn't recognized at later stages. Then I read the change to the
comment over the symbolic_operand predicate:
https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/config/m68k/predicates.md;h=6ca261fb92a2b7ecd53a0356d06410e2c0d70965;hp=417989f6d6c408fa82af9f9649a204b9a754d1dc;hb=75df395f15f2;hpb=676fd528c9990a4f1046b51d40059893c3a71490
and that made me think that the intention was to not recognize
the unspecs in that predicate.

-- 
Thanks.
-- Max

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

* Re: [PATCH] gcc: m68k: fix PR target/107645
  2022-11-13  3:47   ` Max Filippov
@ 2022-11-16  3:33     ` Jeff Law
  2022-11-16 12:37       ` Max Filippov
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Law @ 2022-11-16  3:33 UTC (permalink / raw)
  To: Max Filippov; +Cc: gcc-patches, Andreas Schwab


On 11/12/22 20:47, Max Filippov wrote:
> On Sat, Nov 12, 2022 at 11:42 AM Jeff Law <jeffreyalaw@gmail.com> wrote:
>> ISTM that we'd need to strip the unspec and process its argument
>> instead.
> I tried that first, the result was more ICEs because that pattern
> wasn't recognized at later stages. Then I read the change to the
> comment over the symbolic_operand predicate:
> https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/config/m68k/predicates.md;h=6ca261fb92a2b7ecd53a0356d06410e2c0d70965;hp=417989f6d6c408fa82af9f9649a204b9a754d1dc;hb=75df395f15f2;hpb=676fd528c9990a4f1046b51d40059893c3a71490
> and that made me think that the intention was to not recognize
> the unspecs in that predicate.

Thanks for clarifying.  ISTM that operand predicate is quite poorly named.


OK for the trunk.


jeff


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

* Re: [PATCH] gcc: m68k: fix PR target/107645
  2022-11-16  3:33     ` Jeff Law
@ 2022-11-16 12:37       ` Max Filippov
  0 siblings, 0 replies; 5+ messages in thread
From: Max Filippov @ 2022-11-16 12:37 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches, Andreas Schwab

On Tue, Nov 15, 2022 at 7:33 PM Jeff Law <jeffreyalaw@gmail.com> wrote:
> Thanks for clarifying.  ISTM that operand predicate is quite poorly named.
>
> OK for the trunk.

Thanks. Applied to master.

-- Max

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

end of thread, other threads:[~2022-11-16 12:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-11 19:43 [PATCH] gcc: m68k: fix PR target/107645 Max Filippov
2022-11-12 19:42 ` Jeff Law
2022-11-13  3:47   ` Max Filippov
2022-11-16  3:33     ` Jeff Law
2022-11-16 12:37       ` Max Filippov

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