public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/114321] New: [11 regression] ipa/modref: incorrect result with O2 since r11-3308
@ 2024-03-13  3:41 yinyuefengyi at gmail dot com
  2024-03-13  3:47 ` [Bug ipa/114321] " pinskia at gcc dot gnu.org
  2024-03-13  3:49 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: yinyuefengyi at gmail dot com @ 2024-03-13  3:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114321
           Summary: [11 regression] ipa/modref: incorrect result with O2
                    since r11-3308
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yinyuefengyi at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/hz4E1q4dK

Though the code is somewhat flaw, uint64_t pointer is passed to a function and
modified as uint32_t pointer, the function call is removed by fre1 pass as:


ipa-modref: call stmt MurmurHash3_x86_32 (_8, _2, 123456, &ret);
ipa-modref: call to void MurmurHash3_x86_32(const void*, int, uint32_t,
uint64_t*)/554 does not clobber ref: ret alias sets: 46->46
Setting value number of _10 to 0 (changed)
Value numbering stmt = ret ={v} {CLOBBER(eol)};
Setting value number of .MEM_11 to .MEM_11 (changed)
Value numbering stmt = return _10;
marking outgoing edge 2 -> 1 executable
RPO iteration over 1 blocks visited 1 blocks in total discovering 1 executable
blocks iterating 1.0 times, a block was visited max. 1 times
RPO tracked 9 values available at 3 locations and 9 lattice elements
Replaced MEM[(const struct basic_string *)trace_id_6(D)]._M_dataplus._M_p with
_7 in all uses of _8 = MEM[(const struct basic_string
*)trace_id_6(D)]._M_dataplus._M_p;
Replaced ret with 0 in all uses of _10 = ret;
Removing dead stmt _10 = ret;
Removing dead stmt _8 = MEM[(const struct basic_string
*)trace_id_6(D)]._M_dataplus._M_p;


Not sure whether this is valid, it works before gcc11.  Disable with
-fno-ipa-modref or -fno-strict-aliasing could work.  Please take a look?

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

* [Bug ipa/114321] [11 regression] ipa/modref: incorrect result with O2 since r11-3308
  2024-03-13  3:41 [Bug ipa/114321] New: [11 regression] ipa/modref: incorrect result with O2 since r11-3308 yinyuefengyi at gmail dot com
@ 2024-03-13  3:47 ` pinskia at gcc dot gnu.org
  2024-03-13  3:49 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-13  3:47 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Yes this is 100% an alias violations. 

You do the store as an uint32_t but then read it as uint64_t.

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

* [Bug ipa/114321] [11 regression] ipa/modref: incorrect result with O2 since r11-3308
  2024-03-13  3:41 [Bug ipa/114321] New: [11 regression] ipa/modref: incorrect result with O2 since r11-3308 yinyuefengyi at gmail dot com
  2024-03-13  3:47 ` [Bug ipa/114321] " pinskia at gcc dot gnu.org
@ 2024-03-13  3:49 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-13  3:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> does not clobber ref: ret alias sets: 46->46


Is specificly saying the function does not do any stores that would cause
aliasing set 46 to change.

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

end of thread, other threads:[~2024-03-13  3:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-13  3:41 [Bug ipa/114321] New: [11 regression] ipa/modref: incorrect result with O2 since r11-3308 yinyuefengyi at gmail dot com
2024-03-13  3:47 ` [Bug ipa/114321] " pinskia at gcc dot gnu.org
2024-03-13  3:49 ` pinskia 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).