GCC 7 on ppc64le does not recognize vec_xl_be?
Xi Ruoyao
xry111@mengyan1223.wang
Sat Nov 16 15:24:00 GMT 2019
On 2019-11-16 08:26 -0600, Segher Boessenkool wrote:
> On Sat, Nov 16, 2019 at 06:44:35AM -0500, Jeffrey Walton wrote:
> > On Sat, Nov 16, 2019 at 6:25 AM Segher Boessenkool
> > <segher@kernel.crashing.org> wrote:
> > > On Fri, Nov 15, 2019 at 08:05:57PM -0500, Jeffrey Walton wrote:
> > > > g++ -DNDEBUG -g2 -O3 -mcpu=power9 -maltivec -c
> > > > ppc_power9.cpp
> > >
> > > You forgot -Wall -Wextra, or at the very least -Wall. It
> > > probably will
> > > help you find this problem., too.
> >
> > OK, thanks.
> >
> > I have a comprehensive test script that does things like -Wall
> > -Wextra. It takes 4 to 6 hours to run. It is not suitable for
> > Travis,
> > though.
>
> You should have warnings enabled *always*. It does not take extra
> time,
> not measurable anyway. The point is that the compiler will tell you
> about likely errors you made, right after you made them, so it is
> easy
> to correct then, and a huge time saver. And if the compiler think
> that
> something may be wrong, but it really all is perfectly fine, perhaps
> the
> code should be written in such a way that this is more clear.
Regarding this, is it worth considering to make -Wall the default?
Recently our team is training some freshmen to write programs in C/C++.
They often make some bugs (invoking UB in some way) and puzzle
themselves. But we noticed that 90% of their bugs can be diagnosed by
simply adding -Wall.
--
Xi Ruoyao <xry111@mengyan1223.wang>
School of Aerospace Science and Technology, Xidian University
More information about the Gcc-help
mailing list