[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2021-08-27 Thread giulio.benetti at benettiengineering dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #16 from Giulio Benetti  ---
Thank you. Yes I've just tested "-freorder-blocks-algorithm=simple" solution of
gcc 9.x and 11.x with -Os enabled and it works perfectly.

By the way, is it useful for you if I provide .i and .s file with -save-temps?

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2021-08-27 Thread glaubitz at physik dot fu-berlin.de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #15 from John Paul Adrian Glaubitz  ---
(In reply to Giulio Benetti from comment #14)
> This bug still shows up in gcc version 9.x and 11.x. But not on version 10.x
> I've found the simple work-around to disable the optimization(override
> CFLAGS with -O0) and it works.

That removes too many optimizations. As explained in comment 5 [1], it should
be enough to add "-freorder-blocks-algorithm=simple" instead of just removing
all optimizations.

> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143#c5

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2021-08-27 Thread giulio.benetti at benettiengineering dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #14 from Giulio Benetti  ---
This bug still shows up in gcc version 9.x and 11.x. But not on version 10.x
I've found the simple work-around to disable the optimization(override CFLAGS
with -O0) and it works.

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2017-12-06 Thread glaubitz at physik dot fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #13 from John Paul Adrian Glaubitz  ---
Let me know if any other input is necessary from my side.

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2017-11-26 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #12 from Segher Boessenkool  ---
Yes I use sh4-linux, but trunk (not 7).  Will try 7 later.

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2017-11-26 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #11 from Oleg Endo  ---
(In reply to James Clarke from comment #10)
> (In reply to Segher Boessenkool from comment #9)
> > What flags does it need?  I can't get it to fail.
> 
> Just -O2 -fPIC, at least with 7.2.0.

That is, if your default configuration is sh4-linux.  Otherwise you might need
to specify all the parameters.  AFAIR it's -ml -m4 -matomic-model=soft-gusa

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2017-11-26 Thread jrtc27 at jrtc27 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #10 from James Clarke  ---
(In reply to Segher Boessenkool from comment #9)
> What flags does it need?  I can't get it to fail.

Just -O2 -fPIC, at least with 7.2.0.

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2017-11-26 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #9 from Segher Boessenkool  ---
What flags does it need?  I can't get it to fail.

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2017-11-26 Thread jrtc27 at jrtc27 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #8 from James Clarke  ---
Created attachment 42719
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42719&action=edit
Reduced reproduction.

This is a reduced version of the original reproduction. Creduce will happily
make it even smaller if you let it do crazy enum-to-pointer casts and various
other warning-inducing things, but this builds with -Wall -Werror.

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2017-11-24 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

Segher Boessenkool  changed:

   What|Removed |Added

 CC||segher at gcc dot gnu.org

--- Comment #7 from Segher Boessenkool  ---
(In reply to Oleg Endo from comment #6)
> In the asm code I see the following line ...
> 
> .L3195:
>   .long   nir_alu_instr_create@PLT-(.LPCS230+2-.)
> 
> ... but the label .LPCS230 does not not exist in the file.  So I guess this
> is where the error comes from.

Yeah...  Compile with -da and see where that label came from and where it
disappeared?

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2017-11-24 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

Oleg Endo  changed:

   What|Removed |Added

 CC||segher at kernel dot 
crashing.org

--- Comment #6 from Oleg Endo  ---
(In reply to John Paul Adrian Glaubitz from comment #2)
> Created attachment 42708 [details]
> Generated assembly for nir_lower_int64.c (gzipped)

In the asm code I see the following line ...

.L3195:
.long   nir_alu_instr_create@PLT-(.LPCS230+2-.)

... but the label .LPCS230 does not not exist in the file.  So I guess this is
where the error comes from.  But no idea why the label is not there.  AFAIR
Segher did some stuff for block reordering.  Maybe he's got any clue.

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2017-11-24 Thread glaubitz at physik dot fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #5 from John Paul Adrian Glaubitz  ---
It's fixed by adding "-freorder-blocks-algorithm=simple" which overrides
"-freorder-blocks-algorithm=stc" from "-O2".

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2017-11-24 Thread glaubitz at physik dot fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #4 from John Paul Adrian Glaubitz  ---
Building with "-O0" instead of "-O2" resolves the issue.

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2017-11-24 Thread glaubitz at physik dot fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #3 from John Paul Adrian Glaubitz  ---
Created attachment 42710
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42710&action=edit
Generated object for nir_lower_int64.c

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2017-11-24 Thread glaubitz at physik dot fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #2 from John Paul Adrian Glaubitz  ---
Created attachment 42708
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42708&action=edit
Generated assembly for nir_lower_int64.c (gzipped)

[Bug target/83143] [SH]: Assembler messages: invalid operands (*UND* and .text sections) for `-'

2017-11-24 Thread glaubitz at physik dot fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143

--- Comment #1 from John Paul Adrian Glaubitz  ---
Created attachment 42707
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42707&action=edit
Intermediate source for nir_lower_int64.c