* [Bug target/98585] [11 Regression] target attribute resets cmodel on x86
2021-01-07 17:04 [Bug target/98585] New: [11 Regression] target attribute resets cmodel on x86 law at redhat dot com
@ 2021-01-07 18:27 ` jakub at gcc dot gnu.org
2021-01-07 19:29 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-07 18:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98585
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2021-01-07
Ever confirmed|0 |1
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
Target Milestone|--- |11.0
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'll have a look then.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/98585] [11 Regression] target attribute resets cmodel on x86
2021-01-07 17:04 [Bug target/98585] New: [11 Regression] target attribute resets cmodel on x86 law at redhat dot com
2021-01-07 18:27 ` [Bug target/98585] " jakub at gcc dot gnu.org
@ 2021-01-07 19:29 ` jakub at gcc dot gnu.org
2021-01-07 20:27 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-07 19:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98585
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
r11-3183-gba948b37768c99cd8eb9f5b6fbd45fcf4bd15b78
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/98585] [11 Regression] target attribute resets cmodel on x86
2021-01-07 17:04 [Bug target/98585] New: [11 Regression] target attribute resets cmodel on x86 law at redhat dot com
2021-01-07 18:27 ` [Bug target/98585] " jakub at gcc dot gnu.org
2021-01-07 19:29 ` jakub at gcc dot gnu.org
@ 2021-01-07 20:27 ` jakub at gcc dot gnu.org
2021-01-08 8:28 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-07 20:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98585
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 49916
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49916&action=edit
gcc11-pr98585.patch
Untested fix. The problem is that if we have TargetSave or something without
Save attribute and use it in opts_set->x_* or global_options_set.x_* tests,
the generic code doesn't save/restore those, so either the target save/restore
options hook needs to save/restore not just the options (which it does for some
of them), but also the opts_set-> for that. Either it can do that manually, or
by changing TargetSave to TargetVariable we can just leave to the generic code
to do it for us.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/98585] [11 Regression] target attribute resets cmodel on x86
2021-01-07 17:04 [Bug target/98585] New: [11 Regression] target attribute resets cmodel on x86 law at redhat dot com
` (2 preceding siblings ...)
2021-01-07 20:27 ` jakub at gcc dot gnu.org
@ 2021-01-08 8:28 ` rguenth at gcc dot gnu.org
2021-01-08 11:29 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-08 8:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98585
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
Known to work| |10.2.0
Target| |x86_64-*-* i?86-*-*
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/98585] [11 Regression] target attribute resets cmodel on x86
2021-01-07 17:04 [Bug target/98585] New: [11 Regression] target attribute resets cmodel on x86 law at redhat dot com
` (3 preceding siblings ...)
2021-01-08 8:28 ` rguenth at gcc dot gnu.org
@ 2021-01-08 11:29 ` cvs-commit at gcc dot gnu.org
2021-01-08 11:31 ` jakub at gcc dot gnu.org
2021-01-08 11:32 ` jakub at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-08 11:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98585
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:8f1cb70d7ca6a8da7f6bc7f43fb5e758c0ce88b5
commit r11-6547-g8f1cb70d7ca6a8da7f6bc7f43fb5e758c0ce88b5
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Jan 8 12:28:25 2021 +0100
i386: Fix -mcmodel= vs. target attribute [PR98585]
My patch to save/restore opts_set rather than essentially treating
global_options_set as a logical or whether some option has ever been
explicitly set somewhere apparently broke -mcmodel= vs. target attribute
(and as the patch shows some other options too).
The thing is, at least for options for which we ever test opts_set->x_*
or global_options_set.x_*, we need to save/restore them next to the
saving/restoring of the actual option values.
If an option has Save keyword or in case of TargetVariable, it is the
generic code that handles the saving and restoring of both the option
and corresponding opts_set flag automatically, for other variables
(TargetSave, or Target without Save) the backend needs to do that in the
target hook manually and in that case should save/restore both the option
values (the hooks mostly did that) and opts_set (they didn't).
As it seems much easier to let the automatic saving/restoring do the work
for us unless the saving/restoring of the option needs some specific magic,
the following patch is a result of grepping through the backend for
opts_set->x_ and global_options_set.x_ and for all such referenced
variables, grepping whether it is saved/restored including opts_set
properly
in the generated options-save.c or not.
2021-01-08 Jakub Jelinek <jakub@redhat.com>
PR target/98585
* config/i386/i386.opt (ix86_cmodel,
ix86_incoming_stack_boundary_arg,
ix86_pmode, ix86_preferred_stack_boundary_arg, ix86_regparm,
ix86_veclibabi_type): Remove x_ prefix, use TargetVariable instead
of
TargetSave and initialize for variables with enum types.
(mfentry, mstack-protector-guard-reg=,
mstack-protector-guard-offset=,
mstack-protector-guard-symbol=): Add Save.
* config/i386/i386-options.c (ix86_function_specific_save,
ix86_function_specific_restore): Don't save or restore
x_ix86_cmodel,
x_ix86_incoming_stack_boundary_arg, x_ix86_pmode,
x_ix86_preferred_stack_boundary_arg, x_ix86_regparm,
x_ix86_veclibabi_type.
* gcc.target/i386/pr98585.c: New test.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/98585] [11 Regression] target attribute resets cmodel on x86
2021-01-07 17:04 [Bug target/98585] New: [11 Regression] target attribute resets cmodel on x86 law at redhat dot com
` (4 preceding siblings ...)
2021-01-08 11:29 ` cvs-commit at gcc dot gnu.org
@ 2021-01-08 11:31 ` jakub at gcc dot gnu.org
2021-01-08 11:32 ` jakub at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-08 11:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98585
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/98585] [11 Regression] target attribute resets cmodel on x86
2021-01-07 17:04 [Bug target/98585] New: [11 Regression] target attribute resets cmodel on x86 law at redhat dot com
` (5 preceding siblings ...)
2021-01-08 11:31 ` jakub at gcc dot gnu.org
@ 2021-01-08 11:32 ` jakub at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-08 11:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98585
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
*** Bug 97469 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 8+ messages in thread