public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/92860] [9/10/11/12 regression] Global flags affected by -O settings are clobbered by optimize attribute
Date: Fri, 02 Jul 2021 07:48:30 +0000	[thread overview]
Message-ID: <bug-92860-4-MkHc7aHa19@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-92860-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #57 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to David Binderman from comment #56)
> (In reply to Martin Liška from comment #55)
> > > 
> > > with line numbers please :)
> > 
> > cat -n can do that
> 
> Sorry, I went a bit hard-of-thinking there. 
> 
>  13029  void
>  13030  cl_optimization_compare (gcc_options *ptr1, gcc_options *ptr2)
>  13031  {
>  13032    if (ptr1->x_help_flag != ptr2->x_help_flag)
>  13033      internal_error ("%<global_options%> are modified in local
> context");
>  13034    if (ptr1->x_no_sysroot_suffix != ptr2->x_no_sysroot_suffix)
>  13035      internal_error ("%<global_options%> are modified in local
> context");
>  13036    if (ptr1->x_param_align_loop_iterations !=
> ptr2->x_param_align_loop_iterations)
>  13037      internal_error ("%<global_options%> are modified in local
> context");
>  13038    if (ptr1->x_param_align_threshold != ptr2->x_param_align_threshold)
>  13039      internal_error ("%<global_options%> are modified in local
> context");
>  13040    if (ptr1->x_param_analyzer_bb_explosion_factor !=
> ptr2->x_param_analyzer_bb_explosion_factor)
>  13041      internal_error ("%<global_options%> are modified in local
> context");
>  13042    if (ptr1->x_param_analyzer_max_constraints !=
> ptr2->x_param_analyzer_max_constraints)
>  13043      internal_error ("%<global_options%> are modified in local
> context");
> 
> So the first test is failing.

Hm, that's super-weird. It should be 0 for both of them. Can you please build
options-save.c with -O0 and debug it:

(gdb) b cl_optimization_compare
(gdb) p ptr1->x_help_flag
$1 = 0
(gdb) p ptr2->x_help_flag
$2 = 0

and then put a watch for the value that is non-zero:
(gdb) p &ptr1->x_help_flag
$3 = (int *) 0x26c87d0
(gdb) watch *$3
Hardware watchpoint 4: *$3
(gdb) r
Old value = <unreadable>
New value = 0
handle_pragma_push_options (dummy=<optimized out>) at
/home/marxin/Programming/gcc/gcc/c-family/c-pragma.c:1041
1041          *p->saved_global_options = global_options;
(gdb) c

  parent reply	other threads:[~2021-07-02  7:48 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-92860-4@http.gcc.gnu.org/bugzilla/>
2020-03-17 17:06 ` [Bug tree-optimization/92860] [8/9/10 " marxin at gcc dot gnu.org
2020-03-18 10:57 ` marxin at gcc dot gnu.org
2020-04-01  8:08 ` rguenth at gcc dot gnu.org
2020-05-07 11:56 ` [Bug tree-optimization/92860] [8/9/10/11 " jakub at gcc dot gnu.org
2020-05-25 17:30 ` marxin at gcc dot gnu.org
2020-05-29 18:27 ` egallager at gcc dot gnu.org
2020-05-29 19:30 ` segher at gcc dot gnu.org
2020-05-29 21:36 ` egallager at gcc dot gnu.org
2020-06-10  8:07 ` cvs-commit at gcc dot gnu.org
2020-06-10  8:24 ` marxin at gcc dot gnu.org
2020-06-11 10:19 ` dcb314 at hotmail dot com
2020-06-24  7:33 ` marxin at gcc dot gnu.org
2020-06-24  7:41 ` marxin at gcc dot gnu.org
2020-06-24  8:39 ` dcb314 at hotmail dot com
2020-06-24  8:42 ` marxin at gcc dot gnu.org
2020-06-24  8:53 ` dcb314 at hotmail dot com
2020-06-24  8:56 ` marxin at gcc dot gnu.org
2020-06-24  9:27 ` dcb314 at hotmail dot com
2020-06-24  9:29 ` marxin at gcc dot gnu.org
2020-06-24 20:54 ` dcb314 at hotmail dot com
2020-06-25  6:31 ` marxin at gcc dot gnu.org
2020-06-25  6:32 ` marxin at gcc dot gnu.org
2020-06-25  6:54 ` dcb314 at hotmail dot com
2020-06-25  6:59 ` marxin at gcc dot gnu.org
2020-07-06  4:09 ` asolokha at gmx dot com
2020-07-07  7:21 ` marxin at gcc dot gnu.org
2020-07-23  6:51 ` rguenth at gcc dot gnu.org
2020-12-11 10:30 ` marxin at gcc dot gnu.org
2021-03-16 13:45 ` marxin at gcc dot gnu.org
2021-03-16 20:21 ` arnd at linaro dot org
2021-05-04 12:32 ` [Bug tree-optimization/92860] [8/9/10/11/12 " rguenth at gcc dot gnu.org
2021-05-25 12:57 ` [Bug tree-optimization/92860] [9/10/11/12 " cvs-commit at gcc dot gnu.org
2021-07-01  8:54 ` dcb314 at hotmail dot com
2021-07-01  9:11 ` marxin at gcc dot gnu.org
2021-07-01 14:11 ` dcb314 at hotmail dot com
2021-07-01 15:38 ` dcb314 at hotmail dot com
2021-07-01 17:45 ` dcb314 at hotmail dot com
2021-07-01 18:51 ` marxin at gcc dot gnu.org
2021-07-01 19:34 ` dcb314 at hotmail dot com
2021-07-02  4:16 ` marxin at gcc dot gnu.org
2021-07-02  6:30 ` dcb314 at hotmail dot com
2021-07-02  7:04 ` marxin at gcc dot gnu.org
2021-07-02  7:12 ` dcb314 at hotmail dot com
2021-07-02  7:18 ` marxin at gcc dot gnu.org
2021-07-02  7:20 ` marxin at gcc dot gnu.org
2021-07-02  7:35 ` dcb314 at hotmail dot com
2021-07-02  7:48 ` marxin at gcc dot gnu.org [this message]
2021-07-02 20:16 ` dcb314 at hotmail dot com
2021-08-16 11:45 ` marxin at gcc dot gnu.org
2021-12-09 14:02 ` marxin at gcc dot gnu.org
2021-12-09 18:46 ` dcb314 at hotmail dot com
2021-12-09 18:48 ` dcb314 at hotmail dot com
2021-12-10  9:09 ` marxin at gcc dot gnu.org
2021-12-11 21:15 ` dcb314 at hotmail dot com
2021-12-11 22:24 ` dcb314 at hotmail dot com
2021-12-12 12:52 ` dcb314 at hotmail dot com
2021-12-13  6:28 ` asolokha at gmx dot com
2021-12-13 10:04 ` marxin at gcc dot gnu.org
2021-12-13 10:05 ` marxin at gcc dot gnu.org
2021-12-13 10:14 ` dcb314 at hotmail dot com
2021-12-13 12:52 ` marxin at gcc dot gnu.org
2021-12-14  9:35 ` dcb314 at hotmail dot com
2021-12-14 10:01 ` marxin at gcc dot gnu.org
2021-12-14 11:11 ` asolokha at gmx dot com
2021-12-14 14:12 ` dcb314 at hotmail dot com
2021-12-14 15:34 ` marxin at gcc dot gnu.org
2022-01-03 10:26 ` rguenther at suse dot de
2022-01-03 22:22 ` dcb314 at hotmail dot com
2022-01-03 22:32 ` dcb314 at hotmail dot com
2022-01-04  7:43 ` rguenther at suse dot de
2022-01-04  8:35 ` marxin at gcc dot gnu.org
2022-01-04 11:14 ` dcb314 at hotmail dot com
2022-01-04 11:19 ` dcb314 at hotmail dot com
2022-01-04 13:51 ` marxin at gcc dot gnu.org
2022-01-04 13:52 ` marxin at gcc dot gnu.org
2022-01-04 17:27 ` marxin at gcc dot gnu.org
2022-01-04 17:29 ` marxin at gcc dot gnu.org
2022-01-04 17:43 ` marxin at gcc dot gnu.org
2022-01-04 18:43 ` marxin at gcc dot gnu.org
2022-01-04 19:31 ` marxin at gcc dot gnu.org
2022-01-05 14:43 ` marxin at gcc dot gnu.org
2022-01-05 19:14 ` ubizjak at gmail dot com
2022-01-06 14:57 ` dcb314 at hotmail dot com
2024-03-27  0:54 ` pinskia at gcc dot gnu.org

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=bug-92860-4-MkHc7aHa19@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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: 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).