[Bug target/83013] New: MicroBlaze - #ident - Error: operation combines symbols in different segments

2017-11-15 Thread nathan at nathanrossi dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83013

Bug ID: 83013
   Summary: MicroBlaze - #ident - Error: operation combines
symbols in different segments
   Product: gcc
   Version: 7.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: nathan at nathanrossi dot com
  Target Milestone: ---

Created attachment 42618
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42618&action=edit
pre-processed source

When compiling certain code which uses the #ident directive the output assembly
is broken with content being located in .sdata2 instead of .text.

See attached pre-processed basename.i from the shadow package.

microblazeel-oe-linux-gcc \
  -mcpu=v10.0 -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare
-mxl-reorder \
  -mno-xl-soft-mul -mxl-multiply-high -mno-xl-soft-div -mhard-float \
  -O2 -g -c \
  -o basename.o \
  -save-temps \
  basename.i

basename.s: Assembler messages:
basename.s:961: Error: operation combines symbols in different segments
basename.s:962: Error: operation combines symbols in different segments
basename.s:965: Error: operation combines symbols in different segments
basename.s:966: Error: operation combines symbols in different segments
basename.s:969: Error: operation combines symbols in different segments
basename.s:970: Error: operation combines symbols in different segments
basename.s:976: Error: operation combines symbols in different segments
basename.s:977: Error: operation combines symbols in different segments
basename.s:980: Error: operation combines symbols in different segments
basename.s:981: Error: operation combines symbols in different segments
basename.s:987: Error: operation combines symbols in different segments
basename.s:988: Error: operation combines symbols in different segments
basename.s:991: Error: operation combines symbols in different segments
basename.s:992: Error: operation combines symbols in different segments
basename.s:997: Error: operation combines symbols in different segments
basename.s:998: Error: operation combines symbols in different segments

As can be seen in the output basename.s, the section is setup to be .text at
the beginning, but is switched to .sdata2 for the ident content but then never
changed back to .text.

.text
$Ltext0:
#APP
.sdata2
.ascii "$Id$\0"

#NO_APP
.align  2
.globl  Basename
$LFB35:
$LM1:
.entBasename
.type   Basename, @function
Basename:
.frame  r1,32,r15   # vars= 0, regs= 1, args= 24
.mask   0x00088000
$LVL0:
addik   r1,r1,-32

Which results in the $LVL0-$Ltext0 (and others) crossing sections.

This may be a duplicate of a previously reported bug.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63261

[Bug target/83013] MicroBlaze - #ident - Error: operation combines symbols in different segments

2017-11-15 Thread nathan at nathanrossi dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83013

--- Comment #1 from nathan at nathanrossi dot com ---
Created attachment 42619
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42619&action=edit
output assembly

[Bug target/83013] MicroBlaze - #ident - Error: operation combines symbols in different segments

2017-11-15 Thread nathan at nathanrossi dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83013

--- Comment #2 from nathan at nathanrossi dot com ---
One solution to this bug is to remove the microblaze specific emission of ident
use the default which emits .ident directives for the assembler.

I've sent a patch which makes this change:

https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01279.html