[Bug middle-end/94313] stores into string literals sometimes silently eliminated

2020-03-25 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94313 --- Comment #4 from Martin Sebor --- An implementation is free to do whatever it wants when it finds invalid/undefined code. A quality implementation will also let the user know about it so it can be fixed. An even better one will let the user

[Bug middle-end/94313] stores into string literals sometimes silently eliminated

2020-03-25 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94313 --- Comment #3 from rguenther at suse dot de --- On Wed, 25 Mar 2020, msebor at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94313 > > --- Comment #2 from Martin Sebor --- > Removing invalid code not isn't wrong (as

[Bug middle-end/94313] stores into string literals sometimes silently eliminated

2020-03-25 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94313 --- Comment #2 from Martin Sebor --- Removing invalid code not isn't wrong (as in non-conforming), but it's decidedly unhelpful in avoiding the undefined behavior that doesn't necessarily go away just because the invalid statement is gone. It

[Bug middle-end/94313] stores into string literals sometimes silently eliminated

2020-03-25 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94313 --- Comment #1 from Richard Biener --- This is likely because points-to computes the result of the string functions, for example in g1 it computes s_5 = { NULL STRING } and somehow ref_maybe_used_by_stmt_p computes false for *s and f(s).