public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/104303] New: [12 regression] gnatmake is miscompiled by IPA/modef
@ 2022-01-31 10:09 ebotcazou at gcc dot gnu.org
  2022-01-31 10:12 ` [Bug ipa/104303] [12 regression] gnatmake is miscompiled by IPA/modref pinskia at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2022-01-31 10:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104303
           Summary: [12 regression] gnatmake is miscompiled by IPA/modef
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ebotcazou at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 52315
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52315&action=edit
Cocatenated  testcase

The build is done at -O2 but the miscompilation already occurs at -O1 since:

2021-12-14  Jan Hubicka  <hubicka@ucw.cz>

        PR ipa/103585
        * ipa-modref-tree.c (modref_access_node::range_info_useful_p): Handle
        MODREF_GLOBAL_MEMORY_PARM.
        (modref_access_node::dump): Likewise.
        (modref_access_node::get_call_arg): Likewise.
        * ipa-modref-tree.h (enum modref_special_parms): Add
        MODREF_GLOBAL_MEMORY_PARM.
        (modref_access_node::useful_for_kill): Handle
        MODREF_GLOBAL_MEMORY_PARM.
        (modref:tree::merge): Add promote_unknown_to_global.
        * ipa-modref.c (verify_arg):New function.
        (may_access_nonescaping_parm_p): New function.
        (modref_access_analysis::record_global_memory_load): New member
        function.
        (modref_access_analysis::record_global_memory_store): Likewise.
        (modref_access_analysis::process_fnspec): Distingush global and local
        memory.
        (modref_access_analysis::analyze_call): Likewise.
        * tree-ssa-alias.c (ref_may_access_global_memory_p): New function.
        (modref_may_conflict): Use it.

I have attached a testcase for the gnat.dg testsuite:
  - gnatchop concat5.txt
  - gnatmake concat5 -O && ./concat5
  - gcc -c concat5_pkg1.adb -O -fdump-tree-dse2-details yields:

;; Function concat5_pkg1.scan (concat5_pkg1__scan, funcdef_no=3, decl_uid=4922,
cgraph_uid=2, symbol_order=1)

ipa-modref: call stmt concat5_pkg1.make_failed (D.5010);
ipa-modref: call to Concat5_Pkg1.Make_Failed/0 does not use ref:
D.5010.P_BOUNDS alias sets: 2->4
ipa-modref: call stmt concat5_pkg1.make_failed (D.5010);
ipa-modref: call to Concat5_Pkg1.Make_Failed/0 does not use ref: D.5010.P_ARRAY
alias sets: 2->6
ipa-modref: call stmt concat5_pkg1.make_failed (D.5010);
ipa-modref: call to Concat5_Pkg1.Make_Failed/0 does not use ref:
VIEW_CONVERT_EXPR<character[1:23]>((*S9b.6_22)[_12 ...]{lb: 1 sz: 1}) alias
sets: 8->8
  Deleted dead store: VIEW_CONVERT_EXPR<character[1:23]>((*S9b.6_22)[_12
...]{lb: 1 sz: 1}) = " should start with \'--\'";

  Deleted trivially dead stmt: _12 = (sizetype) _11;

  Deleted trivially dead stmt: _11 = iftmp.5_14 + 8;

ipa-modref: call stmt concat5_pkg1.make_failed (D.5010);
ipa-modref: call to Concat5_Pkg1.Make_Failed/0 does not use ref: (*S9b.6_22)[1
...]{lb: 1 sz: 1} alias sets: 8->8
  Deleted dead store: (*S9b.6_22)[1 ...]{lb: 1 sz: 1} = "option ";

but the stores are definitively not dead here.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-04-12 15:05 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31 10:09 [Bug ipa/104303] New: [12 regression] gnatmake is miscompiled by IPA/modef ebotcazou at gcc dot gnu.org
2022-01-31 10:12 ` [Bug ipa/104303] [12 regression] gnatmake is miscompiled by IPA/modref pinskia at gcc dot gnu.org
2022-01-31 10:21 ` hubicka at gcc dot gnu.org
2022-02-01  8:18 ` rguenth at gcc dot gnu.org
2022-03-22 14:52 ` jakub at gcc dot gnu.org
2022-03-31 12:51 ` rguenth at gcc dot gnu.org
2022-03-31 13:12 ` hubicka at gcc dot gnu.org
2022-04-03 23:49 ` hubicka at gcc dot gnu.org
2022-04-05 21:46 ` hubicka at gcc dot gnu.org
2022-04-07 11:47 ` rguenth at gcc dot gnu.org
2022-04-07 11:57 ` rguenth at gcc dot gnu.org
2022-04-07 12:12 ` rguenth at gcc dot gnu.org
2022-04-07 13:01 ` hubicka at kam dot mff.cuni.cz
2022-04-07 13:03 ` cvs-commit at gcc dot gnu.org
2022-04-07 13:04 ` rguenth at gcc dot gnu.org
2022-04-07 14:16 ` ebotcazou at gcc dot gnu.org
2022-04-12 15:05 ` cvs-commit at gcc dot gnu.org

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).