Re: GCC and Floating-Point

2005-05-25 Thread Allan Sandfeld Jensen
On Wednesday 25 May 2005 16:22, chris jefferson wrote: > > On the other hand, in general using != and == on floating point numbers > is always dangerous if you do not know all the consequences. For > example, on your above program if I use 30.1 and 90.3, the program fails > without -ffast-math. > Y

Re: GCC and Floating-Point

2005-05-26 Thread Allan Sandfeld Jensen
On Thursday 26 May 2005 10:15, Vincent Lefevre wrote: > On 2005-05-25 19:27:21 +0200, Allan Sandfeld Jensen wrote: > > Yes. I still don't understand why gcc doesn't do -ffast-math by > > default like all other compilers. > > No! And I really don't think that oth

Re: GCC and Floating-Point

2005-05-27 Thread Allan Sandfeld Jensen
On Friday 27 May 2005 13:51, Vincent Lefevre wrote: > So, yes, -ffast-math by default would really be a bad idea and would > make gcc much worse than other compilers. > Thanks for the tests. I had no idea GCCs fast-math was that different from other compilers. Maybe the real goal like other hav

Re: GCC Multi-Threading Ideas

2020-01-23 Thread Allan Sandfeld Jensen
On Montag, 20. Januar 2020 20:26:46 CET Nicholas Krause wrote: > Greetings All, > > Unfortunately due to me being rather busy with school and other things I > will not be able to post my article to the wiki for awhile. However > there is a rough draft here: > https://docs.google.com/document/d/1p

Re: GCC Multi-Threading Ideas

2020-01-24 Thread Allan Sandfeld Jensen
On Freitag, 24. Januar 2020 04:38:48 CET Nicholas Krause wrote: > On 1/23/20 12:19 PM, Nicholas Krause wrote: > > On 1/23/20 3:39 AM, Allan Sandfeld Jensen wrote: > >> On Montag, 20. Januar 2020 20:26:46 CET Nicholas Krause wrote: > >>> Greetings All, > >>

Re: GCC Multi-Threading Ideas

2020-01-24 Thread Allan Sandfeld Jensen
On Freitag, 24. Januar 2020 17:29:06 CET Nicholas Krause wrote: > On 1/24/20 3:18 AM, Allan Sandfeld Jensen wrote: > > On Freitag, 24. Januar 2020 04:38:48 CET Nicholas Krause wrote: > >> On 1/23/20 12:19 PM, Nicholas Krause wrote: > >>> On 1/23/20 3:39 AM, Allan Sa

Warning on move and dereference of unique_ptr in the same expression

2020-02-03 Thread Allan Sandfeld Jensen
Hello gcc I have now twice hit obscure bugs in Chromium that crashed on some compilers but not on others, and didn't produce any warnings on any compiler. I would like to know if this code is as undefined as I think it is, and if it would make sense to have gcc warn about it. Both cases basica

Re: Warning on move and dereference of unique_ptr in the same expression

2020-02-03 Thread Allan Sandfeld Jensen
On Montag, 3. Februar 2020 21:47:13 CET Marek Polacek wrote: > On Mon, Feb 03, 2020 at 09:26:40PM +0100, Allan Sandfeld Jensen wrote: > > Hello gcc > > > > I have now twice hit obscure bugs in Chromium that crashed on some > > compilers but not on others, and didn&#x

Re: New x86-64 micro-architecture levels

2020-07-11 Thread Allan Sandfeld Jensen
On Freitag, 10. Juli 2020 19:30:09 CEST Florian Weimer via Gcc wrote: > glibc (or an alternative loader implementation) would search for > libraries starting at level D, going back to level A, and finally the > baseline implementation in the default library location. > > I expect that some distrib

Non-inlined functions and mixed architectures

2020-07-22 Thread Allan Sandfeld Jensen
A problem that I keep running into is functions defined headers, but used in sources files that are compiled with different CPU feature flags (for runtime CPU feature selection). We know to make sure the functions are inlinable and their address never taken, but of course in debug builds they a

Re: Non-inlined functions and mixed architectures

2020-07-27 Thread Allan Sandfeld Jensen
On Montag, 27. Juli 2020 10:33:35 CEST Florian Weimer wrote: > * Allan Sandfeld Jensen: > > A problem that I keep running into is functions defined headers, but used > > in sources files that are compiled with different CPU feature flags (for > > runtime CPU feature selection)

Re: Non-inlined functions and mixed architectures

2020-08-04 Thread Allan Sandfeld Jensen
On Montag, 27. Juli 2020 10:54:02 CEST Florian Weimer wrote: > * Allan Sandfeld Jensen: > > On Montag, 27. Juli 2020 10:33:35 CEST Florian Weimer wrote: > >> * Allan Sandfeld Jensen: > >> > A problem that I keep running into is functions defined headers, but >

Re: Non-inlined functions and mixed architectures

2020-08-04 Thread Allan Sandfeld Jensen
On Dienstag, 4. August 2020 19:44:57 CEST Florian Weimer wrote: > * Allan Sandfeld Jensen: > > On Montag, 27. Juli 2020 10:54:02 CEST Florian Weimer wrote: > >> * Allan Sandfeld Jensen: > >> > On Montag, 27. Juli 2020 10:33:35 CEST Florian Weimer wrote: > >>

RFC: -fno-share-inlines

2020-08-10 Thread Allan Sandfeld Jensen
Following the previous discussion, this is a proposal for a patch that adds the flag -fno-share-inlines that can be used when compiling singular source files with a different set of flags than the rest of the project. It basically turns off comdat for inline functions, as if you compiled without

Re: Peephole optimisation: isWhitespace()

2020-08-17 Thread Allan Sandfeld Jensen
On Freitag, 14. August 2020 18:43:12 CEST Stefan Kanthak wrote: > Hi @ll, > > in his ACM queue article , > Matt Godbolt used the function > > | bool isWhitespace(char c) > | { > | > | return c == ' ' > | > | || c == '\r' > | || c

Re: RFC: -fno-share-inlines

2020-08-24 Thread Allan Sandfeld Jensen
On Montag, 24. August 2020 08:52:04 CEST Richard Biener wrote: > On Mon, Aug 10, 2020 at 9:36 AM Allan Sandfeld Jensen > > wrote: > > Following the previous discussion, this is a proposal for a patch that > > adds > > the flag -fno-share-inlines that can be u

Re: [RFC] Increase libstdc++ line length to 100(?) columns

2020-11-27 Thread Allan Sandfeld Jensen
On Freitag, 27. November 2020 00:50:57 CET Jonathan Wakely via Gcc wrote: > I've touched on the subject a few times, e.g. > https://gcc.gnu.org/pipermail/gcc/2019-December/230993.html > and https://gcc.gnu.org/pipermail/gcc/2019-December/231013.html > > Libstdc++ code is indented by 2 columns for

Re: [RFC] Increase libstdc++ line length to 100(?) columns

2020-11-29 Thread Allan Sandfeld Jensen
On Sonntag, 29. November 2020 18:38:15 CET Florian Weimer wrote: > * Allan Sandfeld Jensen: > > If you _do_ change it. I would suggest changing it to 120, which is next > > common step for a lot of C++ projects. > > 120 can be problematic for a full HD screen in portrait mod

Re: [RFC] Increase libstdc++ line length to 100(?) columns

2020-11-30 Thread Allan Sandfeld Jensen
On Montag, 30. November 2020 16:47:08 CET Michael Matz wrote: > Hello, > > On Sun, 29 Nov 2020, Allan Sandfeld Jensen wrote: > > On Sonntag, 29. November 2020 18:38:15 CET Florian Weimer wrote: > > > * Allan Sandfeld Jensen: > > > > If you _do_ change it. I wou

Re: DWZ 0.14 released

2021-03-09 Thread Allan Sandfeld Jensen
Btw, question for gcc/binutils Any reason the work done by tools like dwz couldn't be done in the compiler or linker? Seems a bit odd to have a post-linker that optimizes the generated code, when optimizations should already be enabled. Best regards Allan On Montag, 8. März 2021 13:43:11 CET T

Constexpr in intrinsics?

2016-03-27 Thread Allan Sandfeld Jensen
Would it be possible to add constexpr to the intrinsics headers? For instance _mm_set_XX and _mm_setzero intrinsics. Ideally it could also be added all intrinsics that can be evaluated at compile time, but it is harder to tell which those are. Does gcc have a C extension we can use to set const

Re: Constexpr in intrinsics?

2016-03-27 Thread Allan Sandfeld Jensen
On Sunday 27 March 2016, Marc Glisse wrote: > On Sun, 27 Mar 2016, Allan Sandfeld Jensen wrote: > > Would it be possible to add constexpr to the intrinsics headers? > > > > For instance _mm_set_XX and _mm_setzero intrinsics. > > Already suggested here: > https://gcc

Re: [PING][RFC] Assertions as optimization hints

2016-11-27 Thread Allan Sandfeld Jensen
On Wednesday 23 November 2016, Richard Biener wrote: > On Tue, Nov 22, 2016 at 6:52 PM, Yuri Gribov wrote: > > Hi all, > > > > I've recently revisited an ancient patch from Paolo > > (https://gcc.gnu.org/ml/gcc-patches/2004-04/msg00551.html) which uses > > asserts as optimization hints. I've rewr

Re: Change to C++11 by default?

2015-05-08 Thread Allan Sandfeld Jensen
On Thursday 07 May 2015, Jason Merrill wrote: > I think it's time to switch to C++11 as the default C++ dialect for GCC > 6. Any thoughts? > Would it be unrealistic to make C++14 the default? With it being an fixup of C++11, I would guess it could have longer staying power as the default. `Alla

Re: Enabling LTO for target libraries (e.g., libgo, libstdc++)

2019-01-25 Thread Allan Sandfeld Jensen
On Freitag, 25. Januar 2019 07:22:36 CET Nikhil Benesch wrote: > Does anyone have advice to offer? Has anyone tried convincing the build > system to compile some of the other target libraries (like libstdc++ or > libgfortran) with -flto? > Make sure the static versions of the libraries are partial

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

2019-03-21 Thread Allan Sandfeld Jensen
On Montag, 11. März 2019 10:14:49 CET Jakub Jelinek wrote: > On Mon, Mar 11, 2019 at 08:49:30AM +, Moritz Strübe wrote: > > Considering that C11 6.5.7#3 ("If the value of the right operand > > is negative or is greater than or equal to the width of the promoted > > left operand, the be

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 ye

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

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

On -march=x86-64

2019-07-11 Thread Allan Sandfeld Jensen
Years ago I discovered Chrome was optimizing with -march=x86-64, and knowing was an undocumented arch that would optimize for K8 I laughed at it and just removed that piece of idiocy from our fork of Chromium, so it would be faster than upstream. Recently though I noticed phoronix is also using

Re: On -march=x86-64

2019-07-14 Thread Allan Sandfeld Jensen
On Donnerstag, 11. Juli 2019 20:58:04 CEST Allan Sandfeld Jensen wrote: > Years ago I discovered Chrome was optimizing with -march=x86-64, and > knowing was an undocumented arch that would optimize for K8 I laughed at it > and just removed that piece of idiocy from our fork of Chromi

Re: C2X Proposal, merge '.' and '->' C operators

2019-12-21 Thread Allan Sandfeld Jensen
On Monday, 16 December 2019 14:51:38 CET J Decker wrote: > Here's the gist of what I would propose... > https://gist.github.com/d3x0r/f496d0032476ed8b6f980f7ed31280da > > In C, there are two operators . and -> used to access members of struct and > union types. These operators are specified such t

Re: C++17 by default in gcc-8

2017-03-26 Thread Allan Sandfeld Jensen
On Sunday 26 March 2017, Egor Pugin wrote: > Hi, > > It's a bit early question, but still. > C++ releases became more predictive and regular. > What do you think about settings -std=c++17 (or gnu++17) for gcc-8 as > default c++ mode? > What is your policy regarding default c++ standards in gcc? I

Re: [RFC] GCC 8 Project proposal: Extensions supporting C Metaprogramming, pseudo-templates

2017-05-09 Thread Allan Sandfeld Jensen
On Tuesday 09 May 2017, Daniel Santos wrote: > The primary aim is to facilitate high-performance generic C > libraries for software where C++ is not suitable, but the cost of > run-time abstraction is unacceptable. A good example is the Linux > kernel, where the source tree is littered with more th

Re: Quantitative analysis of -Os vs -O3

2017-08-26 Thread Allan Sandfeld Jensen
On Samstag, 26. August 2017 10:56:16 CEST Markus Trippelsdorf wrote: > On 2017.08.26 at 01:39 -0700, Andrew Pinski wrote: > > First let me put into some perspective on -Os usage and some history: > > 1) -Os is not useful for non-embedded users > > 2) the embedded folks really need the smallest code

Re: Quantitative analysis of -Os vs -O3

2017-08-26 Thread Allan Sandfeld Jensen
On Samstag, 26. August 2017 12:59:06 CEST Markus Trippelsdorf wrote: > On 2017.08.26 at 12:40 +0200, Allan Sandfeld Jensen wrote: > > On Samstag, 26. August 2017 10:56:16 CEST Markus Trippelsdorf wrote: > > > On 2017.08.26 at 01:39 -0700, Andrew Pinski wrote: > > > &

Re: RFC: Improving GCC8 default option settings

2017-09-13 Thread Allan Sandfeld Jensen
On Dienstag, 12. September 2017 23:27:22 CEST Michael Clark wrote: > > On 13 Sep 2017, at 1:57 AM, Wilco Dijkstra wrote: > > > > Hi all, > > > > At the GNU Cauldron I was inspired by several interesting talks about > > improving GCC in various ways. While GCC has many great optimizations, a > >

Re: RFC: Improving GCC8 default option settings

2017-09-13 Thread Allan Sandfeld Jensen
On Mittwoch, 13. September 2017 15:46:09 CEST Jakub Jelinek wrote: > On Wed, Sep 13, 2017 at 03:41:19PM +0200, Richard Biener wrote: > > On its own -O3 doesn't add much (some loop opts and slightly more > > aggressive inlining/unrolling), so whatever it does we > > should consider doing at -O2 even

Resolving LTO symbols for static library boundary

2018-02-05 Thread Allan Sandfeld Jensen
Hello GCC In trying to make it possible to use LTO for distro-builds of Qt, I have again hit the problem of static libraries. In Qt in general we for LTO rely on a library boundary, where LTO gets resolved when generating the library but no LTO-symbols are exported in the shared library. This e

Re: Resolving LTO symbols for static library boundary

2018-02-07 Thread Allan Sandfeld Jensen
On Dienstag, 6. Februar 2018 01:01:29 CET Jan Hubicka wrote: > Dne 2018-02-05 18:44, Richard Biener napsal: > > On February 5, 2018 12:26:58 PM GMT+01:00, Allan Sandfeld Jensen > > > > wrote: > >> Hello GCC > >> > >> In trying to make it possible

Enabling -ftree-slp-vectorize on -O2/Os

2018-05-26 Thread Allan Sandfeld Jensen
I brought this subject up earlier, and was told to suggest it again for gcc 9, so I have attached the preliminary changes. My studies have show that with generic x86-64 optimization it reduces binary size with around 0.5%, and when optimizing for x64 targets with SSE4 or better, it reduces bina

Re: Enabling -ftree-slp-vectorize on -O2/Os

2018-05-26 Thread Allan Sandfeld Jensen
On Sonntag, 27. Mai 2018 00:05:32 CEST Segher Boessenkool wrote: > On Sat, May 26, 2018 at 11:32:29AM +0200, Allan Sandfeld Jensen wrote: > > I brought this subject up earlier, and was told to suggest it again for > > gcc 9, so I have attached the preliminary changes. > > >

Re: Enabling -ftree-slp-vectorize on -O2/Os

2018-05-27 Thread Allan Sandfeld Jensen
On Sonntag, 27. Mai 2018 03:23:36 CEST Segher Boessenkool wrote: > On Sun, May 27, 2018 at 01:25:25AM +0200, Allan Sandfeld Jensen wrote: > > On Sonntag, 27. Mai 2018 00:05:32 CEST Segher Boessenkool wrote: > > > On Sat, May 26, 2018 at 11:32:29AM +0200, Allan Sandfeld Jense

Re: Enabling -ftree-slp-vectorize on -O2/Os

2018-05-28 Thread Allan Sandfeld Jensen
On Montag, 28. Mai 2018 12:58:20 CEST Richard Biener wrote: > compile-time effects of the patch on that. Embedded folks may want to rhn > their favorite benchmark and report results as well. > > So I did a -O2 -march=haswell [-ftree-slp-vectorize] SPEC CPU 2006 compile > and run and the compile-ti

Re: Enabling -ftree-slp-vectorize on -O2/Os

2018-05-29 Thread Allan Sandfeld Jensen
On Dienstag, 29. Mai 2018 16:57:56 CEST Richard Biener wrote: > > so the situation improves but isn't fully fixed (STLF issues maybe?) > That raises the question if it helps in these cases even in -O3? Anyway it doesn't look good for it. Did the binary size at least improve with prefer-avx128,

Re: Enabling -ftree-slp-vectorize on -O2/Os

2018-05-31 Thread Allan Sandfeld Jensen
Okay, I think I can withdraw the suggestion. It is apparently not providing a stable end performance. I would like to end with sharing the measurements I made that motivated me to suggest the change. Hopefully it can be useful if tree-slp-vectorize gets improved and the suggestion comes up agai

Re: O2 Agressive Optimisation by GCC

2018-07-20 Thread Allan Sandfeld Jensen
On Freitag, 20. Juli 2018 14:19:12 CEST Umesh Kalappa wrote: > Hi All , > > We are looking at the C sample i.e > > extern int i,j; > > int test() > { > while(1) > { i++; > j=20; > } > return 0; > } > > command used :(gcc 8.1.0) > gcc -S test.c -O2 > > the generated asm for x86 >

Re: O2 Agressive Optimisation by GCC

2018-07-20 Thread Allan Sandfeld Jensen
On Samstag, 21. Juli 2018 00:21:48 CEST Jonathan Wakely wrote: > On Fri, 20 Jul 2018 at 23:06, Allan Sandfeld Jensen wrote: > > On Freitag, 20. Juli 2018 14:19:12 CEST Umesh Kalappa wrote: > > > Hi All , > > > > > > We are looking at the C sample i.e > >

Re: O2 Agressive Optimisation by GCC

2018-07-22 Thread Allan Sandfeld Jensen
On Sonntag, 22. Juli 2018 17:01:29 CEST Umesh Kalappa wrote: > Allan , > > >>he might as well go traditional > > you mean using the locks ? > No I am meant relying on undefined behavior. In your case I would recommend using modern atomics, which is defined behavior, and modern and fast. I was

Vectorizing 16bit signed integers

2009-12-11 Thread Allan Sandfeld Jensen
Hi I hope someone can help me. I've been trying to write some tight integer loops in way that could be auto-vectorized, saving me to write assembler or using specific vectorization extensions. Unfortunately I've not yet managed to make gcc vectorize any of them. I've simplified the case to ju

Re: Summer of Code 2006

2006-04-18 Thread Allan Sandfeld Jensen
On Monday 17 April 2006 12:21, Jan-Benedict Glaw wrote: > On Sun, 2006-04-16 21:30:08 -0700, Ian Lance Taylor wrote: > * Trailing whitespace patrol. find . -name "*\.[ch]" | xargs perl -pi -e's/\s*$/\n/' `Allan

Non-consistent ICE in 14.1 and 14.2

2024-08-29 Thread Allan Sandfeld Jensen
Hi GCC I wanted to report one or more bugs, unfortunately they are not consistently reproducable, which is odd. It happens when compiling the chromium part of qtwebengine after the update to gcc 14 and during development for updating Chromium to 126. On almost every run over a few thousand file

Re: Non-consistent ICE in 14.1 and 14.2

2024-08-29 Thread Allan Sandfeld Jensen
On Thursday 29 August 2024 14:38:04 Central European Summer Time Alexander Monakov wrote: > On Thu, 29 Aug 2024, Richard Biener via Gcc wrote: > > On Thu, Aug 29, 2024 at 1:49 PM Allan Sandfeld Jensen > > > > wrote: > > > Hi GCC > > > > > > I

Re: Macro for C++14 support

2013-04-23 Thread Allan Sandfeld Jensen
On Sunday 21 April 2013, Jonathan Wakely wrote: > I'm starting to implement some new library features voted into C++14 > at the Bristol meeting and am wondering what feature check to use. > > Will there be a macro like _GXX_EXPERIMENTAL_CXX1Y__ to correspond to > -std=c++1y? > > Alternatively we

Optimizing bit extract

2014-02-14 Thread Allan Sandfeld Jensen
Hello gcc I have been looking at optimizations of pixel-format conversion recently and have noticed that gcc does take advantage of SSE4a extrq, BMI1 bextr TBM bextri or BMI2 pext instructions when it could be useful. As far as I can tell it should not be that hard. A bextr expression can typi

Problems with pragma and attribute optimize.

2012-07-25 Thread Allan Sandfeld Jensen
Hi, I have been experimenting with marking specific functions to be auto- vectorized in GCC, but have had problems getting it to work. It seems the optimize attribute works sometimes, but only if the function it is used on is not static, but pragma optimize never seems to work. See the attached

Re: Problems with pragma and attribute optimize.

2012-07-25 Thread Allan Sandfeld Jensen
On Wednesday 25 July 2012, Richard Guenther wrote: > On Wed, Jul 25, 2012 at 2:23 PM, Allan Sandfeld Jensen > > wrote: > > Hi, > > > > I have been experimenting with marking specific functions to be auto- > > vectorized in GCC, but have had problems getting

Re: Problems with pragma and attribute optimize.

2012-07-30 Thread Allan Sandfeld Jensen
On Wednesday 25 July 2012, Richard Guenther wrote: > On Wed, Jul 25, 2012 at 4:25 PM, Allan Sandfeld Jensen > > wrote: > > On Wednesday 25 July 2012, Richard Guenther wrote: > >> On Wed, Jul 25, 2012 at 2:23 PM, Allan Sandfeld Jensen > >> > >> wr