public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/110103] New: the pointers return from two malloc is not equal
@ 2023-06-03 11:06 zhongyunde at huawei dot com
2023-06-04 10:13 ` [Bug c/110103] " xry111 at gcc dot gnu.org
2023-06-05 6:46 ` rguenth at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: zhongyunde at huawei dot com @ 2023-06-03 11:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110103
Bug ID: 110103
Summary: the pointers return from two malloc is not equal
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: zhongyunde at huawei dot com
Target Milestone: ---
test:https://gcc.godbolt.org/z/j74z1qaT9
```
int check_pointer (void)
{
int *pa = (int *) malloc (sizeof (int) * NUM);
int *pb = (int *) malloc (sizeof (int) * NUM);
return pa == pb;
}
```
* llvm just return 0, while gcc not
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/110103] the pointers return from two malloc is not equal
2023-06-03 11:06 [Bug c/110103] New: the pointers return from two malloc is not equal zhongyunde at huawei dot com
@ 2023-06-04 10:13 ` xry111 at gcc dot gnu.org
2023-06-05 6:46 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-06-04 10:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110103
Xi Ruoyao <xry111 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |xry111 at gcc dot gnu.org
--- Comment #1 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Hmm, is it valid to optimize the malloc() calls away here?
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/110103] the pointers return from two malloc is not equal
2023-06-03 11:06 [Bug c/110103] New: the pointers return from two malloc is not equal zhongyunde at huawei dot com
2023-06-04 10:13 ` [Bug c/110103] " xry111 at gcc dot gnu.org
@ 2023-06-05 6:46 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-06-05 6:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110103
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|UNCONFIRMED |RESOLVED
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
optimizing away malloc() is on the border of validity I think since grabbing
memory is an observable side-effect. Otherwise a duplicate of PR13962.
*** This bug has been marked as a duplicate of bug 13962 ***
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-05 6:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-03 11:06 [Bug c/110103] New: the pointers return from two malloc is not equal zhongyunde at huawei dot com
2023-06-04 10:13 ` [Bug c/110103] " xry111 at gcc dot gnu.org
2023-06-05 6:46 ` rguenth 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).