public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: Handle POINTER_PLUS_EXPR in jump functions
Date: Thu, 15 Oct 2020 10:24:36 +0200	[thread overview]
Message-ID: <20201015082436.GV2176@tucnak> (raw)
In-Reply-To: <20201014134033.GD21544@kam.mff.cuni.cz>

On Wed, Oct 14, 2020 at 03:40:33PM +0200, Jan Hubicka wrote:
> this patch adds logic to handle POINTER_PLUS_EXPR in compute_parm_map
> that I originally did not since I tought that all such adjustments are
> done by ancestor function.
> 
> Bootstrapped/regtested x86_64-linux, will commit it shortly.
> Honza
> 
> gcc/ChangeLog:
> 
> 2020-10-14  Jan Hubicka  <hubicka@ucw.cz>
> 
> 	* ipa-modref.c (compute_parm_map): Handle POINTER_PLUS_EXPR in
> 	PASSTHROUGH.
> 
> gcc/testsuite/ChangeLog:
> 
> 2020-10-14  Jan Hubicka  <hubicka@ucw.cz>
> 
> 	* gcc.dg/ipa/modref-1.c: New test.
> 	* gcc.dg/tree-ssa/modref-4.c: New test.

Both of these tests FAIL everywhere:
FAIL: gcc.dg/ipa/modref-1.c (test for excess errors)
FAIL: gcc.dg/ipa/modref-1.c scan-ipa-dump modref "param offset: 1"
FAIL: gcc.dg/ipa/modref-1.c scan-ipa-dump modref "param offset: 2"
FAIL: gcc.dg/tree-ssa/modref-4.c (test for excess errors)
FAIL: gcc.dg/tree-ssa/modref-4.c scan-tree-dump modref1 "param offset: 1"
UNRESOLVED: gcc.dg/tree-ssa/modref-4.c scan-tree-dump modref2 "param offset: 2"
UNRESOLVED: gcc.dg/tree-ssa/modref-4.c scan-tree-dump modref2 "return 0"

I've tried to fix most of things, but
FAIL: gcc.dg/tree-ssa/modref-4.c scan-tree-dump modref1 "return 0"
remains (it isn't even optimized in optimized dump).

Committed to trunk as obvious anyway, but please tweak the modref-4.c
test according to what you meant.

2020-10-15  Jakub Jelinek  <jakub@redhat.com>

	* gcc.dg/ipa/modref-1.c: Remove space between param offset: and number
	in scan-ipa-dump.
	(b): Declare return type to void.
	(main): Declare return type to int.  Change c to array of 3 chars.
	* gcc.dg/tree-ssa/modref-4.c: Remove space between param offset: and
	number in scan-ipa-dump.  Use modref1 instead of modref2.
	(b): Declare return type to void.
	(main): Declare return type to int.  Change c to array of 3 chars.

--- gcc/testsuite/gcc.dg/ipa/modref-1.c.jj	2020-10-14 17:03:00.302245922 +0200
+++ gcc/testsuite/gcc.dg/ipa/modref-1.c	2020-10-15 10:13:43.044535887 +0200
@@ -8,16 +8,17 @@ void a(char *ptr, char *ptr2)
 }
 
 __attribute__((noinline))
-b(char *ptr)
+void b(char *ptr)
 {
   a(ptr+1,&ptr[2]);
 }
-main()
+
+int main()
 {
-  char c[2]={0,1,0};
+  char c[3]={0,1,0};
   b(c);
   return c[0]+c[2];
 }
 /* Check that both param offsets are determined correctly.  */
-/* { dg-final { scan-ipa-dump "param offset: 1" "modref"  } } */
-/* { dg-final { scan-ipa-dump "param offset: 2" "modref"  } } */
+/* { dg-final { scan-ipa-dump "param offset:1" "modref"  } } */
+/* { dg-final { scan-ipa-dump "param offset:2" "modref"  } } */
--- gcc/testsuite/gcc.dg/tree-ssa/modref-4.c.jj	2020-10-14 17:03:00.333245482 +0200
+++ gcc/testsuite/gcc.dg/tree-ssa/modref-4.c	2020-10-15 10:12:14.039825998 +0200
@@ -8,18 +8,19 @@ void a(char *ptr, char *ptr2)
 }
 
 __attribute__((noinline))
-b(char *ptr)
+void b(char *ptr)
 {
   a(ptr+1,&ptr[2]);
 }
-main()
+
+int main()
 {
-  char c[2]={0,1,0};
+  char c[3]={0,1,0};
   b(c);
   return c[0]+c[2];
 }
 /* Check that both param offsets are determined correctly and the computation
    is optimized out.  */
-/* { dg-final { scan-tree-dump "param offset: 1" "modref1"  } } */
-/* { dg-final { scan-tree-dump "param offset: 2" "modref2"  } } */
-/* { dg-final { scan-tree-dump "return 0" "modref2"  } } */
+/* { dg-final { scan-tree-dump "param offset:1" "modref1"  } } */
+/* { dg-final { scan-tree-dump "param offset:2" "modref1"  } } */
+/* { dg-final { scan-tree-dump "return 0" "modref1"  } } */

	Jakub


  reply	other threads:[~2020-10-15  8:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14 13:40 Jan Hubicka
2020-10-15  8:24 ` Jakub Jelinek [this message]
2020-10-15 12:39   ` Jan Hubicka
2020-10-15 12:49     ` Jakub Jelinek
2020-10-16 10:27       ` Jan Hubicka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201015082436.GV2176@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).