public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Alan Modra <amodra@bigpond.net.au> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: optimization/6233: simple loop miscompilation Date: Tue, 09 Apr 2002 04:36:00 -0000 [thread overview] Message-ID: <20020409113602.6369.qmail@sources.redhat.com> (raw) The following reply was made to PR optimization/6233; it has been noted by GNATS. From: Alan Modra <amodra@bigpond.net.au> To: gcc-gnats@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org Subject: Re: optimization/6233: simple loop miscompilation Date: Tue, 9 Apr 2002 20:57:35 +0930 This patch cures PR6233. gcc/ChangeLog * alias.c (nonlocal_referenced_p): Make global. * tree.h (nonlocal_referenced_p): Declare. * loop.c (prescan_loop): Set has_nonconst_call for pure functions. -- Alan Modra IBM OzLabs - Linux Technology Centre Index: gcc/alias.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/alias.c,v retrieving revision 1.169 diff -u -p -r1.169 alias.c --- gcc/alias.c 4 Apr 2002 22:48:16 -0000 1.169 +++ gcc/alias.c 9 Apr 2002 10:55:06 -0000 @@ -112,7 +112,6 @@ static int write_dependence_p static int nonlocal_mentioned_p_1 PARAMS ((rtx *, void *)); static int nonlocal_mentioned_p PARAMS ((rtx)); static int nonlocal_referenced_p_1 PARAMS ((rtx *, void *)); -static int nonlocal_referenced_p PARAMS ((rtx)); static int nonlocal_set_p_1 PARAMS ((rtx *, void *)); static int nonlocal_set_p PARAMS ((rtx)); @@ -2455,7 +2454,7 @@ nonlocal_referenced_p_1 (loc, data) /* Returns non-zero if X might reference something which is not local to the function and is not constant. */ -static int +int nonlocal_referenced_p (x) rtx x; { Index: gcc/loop.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/loop.c,v retrieving revision 1.394 diff -u -p -r1.394 loop.c --- gcc/loop.c 3 Apr 2002 07:56:44 -0000 1.394 +++ gcc/loop.c 9 Apr 2002 10:55:27 -0000 @@ -2493,6 +2493,8 @@ prescan_loop (loop) loop_info->unknown_address_altered = 1; loop_info->has_nonconst_call = 1; } + else if (nonlocal_referenced_p (insn)) + loop_info->has_nonconst_call = 1; loop_info->has_call = 1; if (can_throw_internal (insn)) loop_info->has_multiple_exit_targets = 1; Index: gcc/tree.h =================================================================== RCS file: /cvs/gcc/gcc/gcc/tree.h,v retrieving revision 1.327 diff -u -p -r1.327 tree.h --- gcc/tree.h 4 Apr 2002 22:19:38 -0000 1.327 +++ gcc/tree.h 9 Apr 2002 10:55:30 -0000 @@ -2815,6 +2815,7 @@ extern int alias_sets_conflict_p PARAMS HOST_WIDE_INT)); extern int readonly_fields_p PARAMS ((tree)); extern int objects_must_conflict_p PARAMS ((tree, tree)); +extern int nonlocal_referenced_p PARAMS ((rtx)); struct obstack;
next reply other threads:[~2002-04-09 11:36 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-04-09 4:36 Alan Modra [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-04-09 19:06 Richard Henderson 2002-04-09 18:06 Alan Modra 2002-04-09 17:46 Richard Henderson 2002-04-09 17:06 Alan Modra 2002-04-09 9:46 Richard Henderson 2002-04-09 6:46 Alan Modra 2002-04-08 21:36 amodra
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=20020409113602.6369.qmail@sources.redhat.com \ --to=amodra@bigpond.net.au \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@gcc.gnu.org \ /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: linkBe 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).