Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
Bug 110 - memchr not recognized as a builtin
Summary: memchr not recognized as a builtin
Status: RESOLVED FIXED
Alias: None
Product: GDC
Classification: Unclassified
Component: gdc (show other bugs)
Version: development
Hardware: All All
: --- normal
Assignee: Iain Buclaw
URL:
Depends on:
Blocks:
 
Reported: 2014-04-01 13:11 CEST by Andrei Alexandrescu
Modified: 2014-04-01 15:19 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Alexandrescu 2014-04-01 13:11:28 CEST
http://goo.gl/oNbp0y (the gcc baseline) recognizes an always failing memchr and returns 0 immediately.

http://goo.gl/9ulXBx with essentially the same source code still calls memchr.
Comment 1 Johannes Pfau 2014-04-01 15:01:22 CEST
http://goo.gl/U3tuew

@Iain should we simply add an alias in core.stdc.string?
Comment 2 Iain Buclaw 2014-04-01 15:14:31 CEST
This only occurs in gdc-4.6 - which is at least 2 years old, and doesn't have the optimisation I wrote which allows the compiler to detect gcc builtins in core.stdc - which were introduced just over a year ago.

http://goo.gl/462PBi
Comment 3 Johannes Pfau 2014-04-01 15:19:21 CEST
Right, I somehow missed that.

d.godbolt.org also supports a recent gdc 4.8.2 release btw:
http://goo.gl/0oYgOs