[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-25 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

Andrew Pinski pinskia at gcc dot gnu.org changed:

   What|Removed |Added

 CC||amodra at gmail dot com

--- Comment #18 from Andrew Pinski pinskia at gcc dot gnu.org ---
*** Bug 65574 has been marked as a duplicate of this bug. ***


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-25 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #19 from Martin Sebor msebor at gcc dot gnu.org ---
Glibc bug #18116 tracks the discussion of the build failure (and the proposed
fix) there:
https://sourceware.org/bugzilla/show_bug.cgi?id=18116


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |5.0


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-09 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #16 from Michael Meissner meissner at gcc dot gnu.org ---
As I can see there are several issues/whatever.

1) Each of the _ARCH_PWRn is cumulative, so if you say -mcpu=power8 for
instance, it defines _ARCH_PWR4, _ARCH_PWR5, _ARCH_PWR5X, _ARCH_PWR6,
_ARCH_PWR7, and _ARCH_PWR8.  Note, it does not define _ARCH_PWR6X, since those
instructions only exist in the power6x, and are not in later versions of the
power hardware.

2) If you had used a compiler that was configured using the --with-cpu=power8
option, it would have shown the same results, since _ARCH_PWR6 would have been
defined.  It was only if you use a compiler that was not configured using
--with-cpu=xxx, would the code be assembled using the older form of the asm
insns.  I believe each of the 3 distributions use some form of --with-cpu=xxx
in building their compiler.

3) Given that ISA 2.07 (i.e. power8) is officially the minimum baseline for
64-bit PowerPC little endian, perhaps the assembler should be modified to
default to power8.  Obviously if this change is desired, you need to raise it
on the appropriate binutils forums.

4) Using .machine altivec as you've discovered is the wrong value for PowerPC
64 Little Endian Linux.  It was the right value back in the days of the Apple
G5, but it is not right for the current PowerPC 64LE environment.


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-09 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #17 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
OK, I will use --with-cpu=power8 in the future.


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-08 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #12 from David Edelsohn dje at gcc dot gnu.org ---
The assembly file should start with

.machine power4

which is the lowest level ISA supported on PPC64 Linux, GLIBC and mtfsf.

If one invokes GCC with multiple -m options, it is complicated to calculate the
correct assembler command line option, especially at the point that the
assembler command is generated.  With an assembler file, the compiler has no
knowledge about the contents and should not guess the required ISA.


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-08 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #13 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
It starts with: .machine altivec instead.
But we are talking about powerpc64le-unknown-linux-gnu here.
And -mpower8 is always right in this case, no?


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-08 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #15 from David Edelsohn dje at gcc dot gnu.org ---
GCC is not magic black box for invoking every other part of the toolchain with
the correct options.  If the assembly code uses POWER6 (ISA 2.05) instructions,
it should set the ISA level appropriately.  The assembly code in question is
using the pre-processor of GCC, which defines machine macros.  The logic for
setting command line options is too complicated and error-prone to recreate
separate from the ISA target flags.  GCC emits the correct ISA level when
generating an assembly file, but utilizing GCC for the pre-processor
capabilities does not emit any new assembly instructions for GCC to set
directives at the start of the file.  The change in GCC behavior is because it
is too cumbersome for GCC to get this right in some corner cases.


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-08 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #14 from Martin Sebor msebor at gcc dot gnu.org ---
I'm confused: I thought gcc defining the _ARCH_PWR6 macro in response to
-mcpu=power6 or some such implied that the target was power6.  Shouldn't gcc
then also invoke the assembler with the -mpower6 option to make sure it's also
in power6 mode?

Incidentally, the background on the glibc code is here:

  http://sourceware.org/bugzilla/show_bug.cgi?id=10118


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-07 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

Martin Sebor msebor at gcc dot gnu.org changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org

--- Comment #4 from Martin Sebor msebor at gcc dot gnu.org ---
The four operand form of the mtfsf instruction was added in Power ISA 2.5 and
gas recognizes it when targeting power6 or later.  From the glibc snippet it
does look like the first block controlled by _ARCH_PWR6 is missing the .machine
power6 directive.  Once it's added I would expect as to be happy again (it is
in my tests, though I didn't go as far as building all of glibc).

365 # ifdef _ARCH_PWR6
366   /* Use the extended four-operand version of the mtfsf insn.  */
367   mtfsf  0xff,fp0,1,0
368 # else
369   .machine push
370   .machine power6


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-07 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #7 from David Edelsohn dje at gcc dot gnu.org ---
Was this fixed after Mike's patch?  The logic in rs6000_override_options was
ignoring TARGET_DEFAULT.


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-07 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #3 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
(In reply to David Edelsohn from comment #2)
 When did this start?  GCC should be passing .machine power8.  Was this
 before or after Mike's change to processor default?

It started with your r219854.


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-07 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #5 from Jakub Jelinek jakub at gcc dot gnu.org ---
I think the point is when _ARCH_PWR6 is defined, the assembler should be
already in power6 or later mode (either through .machine directive emitted by
the compiler earlier, or through some command line option passed to the
assembler), so glibc shouldn't need to do that.


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-07 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #6 from Martin Sebor msebor at gcc dot gnu.org ---
Ah, yes, I missed that the macro was defined by gcc rather than glibc.  It does
look like gcc defines the macro and then invokes as without telling it it's in
power6 mode.


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-07 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #2 from David Edelsohn dje at gcc dot gnu.org ---
When did this start?  GCC should be passing .machine power8.  Was this before
or after Mike's change to processor default?


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-07 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek jakub at gcc dot gnu.org ---
I'd say that predefining this macro is not a bug.
So, the issue is more likely that some -m* option isn't passed to the
assembler, or that .machine isn't emitted in the assembly.


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-07 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #8 from Martin Sebor msebor at gcc dot gnu.org ---
(In reply to David Edelsohn from comment #7)

I assume the patch you are referring to is r221132 (pr65138).  It doesn't look
like that's fixed it.  The latest trunk exhibits the same problem:

$ cat t.s  /build/gcc-trunk-git/gcc/xgcc -B /build/gcc-trunk-git/gcc -dM -E
-xc -  /dev/null | grep PWR6  /build/gcc-trunk-git/gcc/xgcc -B
/build/gcc-trunk-git/gcc -c -v t.s
.text
start:
mtfsf   6,10,0,0
#define _ARCH_PWR6 1
Reading specs from /build/gcc-trunk-git/gcc/specs
COLLECT_GCC=/build/gcc-trunk-git/gcc/xgcc
Target: powerpc64le-unknown-linux-gnu
Configured with: /src/gcc-trunk-git/configure --disable-bootstrap
--enable-languages=c,c++
Thread model: posix
gcc version 5.0.0 20150307 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-B' '/build/gcc-trunk-git/gcc' '-c' '-v'
 /build/gcc-trunk-git/gcc/as -v -a64 -mppc64 -many -mlittle -o t.o t.s
GNU assembler version 2.23.52.0.1 (ppc64le-redhat-linux) using BFD version
version 2.23.52.0.1-30.ael7b 20130226
t.s: Assembler messages:
t.s:3: Error: junk at end of line: `0,0'


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-07 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #9 from David Edelsohn dje at gcc dot gnu.org ---
GCC is working correctly.  The file prologue generated by GCC for a C file now
includes

.machine power8

The example is a pre-processed assembly file.  Note the file actively pushes
and pops the machine type.

The assembly file incorrectly assumes that GCC will invoke the assembler with a
command-line option enabling a default ISA level sufficient for the
instructions in the file.  This is a bad assumption.  Even if we create a
kludge in GCC to invoke the assembler an arbitrary ISA level, this is bad
assumption.  The GLIBC file is buggy.


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-07 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #10 from Jakub Jelinek jakub at gcc dot gnu.org ---
Ah, indeed, I've totally missed it is a *.S file rather than *.c.  Thus this is
certainly a glibc bug, please file it there instead.


[Bug target/65341] [5 Regression] glibc build failure on ppc64le: setcontext.S:367: Error: junk at end of line: `1,0'

2015-03-07 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65341

--- Comment #11 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
So one has to use:
CC=gcc -Wa,-mpower8 CXX=g++ -Wa,-mpower8 ../glibc/configure 
to configure glibc on ppc64le? This looks odd to me.
Why not pass -mpower8 to the assembler by default?