[Bug c/61236] GCC 4.9 generates incorrect object code

2014-05-20 Thread muks at banu dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61236 --- Comment #16 from Mukund Sivaraman --- (In reply to Andrew Pinski from comment #15) > > At the very least, if it is possible to detect that the pointer is NULL by > > static analysis and it is being passed to a function that has the notnull >

[Bug c/61236] GCC 4.9 generates incorrect object code

2014-05-20 Thread muks at banu dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61236 --- Comment #14 from Mukund Sivaraman --- (In reply to Jakub Jelinek from comment #10) > But the compiler doesn't know there that x is NULL. The compiler sees a See comment #3. It generates 2 codepaths, one where (nalloc == 0) and another where

[Bug c/61236] GCC 4.9 generates incorrect object code

2014-05-20 Thread muks at banu dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61236 --- Comment #9 from Mukund Sivaraman --- Hi Jakub, Markus We discussed this during our daily standup call today, and there are two points we'd like to make: 1. The qsort() defintion in C99 doesn't explicitly state that base must not be NULL, th

[Bug c/61236] GCC 4.9 generates incorrect object code

2014-05-19 Thread muks at banu dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61236 --- Comment #3 from Mukund Sivaraman --- The following is _incorrect_ generated x86_64 code for dns_rdataslab_fromrdataset() as compiled with: gcc version 4.9.1 20140507 (prerelease) (GCC). (the current version of GCC on Arch Linux). NOTE that

[Bug c/61236] GCC 4.9 generates incorrect object code

2014-05-19 Thread muks at banu dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61236 --- Comment #2 from Mukund Sivaraman --- This is the C function (so you can compare notes from the next comment): isc_result_t dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx, isc_region_t *region, unsigned in

[Bug c/61236] GCC 4.9 generates incorrect object code

2014-05-19 Thread muks at banu dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61236 --- Comment #1 from Mukund Sivaraman --- The following is _correct_ generated x8t_64 code for dns_rdataslab_fromrdataset() as compiled with: gcc version 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC) Under free_rdatas label, you can see that there is a

[Bug c/61236] New: GCC 4.9 generates incorrect object code

2014-05-19 Thread muks at banu dot com
Assignee: unassigned at gcc dot gnu.org Reporter: muks at banu dot com Hi all This is a bug report from the BIND DNS project team at ISC.org. We have a report to make of buggy code generated with GCC 4.9.0, and we request a C compiler developer to take a look. For the purpose of