From: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org, Richard Biener <rguenther@suse.de>,
Richard Earnshaw <Richard.Earnshaw@foss.arm.com>,
"Joseph S. Myers" <joseph@codesourcery.com>
Subject: Re: [PATCH] options: Save and restore opts_set for Optimization and Target options
Date: Wed, 30 Sep 2020 13:21:44 +0200 [thread overview]
Message-ID: <20200930112144.GA97062@localhost.localdomain> (raw)
In-Reply-To: <20200930093255.GK2176@tucnak>
On Wed, Sep 30, 2020 at 11:32:55AM +0200, Jakub Jelinek wrote:
> On Mon, Sep 28, 2020 at 09:50:00PM +0200, Stefan Schulze Frielinghaus via Gcc-patches wrote:
> > This patch breaks quite a view test cases (target-attribute/tattr-*) on
> > IBM Z. Having a look at function cl_target_option_restore reveals that
> > some members of opts_set are reduced to 1 or 0 depending on whether a
> > member was set before or not, e.g. for target_flags we have
>
> I've tried to reproduce the tattr FAILs reported in
> https://gcc.gnu.org/pipermail/gcc-testresults/2020-September/608760.html
> in a cross-compiler (with
> #define HAVE_AS_MACHINE_MACHINEMODE 1
> ), but couldn't, neither the ICEs nor the scan-assembler failures.
> Anyway, could you do a side-by-side debugging of one of those failures
> before/after my change and see what behaves differently?
I think the problem boils down that on S/390 we distinguish between four
states of a flag: explicitely set to yes/no and implicitely set to
yes/no. If set explicitely, the option wins. For example, the options
`-march=z10 -mhtm` should enable the hardware transactional memory
option although z10 does not have one. In the past if a flag was set or
not explicitely was encoded into opts_set->x_target_flags ... for each
flag individually, e.g. TARGET_OPT_HTM_P (opts_set->x_target_flags) was
used. This has changed with the mentioned patch in the sense that
opts_set encodes whether any flag of x_target_flags was set or not but
not which individual one after a call to the generated function
cl_target_option_restore where we have:
opts_set->x_target_flags = (mask & 1) != 0;
Compiling the following program
#pragma GCC target ("arch=z10")
void fn_pragma_0 (void) { }
with options `-march=z13 -mzarch -mhtm -mdebug` produces different flags
for 4ac7b669580 (commit prior your patch) and ba948b37768 (your patch).
This is my current understanding of the option handling. I will try to
come up with a trace where these things become hopefully more clear.
Cheers,
Stefan
next prev parent reply other threads:[~2020-09-30 11:21 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-08 8:45 [PATCH] arm: Fix up arm_override_options_after_change [PR96939] Jakub Jelinek
2020-09-08 22:01 ` Jeff Law
2020-09-10 8:51 ` [PATCH] arm: Fix up arm_override_options_after_change_1 Jakub Jelinek
2020-09-10 14:11 ` Kyrylo Tkachov
2020-09-10 14:58 ` Jeff Law
2020-09-10 15:01 ` Jakub Jelinek
2020-09-10 15:04 ` Kyrylo Tkachov
2020-09-11 7:46 ` [PATCH] arm: Fix up arm_override_options_after_change [PR96939] Christophe Lyon
2020-09-11 9:29 ` Jakub Jelinek
2020-09-13 8:29 ` [PATCH] options: Save and restore opts_set for Optimization and Target options Jakub Jelinek
2020-09-14 6:32 ` Richard Biener
2020-09-14 8:06 ` Christophe Lyon
2020-09-28 19:50 ` Stefan Schulze Frielinghaus
2020-09-28 19:58 ` Jakub Jelinek
2020-09-30 9:32 ` Jakub Jelinek
2020-09-30 11:21 ` Stefan Schulze Frielinghaus [this message]
2020-09-30 11:39 ` Jakub Jelinek
2020-09-30 13:24 ` Stefan Schulze Frielinghaus
2020-10-02 8:46 ` Jakub Jelinek
2020-10-02 14:21 ` Stefan Schulze Frielinghaus
2020-10-03 8:41 ` Jakub Jelinek
2020-10-03 18:02 ` Richard Biener
2020-10-04 7:13 ` Andreas Schwab
2020-10-04 19:16 ` Jakub Jelinek
2020-10-05 7:08 ` Jakub Jelinek
2020-10-05 7:10 ` Richard Biener
2020-10-06 9:28 ` Andreas Schwab
2020-10-06 13:20 ` [PATCH] options: Avoid unused variable mask warning [PR97305] Jakub Jelinek
2020-10-06 13:32 ` Richard Biener
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=20200930112144.GA97062@localhost.localdomain \
--to=stefansf@linux.ibm.com \
--cc=Richard.Earnshaw@foss.arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=joseph@codesourcery.com \
--cc=rguenther@suse.de \
/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).