Re: GCC turns &~ into | due to undefined bit-shift without warning

2019-03-22 Thread Joseph Myers
On Fri, 22 Mar 2019, Andrew Pinski wrote: > "The practice of reading from a different union member than the one > most recently written to (called “type-punning”) is common. Even with > -fstrict-aliasing, type-punning is allowed, provided the memory is > accessed through the union type." > Maybe i

gcc-8-20190322 is now available

2019-03-22 Thread gccadmin
Snapshot gcc-8-20190322 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/8-20190322/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 8 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-8

Re: GCC turns &~ into | due to undefined bit-shift without warning

2019-03-22 Thread Andrew Pinski
On Fri, Mar 22, 2019 at 3:08 PM Andrew Pinski wrote: > > On Fri, Mar 22, 2019 at 7:35 AM Allan Sandfeld Jensen > wrote: > > > > On Freitag, 22. März 2019 14:38:10 CET Andrew Haley wrote: > > > On 3/22/19 10:20 AM, Allan Sandfeld Jensen wrote: > > > > On Freitag, 22. März 2019 11:02:39 CET Andrew

Re: GCC turns &~ into | due to undefined bit-shift without warning

2019-03-22 Thread Andrew Pinski
On Fri, Mar 22, 2019 at 7:35 AM Allan Sandfeld Jensen wrote: > > On Freitag, 22. März 2019 14:38:10 CET Andrew Haley wrote: > > On 3/22/19 10:20 AM, Allan Sandfeld Jensen wrote: > > > On Freitag, 22. März 2019 11:02:39 CET Andrew Haley wrote: > > >> On 3/21/19 10:19 PM, Allan Sandfeld Jensen wrote

Re: GCC turns &~ into | due to undefined bit-shift without warning

2019-03-22 Thread Allan Sandfeld Jensen
On Freitag, 22. März 2019 14:38:10 CET Andrew Haley wrote: > On 3/22/19 10:20 AM, Allan Sandfeld Jensen wrote: > > On Freitag, 22. März 2019 11:02:39 CET Andrew Haley wrote: > >> On 3/21/19 10:19 PM, Allan Sandfeld Jensen wrote: > >>> From having fixed UBSAN warnings, I have seen many cases where u

Re: GCC turns &~ into | due to undefined bit-shift without warning

2019-03-22 Thread Andrew Haley
On 3/22/19 10:20 AM, Allan Sandfeld Jensen wrote: > On Freitag, 22. März 2019 11:02:39 CET Andrew Haley wrote: >> On 3/21/19 10:19 PM, Allan Sandfeld Jensen wrote: >>> From having fixed UBSAN warnings, I have seen many cases where undefined >>> behavior was performed, but where the code was aware o

GSOC 19 Add new math.h and complex.h functions as built-ins

2019-03-22 Thread GSOC19TR I
Dear Sir, I like to work on the project *Adding new math.h and complex.h functions as built-ins**. *With an year's experience in the field, I believe that I am the type of person you are seeking. I am interested in working on real time projects and contribute to the opensource community. I am consc

Re: GCC turns &~ into | due to undefined bit-shift without warning

2019-03-22 Thread Jakub Jelinek
On Fri, Mar 22, 2019 at 01:28:39PM +0100, David Brown wrote: > If you compile a "hello, world!" C program, then the C standards do not > define how those words get on your screen. As far as /C/ is concerned, > the workings of "printf" are undefined behaviour - because the C > standard does not def

Re: GCC turns &~ into | due to undefined bit-shift without warning

2019-03-22 Thread David Brown
On 22/03/2019 11:20, Allan Sandfeld Jensen wrote: > On Freitag, 22. März 2019 11:02:39 CET Andrew Haley wrote: >> On 3/21/19 10:19 PM, Allan Sandfeld Jensen wrote: >>> From having fixed UBSAN warnings, I have seen many cases where undefined >>> behavior was performed, but where the code was aware o

Gcov Internals

2019-03-22 Thread Sebastian Roland
Hi, I am currently trying to understand the internals of Gcov. Specifically I am wondering of the following: 1) Certain Basic Blocks are instrumented with counters that are incremented during execution. During compilation a destructor is registered that actually goes through a gcov_info stru

Re: GCC turns &~ into | due to undefined bit-shift without warning

2019-03-22 Thread Allan Sandfeld Jensen
On Freitag, 22. März 2019 11:02:39 CET Andrew Haley wrote: > On 3/21/19 10:19 PM, Allan Sandfeld Jensen wrote: > > From having fixed UBSAN warnings, I have seen many cases where undefined > > behavior was performed, but where the code was aware of it and the final > > result of the expression was w

Re: GCC turns &~ into | due to undefined bit-shift without warning

2019-03-22 Thread Andrew Haley
On 3/21/19 10:19 PM, Allan Sandfeld Jensen wrote: > From having fixed UBSAN warnings, I have seen many cases where undefined > behavior was performed, but where the code was aware of it and the final > result of the expression was well defined nonetheless. Is this belief about undefined behaviou

Re: GCC turns &~ into | due to undefined bit-shift without warning

2019-03-22 Thread Jakub Jelinek
On Fri, Mar 22, 2019 at 10:27:38AM +0100, Allan Sandfeld Jensen wrote: > But getting back to the question, well GCC carry such information further, > and > thus break code that is otherwise correct behaving on all known > architectures, > just because the C standard hasn't decided on one of two

Re: GCC turns &~ into | due to undefined bit-shift without warning

2019-03-22 Thread Allan Sandfeld Jensen
On Donnerstag, 21. März 2019 23:31:48 CET Jakub Jelinek wrote: > On Thu, Mar 21, 2019 at 11:19:54PM +0100, Allan Sandfeld Jensen wrote: > > Hmm, I am curious. How strongly would gcc assume x is 0? > > If x is not 0, then it is undefined behavior and anything can happen, > so yes, it can assume x i