public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rdsandiford@googlemail.com>
To: Aldy Hernandez <aldyh@redhat.com>
Cc: Jakub Jelinek <jakub@redhat.com>,  gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: PR target/52555: attribute optimize is overriding command line options
Date: Tue, 12 Feb 2013 17:48:00 -0000	[thread overview]
Message-ID: <874nhhwhvi.fsf@talisman.default> (raw)
In-Reply-To: <511A7BBF.1030401@redhat.com> (Aldy Hernandez's message of "Tue,	12 Feb 2013 11:28:31 -0600")

Aldy Hernandez <aldyh@redhat.com> writes:
>> Rather than:
>>
>> 	  /* Change optabs if needed.  */
>> 	  if (TREE_OPTIMIZATION_OPTABS (opts))
>> 	    this_target_optabs
>> 	      = (struct target_optabs *) TREE_OPTIMIZATION_OPTABS (opts);
>> 	  else
>> 	    this_target_optabs = &default_target_optabs;
>>
>> I think it'd be better to have:
>>
>> 	  /* Change optabs if needed.  */
>> 	  if (TREE_OPTIMIZATION_OPTABS (opts))
>> 	    this_fn_optabs
>> 	      = (struct target_optabs *) TREE_OPTIMIZATION_OPTABS (opts);
>> 	  else
>> 	    this_fn_optabs = this_target_optabs;
>>
>> with genopinit.c updated to use this_fn_optabs instead of this_target_optabs.
>
> Hmmm, ok.
>
> I also added a default case setting this_fn_optabs = 
> &default_target_optabs when the optimizations haven't changed.  I can 
> remove this if redundant.

No, sounds like a good plan, but I think it should be this_target_optabs
rather than &default_target_optabs.  Also:

@@ -76,11 +76,8 @@ struct target_optabs {
 };
 
 extern struct target_optabs default_target_optabs;
-#if SWITCHABLE_TARGET
 extern struct target_optabs *this_target_optabs;
-#else
-#define this_target_optabs (&default_target_optabs)
-#endif

This shouldn't be needed now, and:

@@ -44,8 +44,9 @@ along with GCC; see the file COPYING3.  If not see
 
 struct target_optabs default_target_optabs;
 struct target_libfuncs default_target_libfuncs;
-#if SWITCHABLE_TARGET
 struct target_optabs *this_target_optabs = &default_target_optabs;
+struct target_optabs *this_fn_optabs = &default_target_optabs;
+#if SWITCHABLE_TARGET
 struct target_libfuncs *this_target_libfuncs = &default_target_libfuncs;
 #endif

I think this should be:

 struct target_optabs default_target_optabs;
 struct target_libfuncs default_target_libfuncs;
+struct target_optabs *this_fn_optabs = &default_target_optabs;
 #if SWITCHABLE_TARGET
 struct target_optabs *this_target_optabs = &default_target_optabs;
 struct target_libfuncs *this_target_libfuncs = &default_target_libfuncs;
 #endif

Looks good to me otherwise as far as switchable targets go.

Richard

  reply	other threads:[~2013-02-12 17:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-12  0:15 Aldy Hernandez
2013-02-12 14:05 ` Jakub Jelinek
2013-02-12 15:58   ` Aldy Hernandez
2013-02-12 16:16     ` Jakub Jelinek
2013-02-12 16:30   ` Richard Sandiford
2013-02-12 17:28     ` Aldy Hernandez
2013-02-12 17:48       ` Richard Sandiford [this message]
2013-02-12 17:46         ` Richard Sandiford
2013-02-13 17:39         ` Aldy Hernandez
2013-02-13 17:58           ` Richard Sandiford
2013-02-13 18:08             ` Aldy Hernandez
2013-02-13 19:54               ` Jakub Jelinek
2013-02-15 17:23                 ` Aldy Hernandez
2013-02-15 17:35                   ` Jakub Jelinek
2013-02-15 17:52                     ` Aldy Hernandez
2013-02-16 11:20                   ` Richard Sandiford
2013-02-18 18:51                     ` Aldy Hernandez
2013-02-18 23:05                       ` Jakub Jelinek
2013-02-21 23:03                         ` Steve Ellcey
2013-02-22  0:10                           ` Aldy Hernandez
2013-02-22 10:03                           ` Jakub Jelinek
2013-02-22 17:32                             ` Steve Ellcey
2013-02-22 18:17                               ` Jakub Jelinek
2013-02-22 19:49                                 ` Richard Sandiford
2013-03-01 23:37                             ` Steve Ellcey

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=874nhhwhvi.fsf@talisman.default \
    --to=rdsandiford@googlemail.com \
    --cc=aldyh@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /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).